/[gentoo-x86]/dev-util/cmake/files/cmake-2.6.1-gc-sections.patch
Gentoo

Contents of /dev-util/cmake/files/cmake-2.6.1-gc-sections.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Dec 2 23:25:37 2008 UTC (5 years, 8 months ago) by scarabeus
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Dupe old. Update current to eapi2. Fixes bug #226153.
(Portage version: 2.2_rc16/cvs/Linux 2.6.27-gentoo x86_64)

1 Fix compatibility with -Wl,--gc-sections.
2
3 http://www.cmake.org/pipermail/cmake/2008-August/023240.html
4 http://www.cmake.org/pipermail/cmake-commits/2008-August/004477.html
5
6 --- Modules/CheckTypeSizeC.c.in
7 +++ Modules/CheckTypeSizeC.c.in
8 @@ -29,15 +29,16 @@
9 ('0' + (SIZE % 10)),
10 ']','\0'};
11
12 -
13 #ifdef __CLASSIC_C__
14 -int main(){
15 - int ac;
16 - char*av[];
17 +int main(argc, argv) int argc; char *argv[];
18 #else
19 -int main(int ac, char*av[]){
20 +int main(int argc, char *argv[])
21 #endif
22 - return (&info_sizeof[0] != &info_sizeof[0]);
23 +{
24 + int require = 0;
25 + require += info_sizeof[argc];
26 + (void)argv;
27 + return require;
28 }
29
30 #else /* CHECK_TYPE_SIZE_TYPE */
31 --- Modules/CMakeCCompilerABI.c
32 +++ Modules/CMakeCCompilerABI.c
33 @@ -12,17 +12,17 @@
34
35 /*--------------------------------------------------------------------------*/
36
37 -/* Make sure the information strings are referenced. */
38 -#define REQUIRE(x) (&x[0] != &require)
39 -
40 -int main()
41 +#ifdef __CLASSIC_C__
42 +int main(argc, argv) int argc; char *argv[];
43 +#else
44 +int main(int argc, char *argv[])
45 +#endif
46 {
47 - const char require = 0;
48 - return
49 - (
50 - REQUIRE(info_sizeof_dptr)
51 + int require = 0;
52 + require += info_sizeof_dptr[argc];
53 #if defined(ABI_ID)
54 - && REQUIRE(info_abi)
55 + require += info_abi[argc];
56 #endif
57 - );
58 + (void)argv;
59 + return require;
60 }
61 --- Modules/CMakeCCompilerId.c.in
62 +++ Modules/CMakeCCompilerId.c.in
63 @@ -2,15 +2,9 @@
64 # error "A C++ compiler has been selected for C."
65 #endif
66
67 -/* Provide main() so the program can link. */
68 #if defined(__18CXX)
69 # define ID_VOID_MAIN
70 #endif
71 -#ifdef ID_VOID_MAIN
72 -void main() {}
73 -#else
74 -int main() { return 0; }
75 -#endif
76
77 #if defined(__INTEL_COMPILER) || defined(__ICC)
78 # define COMPILER_ID "Intel"
79 @@ -82,3 +76,18 @@
80 char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
81
82 @CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
83 +
84 +/*--------------------------------------------------------------------------*/
85 +
86 +#ifdef ID_VOID_MAIN
87 +void main() {}
88 +#else
89 +int main(int argc, char* argv[])
90 +{
91 + int require = 0;
92 + require += info_compiler[argc];
93 + require += info_platform[argc];
94 + (void)argv;
95 + return require;
96 +}
97 +#endif
98 --- Modules/CMakeCXXCompilerABI.cpp
99 +++ Modules/CMakeCXXCompilerABI.cpp
100 @@ -8,17 +8,13 @@
101
102 /*--------------------------------------------------------------------------*/
103
104 -/* Make sure the information strings are referenced. */
105 -#define REQUIRE(x) (&x[0] != &require)
106 -
107 -int main()
108 +int main(int argc, char* argv[])
109 {
110 - const char require = 0;
111 - return
112 - (
113 - REQUIRE(info_sizeof_dptr)
114 + int require = 0;
115 + require += info_sizeof_dptr[argc];
116 #if defined(ABI_ID)
117 - && REQUIRE(info_abi)
118 + require += info_abi[argc];
119 #endif
120 - );
121 + (void)argv;
122 + return require;
123 }
124 --- Modules/CMakeCXXCompilerId.cpp.in
125 +++ Modules/CMakeCXXCompilerId.cpp.in
126 @@ -5,9 +5,6 @@
127 # error "A C compiler has been selected for C++."
128 #endif
129
130 -/* Provide main() so the program can link. */
131 -int main() { return 0; }
132 -
133 #if defined(__COMO__)
134 # define COMPILER_ID "Comeau"
135
136 @@ -70,3 +67,14 @@
137 char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
138
139 @CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
140 +
141 +/*--------------------------------------------------------------------------*/
142 +
143 +int main(int argc, char* argv[])
144 +{
145 + int require = 0;
146 + require += info_compiler[argc];
147 + require += info_platform[argc];
148 + (void)argv;
149 + return require;
150 +}
151 --- Modules/TestEndianess.c.in
152 +++ Modules/TestEndianess.c.in
153 @@ -10,11 +10,14 @@
154 const cmakeint16 info_big[] = {0x5448, 0x4953, 0x2049, 0x5320, 0x4249, 0x4720, 0x454e, 0x4449, 0x414e, 0x2e2e, 0x0000};
155
156 #ifdef __CLASSIC_C__
157 -int main(){
158 - int ac;
159 - char*av[];
160 +int main(argc, argv) int argc; char *argv[];
161 #else
162 -int main(int ac, char*av[]){
163 +int main(int argc, char *argv[])
164 #endif
165 - return (&info_little[0] != &info_big[0]);
166 +{
167 + int require = 0;
168 + require += info_little[argc];
169 + require += info_big[argc];
170 + (void)argv;
171 + return require;
172 }

  ViewVC Help
Powered by ViewVC 1.1.20