Commit a1365647022eb05a5993f270a78e9bef3bf554eb
Committed by
Linus Torvalds
1 parent
fd285bb54d
Exists in
master
and in
7 other branches
[PATCH] remove gcc-2 checks
Remove various things which were checking for gcc-1.x and gcc-2.x compilers. From: Adrian Bunk <bunk@stusta.de> Some documentation updates and removes some code paths for gcc < 3.2. Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 32 changed files with 37 additions and 194 deletions Side-by-side Diff
- Documentation/Changes
- README
- arch/arm/kernel/asm-offsets.c
- arch/arm26/kernel/asm-offsets.c
- arch/i386/Kconfig
- arch/i386/Makefile
- arch/i386/Makefile.cpu
- arch/ia64/Makefile
- arch/ia64/kernel/head.S
- arch/ia64/kernel/ia64_ksyms.c
- arch/ia64/oprofile/backtrace.c
- drivers/md/raid0.c
- drivers/media/video/v4l2-common.c
- fs/ocfs2/cluster/masklog.h
- fs/xfs/xfs_log.h
- include/asm-alpha/compiler.h
- include/asm-alpha/processor.h
- include/asm-ia64/bug.h
- include/asm-ia64/spinlock.h
- include/asm-sparc64/system.h
- include/asm-um/rwsem.h
- include/asm-v850/unistd.h
- include/linux/byteorder/generic.h
- include/linux/byteorder/swab.h
- include/linux/byteorder/swabb.h
- include/linux/compiler-gcc.h
- include/linux/compiler-gcc3.h
- include/linux/compiler-gcc4.h
- include/linux/kernel.h
- include/linux/seccomp.h
- include/linux/spinlock_types_up.h
- sound/isa/wavefront/wavefront_synth.c
Documentation/Changes
... | ... | @@ -31,8 +31,6 @@ |
31 | 31 | Eine deutsche Version dieser Datei finden Sie unter |
32 | 32 | <http://www.stefan-winter.de/Changes-2.4.0.txt>. |
33 | 33 | |
34 | -Last updated: October 29th, 2002 | |
35 | - | |
36 | 34 | Chris Ricker (kaboom@gatech.edu or chris.ricker@genetics.utah.edu). |
37 | 35 | |
38 | 36 | Current Minimal Requirements |
... | ... | @@ -48,7 +46,7 @@ |
48 | 46 | hardware, for example, you probably needn't concern yourself with |
49 | 47 | isdn4k-utils. |
50 | 48 | |
51 | -o Gnu C 2.95.3 # gcc --version | |
49 | +o Gnu C 3.2 # gcc --version | |
52 | 50 | o Gnu make 3.79.1 # make --version |
53 | 51 | o binutils 2.12 # ld -v |
54 | 52 | o util-linux 2.10o # fdformat --version |
55 | 53 | |
... | ... | @@ -74,27 +72,8 @@ |
74 | 72 | --- |
75 | 73 | |
76 | 74 | The gcc version requirements may vary depending on the type of CPU in your |
77 | -computer. The next paragraph applies to users of x86 CPUs, but not | |
78 | -necessarily to users of other CPUs. Users of other CPUs should obtain | |
79 | -information about their gcc version requirements from another source. | |
75 | +computer. | |
80 | 76 | |
81 | -The recommended compiler for the kernel is gcc 2.95.x (x >= 3), and it | |
82 | -should be used when you need absolute stability. You may use gcc 3.0.x | |
83 | -instead if you wish, although it may cause problems. Later versions of gcc | |
84 | -have not received much testing for Linux kernel compilation, and there are | |
85 | -almost certainly bugs (mainly, but not exclusively, in the kernel) that | |
86 | -will need to be fixed in order to use these compilers. In any case, using | |
87 | -pgcc instead of plain gcc is just asking for trouble. | |
88 | - | |
89 | -The Red Hat gcc 2.96 compiler subtree can also be used to build this tree. | |
90 | -You should ensure you use gcc-2.96-74 or later. gcc-2.96-54 will not build | |
91 | -the kernel correctly. | |
92 | - | |
93 | -In addition, please pay attention to compiler optimization. Anything | |
94 | -greater than -O2 may not be wise. Similarly, if you choose to use gcc-2.95.x | |
95 | -or derivatives, be sure not to use -fstrict-aliasing (which, depending on | |
96 | -your version of gcc 2.95.x, may necessitate using -fno-strict-aliasing). | |
97 | - | |
98 | 77 | Make |
99 | 78 | ---- |
100 | 79 | |
... | ... | @@ -322,9 +301,9 @@ |
322 | 301 | Kernel compilation |
323 | 302 | ****************** |
324 | 303 | |
325 | -gcc 2.95.3 | |
326 | ----------- | |
327 | -o <ftp://ftp.gnu.org/gnu/gcc/gcc-2.95.3.tar.gz> | |
304 | +gcc | |
305 | +--- | |
306 | +o <ftp://ftp.gnu.org/gnu/gcc/> | |
328 | 307 | |
329 | 308 | Make |
330 | 309 | ---- |
README
... | ... | @@ -183,11 +183,8 @@ |
183 | 183 | |
184 | 184 | COMPILING the kernel: |
185 | 185 | |
186 | - - Make sure you have gcc 2.95.3 available. | |
187 | - gcc 2.91.66 (egcs-1.1.2), and gcc 2.7.2.3 are known to miscompile | |
188 | - some parts of the kernel, and are *no longer supported*. | |
189 | - Also remember to upgrade your binutils package (for as/ld/nm and company) | |
190 | - if necessary. For more information, refer to Documentation/Changes. | |
186 | + - Make sure you have at least gcc 3.2 available. | |
187 | + For more information, refer to Documentation/Changes. | |
191 | 188 | |
192 | 189 | Please note that you can still run a.out user programs with this kernel. |
193 | 190 |
arch/arm/kernel/asm-offsets.c
... | ... | @@ -23,20 +23,15 @@ |
23 | 23 | #error Sorry, your compiler targets APCS-26 but this kernel requires APCS-32 |
24 | 24 | #endif |
25 | 25 | /* |
26 | - * GCC 2.95.1, 2.95.2: ignores register clobber list in asm(). | |
27 | 26 | * GCC 3.0, 3.1: general bad code generation. |
28 | 27 | * GCC 3.2.0: incorrect function argument offset calculation. |
29 | 28 | * GCC 3.2.x: miscompiles NEW_AUX_ENT in fs/binfmt_elf.c |
30 | 29 | * (http://gcc.gnu.org/PR8896) and incorrect structure |
31 | 30 | * initialisation in fs/jffs2/erase.c |
32 | 31 | */ |
33 | -#if __GNUC__ < 2 || \ | |
34 | - (__GNUC__ == 2 && __GNUC_MINOR__ < 95) || \ | |
35 | - (__GNUC__ == 2 && __GNUC_MINOR__ == 95 && __GNUC_PATCHLEVEL__ != 0 && \ | |
36 | - __GNUC_PATCHLEVEL__ < 3) || \ | |
37 | - (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | |
32 | +#if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | |
38 | 33 | #error Your compiler is too buggy; it is known to miscompile kernels. |
39 | -#error Known good compilers: 2.95.3, 2.95.4, 2.96, 3.3 | |
34 | +#error Known good compilers: 3.3 | |
40 | 35 | #endif |
41 | 36 | |
42 | 37 | /* Use marker if you need to separate the values later */ |
arch/arm26/kernel/asm-offsets.c
... | ... | @@ -25,13 +25,6 @@ |
25 | 25 | #if defined(__APCS_32__) && defined(CONFIG_CPU_26) |
26 | 26 | #error Sorry, your compiler targets APCS-32 but this kernel requires APCS-26 |
27 | 27 | #endif |
28 | -#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 95) | |
29 | -#error Sorry, your compiler is known to miscompile kernels. Only use gcc 2.95.3 and later. | |
30 | -#endif | |
31 | -#if __GNUC__ == 2 && __GNUC_MINOR__ == 95 | |
32 | -/* shame we can't detect the .1 or .2 releases */ | |
33 | -#warning GCC 2.95.2 and earlier miscompiles kernels. | |
34 | -#endif | |
35 | 28 | |
36 | 29 | /* Use marker if you need to separate the values later */ |
37 | 30 |
arch/i386/Kconfig
... | ... | @@ -630,10 +630,6 @@ |
630 | 630 | and passes the first three arguments of a function call in registers. |
631 | 631 | This will probably break binary only modules. |
632 | 632 | |
633 | - This feature is only enabled for gcc-3.0 and later - earlier compilers | |
634 | - generate incorrect output with certain kernel constructs when | |
635 | - -mregparm=3 is used. | |
636 | - | |
637 | 633 | config SECCOMP |
638 | 634 | bool "Enable seccomp to safely compute untrusted bytecode" |
639 | 635 | depends on PROC_FS |
arch/i386/Makefile
... | ... | @@ -37,10 +37,7 @@ |
37 | 37 | # CPU-specific tuning. Anything which can be shared with UML should go here. |
38 | 38 | include $(srctree)/arch/i386/Makefile.cpu |
39 | 39 | |
40 | -# -mregparm=3 works ok on gcc-3.0 and later | |
41 | -# | |
42 | -GCC_VERSION := $(call cc-version) | |
43 | -cflags-$(CONFIG_REGPARM) += $(shell if [ $(GCC_VERSION) -ge 0300 ] ; then echo "-mregparm=3"; fi ;) | |
40 | +cflags-$(CONFIG_REGPARM) += -mregparm=3 | |
44 | 41 | |
45 | 42 | # Disable unit-at-a-time mode, it makes gcc use a lot more stack |
46 | 43 | # due to the lack of sharing of stacklots. |
arch/i386/Makefile.cpu
1 | 1 | # CPU tuning section - shared with UML. |
2 | 2 | # Must change only cflags-y (or [yn]), not CFLAGS! That makes a difference for UML. |
3 | 3 | |
4 | -#-mtune exists since gcc 3.4, and some -mcpu flavors didn't exist in gcc 2.95. | |
4 | +#-mtune exists since gcc 3.4 | |
5 | 5 | HAS_MTUNE := $(call cc-option-yn, -mtune=i386) |
6 | 6 | ifeq ($(HAS_MTUNE),y) |
7 | 7 | tune = $(call cc-option,-mtune=$(1),) |
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | cflags-$(CONFIG_M486) += -march=i486 |
15 | 15 | cflags-$(CONFIG_M586) += -march=i586 |
16 | 16 | cflags-$(CONFIG_M586TSC) += -march=i586 |
17 | -cflags-$(CONFIG_M586MMX) += $(call cc-option,-march=pentium-mmx,-march=i586) | |
17 | +cflags-$(CONFIG_M586MMX) += -march=pentium-mmx | |
18 | 18 | cflags-$(CONFIG_M686) += -march=i686 |
19 | 19 | cflags-$(CONFIG_MPENTIUMII) += -march=i686 $(call tune,pentium2) |
20 | 20 | cflags-$(CONFIG_MPENTIUMIII) += -march=i686 $(call tune,pentium3) |
... | ... | @@ -23,8 +23,8 @@ |
23 | 23 | cflags-$(CONFIG_MK6) += -march=k6 |
24 | 24 | # Please note, that patches that add -march=athlon-xp and friends are pointless. |
25 | 25 | # They make zero difference whatsosever to performance at this time. |
26 | -cflags-$(CONFIG_MK7) += $(call cc-option,-march=athlon,-march=i686 $(align)-functions=4) | |
27 | -cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,$(call cc-option,-march=athlon,-march=i686 $(align)-functions=4)) | |
26 | +cflags-$(CONFIG_MK7) += -march=athlon | |
27 | +cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,-march=athlon) | |
28 | 28 | cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 |
29 | 29 | cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 |
30 | 30 | cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586) |
... | ... | @@ -37,5 +37,5 @@ |
37 | 37 | cflags-$(CONFIG_X86_ELAN) += -march=i486 |
38 | 38 | |
39 | 39 | # Geode GX1 support |
40 | -cflags-$(CONFIG_MGEODEGX1) += $(call cc-option,-march=pentium-mmx,-march=i486) | |
40 | +cflags-$(CONFIG_MGEODEGX1) += -march=pentium-mmx |
arch/ia64/Makefile
... | ... | @@ -37,10 +37,6 @@ |
37 | 37 | ftp://ftp.hpl.hp.com/pub/linux-ia64/gas-030124.tar.gz) |
38 | 38 | endif |
39 | 39 | |
40 | -ifneq ($(shell if [ $(GCC_VERSION) -lt 0300 ] ; then echo "bad"; fi ;),) | |
41 | -$(error Sorry, your compiler is too old. GCC v2.96 is known to generate bad code.) | |
42 | -endif | |
43 | - | |
44 | 40 | ifeq ($(GCC_VERSION),0304) |
45 | 41 | cflags-$(CONFIG_ITANIUM) += -mtune=merced |
46 | 42 | cflags-$(CONFIG_MCKINLEY) += -mtune=mckinley |
arch/ia64/kernel/head.S
... | ... | @@ -1060,7 +1060,7 @@ |
1060 | 1060 | * the clobber lists for spin_lock() in include/asm-ia64/spinlock.h. |
1061 | 1061 | */ |
1062 | 1062 | |
1063 | -#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | |
1063 | +#if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | |
1064 | 1064 | |
1065 | 1065 | GLOBAL_ENTRY(ia64_spinlock_contention_pre3_4) |
1066 | 1066 | .prologue |
arch/ia64/kernel/ia64_ksyms.c
... | ... | @@ -103,7 +103,7 @@ |
103 | 103 | |
104 | 104 | #ifdef ASM_SUPPORTED |
105 | 105 | # ifdef CONFIG_SMP |
106 | -# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | |
106 | +# if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | |
107 | 107 | /* |
108 | 108 | * This is not a normal routine and we don't want a function descriptor for it, so we use |
109 | 109 | * a fake declaration here. |
arch/ia64/oprofile/backtrace.c
... | ... | @@ -32,7 +32,7 @@ |
32 | 32 | u64 *prev_pfs_loc; /* state for WAR for old spinlock ool code */ |
33 | 33 | } ia64_backtrace_t; |
34 | 34 | |
35 | -#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | |
35 | +#if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | |
36 | 36 | /* |
37 | 37 | * Returns non-zero if the PC is in the spinlock contention out-of-line code |
38 | 38 | * with non-standard calling sequence (on older compilers). |
drivers/md/raid0.c
... | ... | @@ -306,9 +306,6 @@ |
306 | 306 | printk("raid0 : conf->hash_spacing is %llu blocks.\n", |
307 | 307 | (unsigned long long)conf->hash_spacing); |
308 | 308 | { |
309 | -#if __GNUC__ < 3 | |
310 | - volatile | |
311 | -#endif | |
312 | 309 | sector_t s = mddev->array_size; |
313 | 310 | sector_t space = conf->hash_spacing; |
314 | 311 | int round; |
... | ... | @@ -439,9 +436,6 @@ |
439 | 436 | |
440 | 437 | |
441 | 438 | { |
442 | -#if __GNUC__ < 3 | |
443 | - volatile | |
444 | -#endif | |
445 | 439 | sector_t x = block >> conf->preshift; |
446 | 440 | sector_div(x, (u32)conf->hash_spacing); |
447 | 441 | zone = conf->hash_table[x]; |
drivers/media/video/v4l2-common.c
... | ... | @@ -191,9 +191,7 @@ |
191 | 191 | }; |
192 | 192 | |
193 | 193 | char *v4l2_ioctl_names[256] = { |
194 | -#if __GNUC__ >= 3 | |
195 | 194 | [0 ... 255] = "UNKNOWN", |
196 | -#endif | |
197 | 195 | [_IOC_NR(VIDIOC_QUERYCAP)] = "VIDIOC_QUERYCAP", |
198 | 196 | [_IOC_NR(VIDIOC_RESERVED)] = "VIDIOC_RESERVED", |
199 | 197 | [_IOC_NR(VIDIOC_ENUM_FMT)] = "VIDIOC_ENUM_FMT", |
fs/ocfs2/cluster/masklog.h
... | ... | @@ -212,11 +212,10 @@ |
212 | 212 | mlog(ML_ENTRY, "ENTRY:\n"); \ |
213 | 213 | } while (0) |
214 | 214 | |
215 | -/* We disable this for old compilers since they don't have support for | |
216 | - * __builtin_types_compatible_p. | |
215 | +/* | |
216 | + * We disable this for sparse. | |
217 | 217 | */ |
218 | -#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) && \ | |
219 | - !defined(__CHECKER__) | |
218 | +#if !defined(__CHECKER__) | |
220 | 219 | #define mlog_exit(st) do { \ |
221 | 220 | if (__builtin_types_compatible_p(typeof(st), unsigned long)) \ |
222 | 221 | mlog(ML_EXIT, "EXIT: %lu\n", (unsigned long) (st)); \ |
fs/xfs/xfs_log.h
... | ... | @@ -30,13 +30,7 @@ |
30 | 30 | * By comparing each compnent, we don't have to worry about extra |
31 | 31 | * endian issues in treating two 32 bit numbers as one 64 bit number |
32 | 32 | */ |
33 | -static | |
34 | -#if defined(__GNUC__) && (__GNUC__ == 2) && ( (__GNUC_MINOR__ == 95) || (__GNUC_MINOR__ == 96)) | |
35 | -__attribute__((unused)) /* gcc 2.95, 2.96 miscompile this when inlined */ | |
36 | -#else | |
37 | -__inline__ | |
38 | -#endif | |
39 | -xfs_lsn_t _lsn_cmp(xfs_lsn_t lsn1, xfs_lsn_t lsn2) | |
33 | +static inline xfs_lsn_t _lsn_cmp(xfs_lsn_t lsn1, xfs_lsn_t lsn2) | |
40 | 34 | { |
41 | 35 | if (CYCLE_LSN(lsn1) != CYCLE_LSN(lsn2)) |
42 | 36 | return (CYCLE_LSN(lsn1)<CYCLE_LSN(lsn2))? -999 : 999; |
include/asm-alpha/compiler.h
... | ... | @@ -98,10 +98,8 @@ |
98 | 98 | #undef inline |
99 | 99 | #undef __inline__ |
100 | 100 | #undef __inline |
101 | -#if __GNUC__ == 3 && __GNUC_MINOR__ >= 1 || __GNUC__ > 3 | |
102 | 101 | #undef __always_inline |
103 | 102 | #define __always_inline inline __attribute__((always_inline)) |
104 | -#endif | |
105 | 103 | |
106 | 104 | #endif /* __ALPHA_COMPILER_H */ |
include/asm-alpha/processor.h
... | ... | @@ -77,7 +77,6 @@ |
77 | 77 | #define spin_lock_prefetch(lock) do { } while (0) |
78 | 78 | #endif |
79 | 79 | |
80 | -#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) | |
81 | 80 | extern inline void prefetch(const void *ptr) |
82 | 81 | { |
83 | 82 | __builtin_prefetch(ptr, 0, 3); |
... | ... | @@ -94,26 +93,6 @@ |
94 | 93 | __builtin_prefetch(ptr, 1, 3); |
95 | 94 | } |
96 | 95 | #endif |
97 | - | |
98 | -#else | |
99 | -extern inline void prefetch(const void *ptr) | |
100 | -{ | |
101 | - __asm__ ("ldl $31,%0" : : "m"(*(char *)ptr)); | |
102 | -} | |
103 | - | |
104 | -extern inline void prefetchw(const void *ptr) | |
105 | -{ | |
106 | - __asm__ ("ldq $31,%0" : : "m"(*(char *)ptr)); | |
107 | -} | |
108 | - | |
109 | -#ifdef CONFIG_SMP | |
110 | -extern inline void spin_lock_prefetch(const void *ptr) | |
111 | -{ | |
112 | - __asm__ ("ldq $31,%0" : : "m"(*(char *)ptr)); | |
113 | -} | |
114 | -#endif | |
115 | - | |
116 | -#endif /* GCC 3.1 */ | |
117 | 96 | |
118 | 97 | #endif /* __ASM_ALPHA_PROCESSOR_H */ |
include/asm-ia64/bug.h
... | ... | @@ -2,11 +2,7 @@ |
2 | 2 | #define _ASM_IA64_BUG_H |
3 | 3 | |
4 | 4 | #ifdef CONFIG_BUG |
5 | -#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) | |
6 | -# define ia64_abort() __builtin_trap() | |
7 | -#else | |
8 | -# define ia64_abort() (*(volatile int *) 0 = 0) | |
9 | -#endif | |
5 | +#define ia64_abort() __builtin_trap() | |
10 | 6 | #define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); ia64_abort(); } while (0) |
11 | 7 | |
12 | 8 | /* should this BUG be made generic? */ |
include/asm-ia64/spinlock.h
... | ... | @@ -34,7 +34,7 @@ |
34 | 34 | { |
35 | 35 | register volatile unsigned int *ptr asm ("r31") = &lock->lock; |
36 | 36 | |
37 | -#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | |
37 | +#if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | |
38 | 38 | # ifdef CONFIG_ITANIUM |
39 | 39 | /* don't use brl on Itanium... */ |
40 | 40 | asm volatile ("{\n\t" |
include/asm-sparc64/system.h
... | ... | @@ -193,11 +193,7 @@ |
193 | 193 | * not preserve it's value. Hairy, but it lets us remove 2 loads |
194 | 194 | * and 2 stores in this critical code path. -DaveM |
195 | 195 | */ |
196 | -#if __GNUC__ >= 3 | |
197 | 196 | #define EXTRA_CLOBBER ,"%l1" |
198 | -#else | |
199 | -#define EXTRA_CLOBBER | |
200 | -#endif | |
201 | 197 | #define switch_to(prev, next, last) \ |
202 | 198 | do { if (test_thread_flag(TIF_PERFCTR)) { \ |
203 | 199 | unsigned long __tmp; \ |
include/asm-um/rwsem.h
include/asm-v850/unistd.h
... | ... | @@ -241,9 +241,6 @@ |
241 | 241 | /* User programs sometimes end up including this header file |
242 | 242 | (indirectly, via uClibc header files), so I'm a bit nervous just |
243 | 243 | including <linux/compiler.h>. */ |
244 | -#if !defined(__builtin_expect) && __GNUC__ == 2 && __GNUC_MINOR__ < 96 | |
245 | -#define __builtin_expect(x, expected_value) (x) | |
246 | -#endif | |
247 | 244 | |
248 | 245 | #define __syscall_return(type, res) \ |
249 | 246 | do { \ |
250 | 247 | |
251 | 248 | |
... | ... | @@ -346,29 +343,14 @@ |
346 | 343 | __syscall_return (type, __ret); \ |
347 | 344 | } |
348 | 345 | |
349 | -#if __GNUC__ < 3 | |
350 | -/* In older versions of gcc, `asm' statements with more than 10 | |
351 | - input/output arguments produce a fatal error. To work around this | |
352 | - problem, we use two versions, one for gcc-3.x and one for earlier | |
353 | - versions of gcc (the `earlier gcc' version doesn't work with gcc-3.x | |
354 | - because gcc-3.x doesn't allow clobbers to also be input arguments). */ | |
355 | 346 | #define __SYSCALL6_TRAP(syscall, ret, a, b, c, d, e, f) \ |
356 | 347 | __asm__ __volatile__ ("trap " SYSCALL_LONG_TRAP \ |
357 | - : "=r" (ret), "=r" (syscall) \ | |
358 | - : "1" (syscall), \ | |
359 | - "r" (a), "r" (b), "r" (c), "r" (d), \ | |
360 | - "r" (e), "r" (f) \ | |
361 | - : SYSCALL_CLOBBERS, SYSCALL_ARG4, SYSCALL_ARG5); | |
362 | -#else /* __GNUC__ >= 3 */ | |
363 | -#define __SYSCALL6_TRAP(syscall, ret, a, b, c, d, e, f) \ | |
364 | - __asm__ __volatile__ ("trap " SYSCALL_LONG_TRAP \ | |
365 | 348 | : "=r" (ret), "=r" (syscall), \ |
366 | 349 | "=r" (e), "=r" (f) \ |
367 | 350 | : "1" (syscall), \ |
368 | 351 | "r" (a), "r" (b), "r" (c), "r" (d), \ |
369 | 352 | "2" (e), "3" (f) \ |
370 | 353 | : SYSCALL_CLOBBERS); |
371 | -#endif | |
372 | 354 | |
373 | 355 | #define _syscall6(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e, ftype, f) \ |
374 | 356 | type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \ |
include/linux/byteorder/generic.h
... | ... | @@ -156,7 +156,7 @@ |
156 | 156 | extern __u16 ntohs(__be16); |
157 | 157 | extern __be16 htons(__u16); |
158 | 158 | |
159 | -#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) | |
159 | +#if defined(__GNUC__) && defined(__OPTIMIZE__) | |
160 | 160 | |
161 | 161 | #define ___htonl(x) __cpu_to_be32(x) |
162 | 162 | #define ___htons(x) __cpu_to_be16(x) |
include/linux/byteorder/swab.h
... | ... | @@ -110,7 +110,7 @@ |
110 | 110 | /* |
111 | 111 | * Allow constant folding |
112 | 112 | */ |
113 | -#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) | |
113 | +#if defined(__GNUC__) && defined(__OPTIMIZE__) | |
114 | 114 | # define __swab16(x) \ |
115 | 115 | (__builtin_constant_p((__u16)(x)) ? \ |
116 | 116 | ___swab16((x)) : \ |
include/linux/byteorder/swabb.h
include/linux/compiler-gcc.h
... | ... | @@ -15,4 +15,13 @@ |
15 | 15 | ({ unsigned long __ptr; \ |
16 | 16 | __asm__ ("" : "=g"(__ptr) : "0"(ptr)); \ |
17 | 17 | (typeof(ptr)) (__ptr + (off)); }) |
18 | + | |
19 | + | |
20 | +#define inline inline __attribute__((always_inline)) | |
21 | +#define __inline__ __inline__ __attribute__((always_inline)) | |
22 | +#define __inline __inline __attribute__((always_inline)) | |
23 | +#define __deprecated __attribute__((deprecated)) | |
24 | +#define noinline __attribute__((noinline)) | |
25 | +#define __attribute_pure__ __attribute__((pure)) | |
26 | +#define __attribute_const__ __attribute__((__const__)) |
include/linux/compiler-gcc3.h
... | ... | @@ -3,27 +3,10 @@ |
3 | 3 | /* These definitions are for GCC v3.x. */ |
4 | 4 | #include <linux/compiler-gcc.h> |
5 | 5 | |
6 | -#if __GNUC_MINOR__ >= 1 | |
7 | -# define inline inline __attribute__((always_inline)) | |
8 | -# define __inline__ __inline__ __attribute__((always_inline)) | |
9 | -# define __inline __inline __attribute__((always_inline)) | |
10 | -#endif | |
11 | - | |
12 | -#if __GNUC_MINOR__ > 0 | |
13 | -# define __deprecated __attribute__((deprecated)) | |
14 | -#endif | |
15 | - | |
16 | 6 | #if __GNUC_MINOR__ >= 3 |
17 | 7 | # define __attribute_used__ __attribute__((__used__)) |
18 | 8 | #else |
19 | 9 | # define __attribute_used__ __attribute__((__unused__)) |
20 | -#endif | |
21 | - | |
22 | -#define __attribute_pure__ __attribute__((pure)) | |
23 | -#define __attribute_const__ __attribute__((__const__)) | |
24 | - | |
25 | -#if __GNUC_MINOR__ >= 1 | |
26 | -#define noinline __attribute__((noinline)) | |
27 | 10 | #endif |
28 | 11 | |
29 | 12 | #if __GNUC_MINOR__ >= 4 |
include/linux/compiler-gcc4.h
... | ... | @@ -3,14 +3,7 @@ |
3 | 3 | /* These definitions are for GCC v4.x. */ |
4 | 4 | #include <linux/compiler-gcc.h> |
5 | 5 | |
6 | -#define inline inline __attribute__((always_inline)) | |
7 | -#define __inline__ __inline__ __attribute__((always_inline)) | |
8 | -#define __inline __inline __attribute__((always_inline)) | |
9 | -#define __deprecated __attribute__((deprecated)) | |
10 | 6 | #define __attribute_used__ __attribute__((__used__)) |
11 | -#define __attribute_pure__ __attribute__((pure)) | |
12 | -#define __attribute_const__ __attribute__((__const__)) | |
13 | -#define noinline __attribute__((noinline)) | |
14 | 7 | #define __must_check __attribute__((warn_unused_result)) |
15 | 8 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) |
include/linux/kernel.h
include/linux/seccomp.h
... | ... | @@ -26,11 +26,7 @@ |
26 | 26 | |
27 | 27 | #else /* CONFIG_SECCOMP */ |
28 | 28 | |
29 | -#if (__GNUC__ > 2) | |
30 | - typedef struct { } seccomp_t; | |
31 | -#else | |
32 | - typedef struct { int gcc_is_buggy; } seccomp_t; | |
33 | -#endif | |
29 | +typedef struct { } seccomp_t; | |
34 | 30 | |
35 | 31 | #define secure_computing(x) do { } while (0) |
36 | 32 | /* static inline to preserve typechecking */ |
include/linux/spinlock_types_up.h
... | ... | @@ -22,31 +22,17 @@ |
22 | 22 | |
23 | 23 | #else |
24 | 24 | |
25 | -/* | |
26 | - * All gcc 2.95 versions and early versions of 2.96 have a nasty bug | |
27 | - * with empty initializers. | |
28 | - */ | |
29 | -#if (__GNUC__ > 2) | |
30 | 25 | typedef struct { } raw_spinlock_t; |
31 | 26 | |
32 | 27 | #define __RAW_SPIN_LOCK_UNLOCKED { } |
33 | -#else | |
34 | -typedef struct { int gcc_is_buggy; } raw_spinlock_t; | |
35 | -#define __RAW_SPIN_LOCK_UNLOCKED (raw_spinlock_t) { 0 } | |
36 | -#endif | |
37 | 28 | |
38 | 29 | #endif |
39 | 30 | |
40 | -#if (__GNUC__ > 2) | |
41 | 31 | typedef struct { |
42 | 32 | /* no debug version on UP */ |
43 | 33 | } raw_rwlock_t; |
44 | 34 | |
45 | 35 | #define __RAW_RW_LOCK_UNLOCKED { } |
46 | -#else | |
47 | -typedef struct { int gcc_is_buggy; } raw_rwlock_t; | |
48 | -#define __RAW_RW_LOCK_UNLOCKED (raw_rwlock_t) { 0 } | |
49 | -#endif | |
50 | 36 | |
51 | 37 | #endif /* __LINUX_SPINLOCK_TYPES_UP_H */ |
sound/isa/wavefront/wavefront_synth.c
... | ... | @@ -115,17 +115,10 @@ |
115 | 115 | |
116 | 116 | #ifdef WF_DEBUG |
117 | 117 | |
118 | -#if defined(NEW_MACRO_VARARGS) || __GNUC__ >= 3 | |
119 | 118 | #define DPRINT(cond, ...) \ |
120 | 119 | if ((dev->debug & (cond)) == (cond)) { \ |
121 | 120 | snd_printk (__VA_ARGS__); \ |
122 | 121 | } |
123 | -#else | |
124 | -#define DPRINT(cond, args...) \ | |
125 | - if ((dev->debug & (cond)) == (cond)) { \ | |
126 | - snd_printk (args); \ | |
127 | - } | |
128 | -#endif | |
129 | 122 | #else |
130 | 123 | #define DPRINT(cond, args...) |
131 | 124 | #endif /* WF_DEBUG */ |