Browse Source

Cope with gcc 3.4's more aggressive persuit of attribute unused

Eric Andersen 21 years ago
parent
commit
fbfde146ca

+ 3 - 0
include/features.h

@@ -437,6 +437,9 @@ uClibc was built without large file support enabled.
 #define __LINUX_COMPILER_H
 #define __LINUX_COMPILER_H
 #endif
 #endif
 
 
+/* Pull in things like __attribute_used__ */
+#include <sys/cdefs.h>
+
 /* --- this is added to integrate linuxthreads */
 /* --- this is added to integrate linuxthreads */
 #define __USE_UNIX98            1
 #define __USE_UNIX98            1
 
 

+ 1 - 1
ldso/ldso/arm/dl-startup.h

@@ -20,7 +20,7 @@ asm(""						\
 "	mov	pc, r6\n"			\
 "	mov	pc, r6\n"			\
 );
 );
 
 
-#define DL_BOOT(X)   static __attribute__ ((unused)) void* _dl_boot2 (X)
+#define DL_BOOT(X)   static __attribute_used__ void* _dl_boot2 (X)
 
 
 
 
 /* Get a pointer to the argv array.  On many platforms this can be just
 /* Get a pointer to the argv array.  On many platforms this can be just

+ 1 - 1
ldso/ldso/cris/dl-startup.h

@@ -15,7 +15,7 @@ asm(""					\
 "	jsr $r9\n"			\
 "	jsr $r9\n"			\
 );
 );
 
 
-#define DL_BOOT(X) static void __attribute__ ((unused)) _dl_boot2 (X)
+#define DL_BOOT(X) static void __attribute_used__ _dl_boot2 (X)
 
 
 
 
 /* Get a pointer to the argv array.  On many platforms this can be just
 /* Get a pointer to the argv array.  On many platforms this can be just

+ 11 - 13
ldso/ldso/frv/elfinterp.c

@@ -2,7 +2,7 @@
    Copyright (C) 2003 Red Hat, Inc.
    Copyright (C) 2003 Red Hat, Inc.
    Contributed by Alexandre Oliva <aoliva@redhat.com>
    Contributed by Alexandre Oliva <aoliva@redhat.com>
    Lots of code copied from ../i386/elfinterp.c, so:
    Lots of code copied from ../i386/elfinterp.c, so:
-   Copyright (c) 1994-2000 Eric Youngdale, Peter MacDonald, 
+   Copyright (c) 1994-2000 Eric Youngdale, Peter MacDonald,
   				David Engel, Hongjiu Lu and Mitch D'Souza
   				David Engel, Hongjiu Lu and Mitch D'Souza
    Copyright (C) 2001-2002, Erik Andersen
    Copyright (C) 2001-2002, Erik Andersen
    All rights reserved.
    All rights reserved.
@@ -24,9 +24,7 @@ License along with uClibc; see the file COPYING.LIB.  If not, write to
 the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
 the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
 USA.  */
 USA.  */
 
 
-#ifndef ATTRIBUTE_UNUSED
+#include <sys/cdefs.h>	    /* __attribute_used__ */
-# define ATTRIBUTE_UNUSED __attribute__((__unused__))
-#endif
 
 
 #if defined (__SUPPORT_LD_DEBUG__)
 #if defined (__SUPPORT_LD_DEBUG__)
 static const char *_dl_reltypes_tab[] =
 static const char *_dl_reltypes_tab[] =
@@ -393,9 +391,9 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
 
 
 static int
 static int
 _dl_do_lazy_reloc (struct elf_resolve *tpnt,
 _dl_do_lazy_reloc (struct elf_resolve *tpnt,
-		   struct dyn_elf *scope ATTRIBUTE_UNUSED,
+		   struct dyn_elf *scope __attribute_used__,
-		   ELF_RELOC *rpnt, Elf32_Sym *symtab ATTRIBUTE_UNUSED,
+		   ELF_RELOC *rpnt, Elf32_Sym *symtab __attribute_used__,
-		   char *strtab ATTRIBUTE_UNUSED)
+		   char *strtab __attribute_used__)
 {
 {
 	int reloc_type;
 	int reloc_type;
 	struct funcdesc_value volatile *reloc_addr;
 	struct funcdesc_value volatile *reloc_addr;
@@ -436,7 +434,7 @@ _dl_do_lazy_reloc (struct elf_resolve *tpnt,
 void
 void
 _dl_parse_lazy_relocation_information
 _dl_parse_lazy_relocation_information
 (struct dyn_elf *rpnt, unsigned long rel_addr, unsigned long rel_size,
 (struct dyn_elf *rpnt, unsigned long rel_addr, unsigned long rel_size,
- int type ATTRIBUTE_UNUSED)
+ int type __attribute_used__)
 {
 {
   _dl_parse(rpnt->dyn, NULL, rel_addr, rel_size, _dl_do_lazy_reloc);
   _dl_parse(rpnt->dyn, NULL, rel_addr, rel_size, _dl_do_lazy_reloc);
 }
 }
@@ -444,7 +442,7 @@ _dl_parse_lazy_relocation_information
 int
 int
 _dl_parse_relocation_information
 _dl_parse_relocation_information
 (struct dyn_elf *rpnt, unsigned long rel_addr, unsigned long rel_size,
 (struct dyn_elf *rpnt, unsigned long rel_addr, unsigned long rel_size,
- int type ATTRIBUTE_UNUSED)
+ int type __attribute_used__)
 {
 {
   /* The interpreter initial self-relocation is complete, and we
   /* The interpreter initial self-relocation is complete, and we
      can't re-apply relocations.  */
      can't re-apply relocations.  */
@@ -458,10 +456,10 @@ _dl_parse_relocation_information
 
 
 int
 int
 _dl_parse_copy_information
 _dl_parse_copy_information
-(struct dyn_elf *rpnt ATTRIBUTE_UNUSED,
+(struct dyn_elf *rpnt __attribute_used__,
- unsigned long rel_addr ATTRIBUTE_UNUSED,
+ unsigned long rel_addr __attribute_used__,
- unsigned long rel_size ATTRIBUTE_UNUSED,
+ unsigned long rel_size __attribute_used__,
- int type ATTRIBUTE_UNUSED)
+ int type __attribute_used__)
 {
 {
   return 0;
   return 0;
 }
 }

+ 1 - 1
ldso/ldso/i386/dl-startup.h

@@ -5,7 +5,7 @@
  */
  */
 
 
 /* For x86 we do not need any special setup so go right to _dl_boot() */
 /* For x86 we do not need any special setup so go right to _dl_boot() */
-#define DL_BOOT(X) __attribute__ ((unused)) void _dl_boot (X)
+#define DL_BOOT(X) __attribute_used__ void _dl_boot (X)
 
 
 /* Get a pointer to the argv array.  On many platforms this can be just
 /* Get a pointer to the argv array.  On many platforms this can be just
  * the address if the first argument, on other platforms we need to
  * the address if the first argument, on other platforms we need to

+ 1 - 1
ldso/ldso/m68k/dl-startup.h

@@ -3,7 +3,7 @@
  */
  */
 
 
 /* For m68k we do not need any special setup so go right to _dl_boot() */
 /* For m68k we do not need any special setup so go right to _dl_boot() */
-#define DL_BOOT(X) __attribute__ ((unused)) void _dl_boot (X)
+#define DL_BOOT(X) __attribute_used__ void _dl_boot (X)
 
 
 /* Get a pointer to the argv array.  On many platforms this can be just
 /* Get a pointer to the argv array.  On many platforms this can be just
  * the address if the first argument, on other platforms we need to
  * the address if the first argument, on other platforms we need to

+ 1 - 1
ldso/ldso/mips/dl-startup.h

@@ -34,7 +34,7 @@ asm("" \
 "	jr $25\n"			\
 "	jr $25\n"			\
 );
 );
 
 
-#define DL_BOOT(X)   static void __attribute__ ((unused)) _dl_boot2 (X)
+#define DL_BOOT(X)   static void __attribute_used__ _dl_boot2 (X)
 
 
 /*
 /*
  * Get a pointer to the argv array.  On many platforms this can be just
  * Get a pointer to the argv array.  On many platforms this can be just

+ 1 - 1
ldso/ldso/powerpc/dl-startup.h

@@ -17,7 +17,7 @@ asm("" \
 ".previous\n"				\
 ".previous\n"				\
 );
 );
 
 
-#define DL_BOOT(X) static void __attribute__ ((unused)) _dl_boot2(X)
+#define DL_BOOT(X) static void __attribute_used__ _dl_boot2(X)
 
 
 /*
 /*
  * Get a pointer to the argv array.  On many platforms this can be just
  * Get a pointer to the argv array.  On many platforms this can be just

+ 1 - 1
ldso/ldso/sh/dl-startup.h

@@ -18,7 +18,7 @@ asm("" \
 "	.previous\n"			\
 "	.previous\n"			\
 );
 );
 
 
-#define DL_BOOT(X)   static void __attribute__ ((unused)) _dl_boot2 (X)
+#define DL_BOOT(X)   static void __attribute_used__ _dl_boot2 (X)
 
 
 /*
 /*
  * Get a pointer to the argv array.  On many platforms this can be just
  * Get a pointer to the argv array.  On many platforms this can be just

+ 1 - 1
ldso/ldso/sh64/dl-startup.h

@@ -21,7 +21,7 @@ asm("" \
 "	blink	tr0, r18	! call _dl_boot2 - user EP is in r2\n"	\
 "	blink	tr0, r18	! call _dl_boot2 - user EP is in r2\n"	\
 );
 );
 
 
-#define DL_BOOT(X)   static void __attribute__ ((unused)) _dl_boot2 (X)
+#define DL_BOOT(X)   static void __attribute_used__ _dl_boot2 (X)
 
 
 /*
 /*
  * Get a pointer to the argv array.  On many platforms this can be just
  * Get a pointer to the argv array.  On many platforms this can be just

+ 1 - 1
ldso/ldso/sparc/dl-startup.h

@@ -4,7 +4,7 @@
  * can be done.
  * can be done.
  */
  */
 
 
-#define DL_BOOT(X) __attribute__ ((unused)) void _dl_boot (X)
+#define DL_BOOT(X) __attribute_used__ void _dl_boot (X)
 
 
 
 
 /*
 /*

+ 1 - 1
libc/inet/rpc/clnt_perror.c

@@ -425,7 +425,7 @@ auth_errmsg (enum auth_stat stat)
 }
 }
 
 
 
 
-static void __attribute__ ((unused))
+static void __attribute_used__
 free_mem (void)
 free_mem (void)
 {
 {
   free (buf);
   free (buf);

+ 3 - 3
libc/sysdeps/linux/alpha/bits/atomicity.h

@@ -24,7 +24,7 @@
 
 
 
 
 static inline int
 static inline int
-__attribute__ ((unused))
+__attribute_used__
 exchange_and_add (volatile uint32_t *mem, int val)
 exchange_and_add (volatile uint32_t *mem, int val)
 {
 {
   register int result, tmp;
   register int result, tmp;
@@ -49,7 +49,7 @@ exchange_and_add (volatile uint32_t *mem, int val)
 }
 }
 
 
 static inline void
 static inline void
-__attribute__ ((unused))
+__attribute_used__
 atomic_add (volatile uint32_t *mem, int val)
 atomic_add (volatile uint32_t *mem, int val)
 {
 {
   register int result;
   register int result;
@@ -72,7 +72,7 @@ atomic_add (volatile uint32_t *mem, int val)
 }
 }
 
 
 static inline long
 static inline long
-__attribute__ ((unused))
+__attribute_used__
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 {
 {
   long int ret;
   long int ret;

+ 3 - 3
libc/sysdeps/linux/arm/bits/atomicity.h

@@ -24,7 +24,7 @@
 
 
 
 
 static inline int
 static inline int
-__attribute__ ((unused))
+__attribute_used__
 exchange_and_add (volatile uint32_t *mem, int val)
 exchange_and_add (volatile uint32_t *mem, int val)
 {
 {
   int tmp1;
   int tmp1;
@@ -44,7 +44,7 @@ exchange_and_add (volatile uint32_t *mem, int val)
 }
 }
 
 
 static inline void
 static inline void
-__attribute__ ((unused))
+__attribute_used__
 atomic_add (volatile uint32_t *mem, int val)
 atomic_add (volatile uint32_t *mem, int val)
 {
 {
   int tmp1;
   int tmp1;
@@ -63,7 +63,7 @@ atomic_add (volatile uint32_t *mem, int val)
 }
 }
 
 
 static inline int
 static inline int
-__attribute__ ((unused))
+__attribute_used__
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 {
 {
   int result, tmp;
   int result, tmp;

+ 3 - 3
libc/sysdeps/linux/common/bits/atomicity.h

@@ -25,7 +25,7 @@
 #warning stub atomicity functions are not really atomic
 #warning stub atomicity functions are not really atomic
 
 
 static inline int
 static inline int
-__attribute__ ((unused))
+__attribute_used__
 exchange_and_add (volatile uint32_t *mem, int val)
 exchange_and_add (volatile uint32_t *mem, int val)
 {
 {
   int result = *mem;
   int result = *mem;
@@ -34,14 +34,14 @@ exchange_and_add (volatile uint32_t *mem, int val)
 }
 }
 
 
 static inline void
 static inline void
-__attribute__ ((unused))
+__attribute_used__
 atomic_add (volatile uint32_t *mem, int val)
 atomic_add (volatile uint32_t *mem, int val)
 {
 {
   *mem += val;
   *mem += val;
 }
 }
 
 
 static inline int
 static inline int
-__attribute__ ((unused))
+__attribute_used__
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 {
 {
   if (*p != oldval)
   if (*p != oldval)

+ 3 - 3
libc/sysdeps/linux/i386/bits/atomicity.h

@@ -24,7 +24,7 @@
 
 
 
 
 static inline uint32_t
 static inline uint32_t
-__attribute__ ((unused))
+__attribute_used__
 exchange_and_add (volatile uint32_t *mem, uint32_t val)
 exchange_and_add (volatile uint32_t *mem, uint32_t val)
 {
 {
   register uint32_t result;
   register uint32_t result;
@@ -34,7 +34,7 @@ exchange_and_add (volatile uint32_t *mem, uint32_t val)
 }
 }
 
 
 static inline void
 static inline void
-__attribute__ ((unused))
+__attribute_used__
 atomic_add (volatile uint32_t *mem, int val)
 atomic_add (volatile uint32_t *mem, int val)
 {
 {
   __asm__ __volatile__ ("lock; addl %1,%0"
   __asm__ __volatile__ ("lock; addl %1,%0"
@@ -42,7 +42,7 @@ atomic_add (volatile uint32_t *mem, int val)
 }
 }
 
 
 static inline char
 static inline char
-__attribute__ ((unused))
+__attribute_used__
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 {
 {
   char ret;
   char ret;

+ 1 - 1
libc/sysdeps/linux/i386/bits/mathinline.h

@@ -408,7 +408,7 @@ __inline_mathcodeNP_ (long double, __expl, __x, __exp_code)
 
 
 __inline_mathcodeNP (tan, __x, \
 __inline_mathcodeNP (tan, __x, \
   register long double __value;						      \
   register long double __value;						      \
-  register long double __value2 __attribute__ ((__unused__));		      \
+  register long double __value2 __attribute_used__;			      \
   __asm __volatile__							      \
   __asm __volatile__							      \
     ("fptan"								      \
     ("fptan"								      \
      : "=t" (__value2), "=u" (__value) : "0" (__x));			      \
      : "=t" (__value2), "=u" (__value) : "0" (__x));			      \

+ 3 - 3
libc/sysdeps/linux/m68k/bits/atomicity.h

@@ -25,7 +25,7 @@
 
 
 
 
 static inline int
 static inline int
-__attribute__ ((unused))
+__attribute_used__
 exchange_and_add (volatile uint32_t *mem, int val)
 exchange_and_add (volatile uint32_t *mem, int val)
 {
 {
   register int result = *mem;
   register int result = *mem;
@@ -40,7 +40,7 @@ exchange_and_add (volatile uint32_t *mem, int val)
 }
 }
 
 
 static inline void
 static inline void
-__attribute__ ((unused))
+__attribute_used__
 atomic_add (volatile uint32_t *mem, int val)
 atomic_add (volatile uint32_t *mem, int val)
 {
 {
   /* XXX Use cas here as well?  */
   /* XXX Use cas here as well?  */
@@ -49,7 +49,7 @@ atomic_add (volatile uint32_t *mem, int val)
 }
 }
 
 
 static inline int
 static inline int
-__attribute__ ((unused))
+__attribute_used__
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 {
 {
   char ret;
   char ret;

+ 3 - 3
libc/sysdeps/linux/mips/bits/atomicity.h

@@ -23,7 +23,7 @@
 #include <inttypes.h>
 #include <inttypes.h>
 
 
 static inline int
 static inline int
-__attribute__ ((unused))
+__attribute_used__
 exchange_and_add (volatile uint32_t *mem, int val)
 exchange_and_add (volatile uint32_t *mem, int val)
 {
 {
   int result, tmp;
   int result, tmp;
@@ -47,7 +47,7 @@ exchange_and_add (volatile uint32_t *mem, int val)
 }
 }
 
 
 static inline void
 static inline void
-__attribute__ ((unused))
+__attribute_used__
 atomic_add (volatile uint32_t *mem, int val)
 atomic_add (volatile uint32_t *mem, int val)
 {
 {
   int result;
   int result;
@@ -69,7 +69,7 @@ atomic_add (volatile uint32_t *mem, int val)
 }
 }
 
 
 static inline int
 static inline int
-__attribute__ ((unused))
+__attribute_used__
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 {
 {
   long int ret, temp;
   long int ret, temp;

+ 5 - 5
libc/sysdeps/linux/powerpc/bits/atomicity.h

@@ -29,7 +29,7 @@
 #endif
 #endif
 
 
 static __ATOMICITY_INLINE int
 static __ATOMICITY_INLINE int
-__attribute__ ((unused))
+__attribute_used__
 exchange_and_add (volatile uint32_t *mem, int val)
 exchange_and_add (volatile uint32_t *mem, int val)
 {
 {
   int tmp, result;
   int tmp, result;
@@ -43,7 +43,7 @@ exchange_and_add (volatile uint32_t *mem, int val)
 }
 }
 
 
 static __ATOMICITY_INLINE void
 static __ATOMICITY_INLINE void
-__attribute__ ((unused))
+__attribute_used__
 atomic_add (volatile uint32_t *mem, int val)
 atomic_add (volatile uint32_t *mem, int val)
 {
 {
   int tmp;
   int tmp;
@@ -56,7 +56,7 @@ atomic_add (volatile uint32_t *mem, int val)
 }
 }
 
 
 static __ATOMICITY_INLINE int
 static __ATOMICITY_INLINE int
-__attribute__ ((unused))
+__attribute_used__
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 {
 {
   int result;
   int result;
@@ -73,7 +73,7 @@ compare_and_swap (volatile long int *p, long int oldval, long int newval)
 }
 }
 
 
 static __ATOMICITY_INLINE long int
 static __ATOMICITY_INLINE long int
-__attribute__ ((unused))
+__attribute_used__
 always_swap (volatile long int *p, long int newval)
 always_swap (volatile long int *p, long int newval)
 {
 {
   long int result;
   long int result;
@@ -86,7 +86,7 @@ always_swap (volatile long int *p, long int newval)
 }
 }
 
 
 static __ATOMICITY_INLINE int
 static __ATOMICITY_INLINE int
-__attribute__ ((unused))
+__attribute_used__
 test_and_set (volatile long int *p, long int newval)
 test_and_set (volatile long int *p, long int newval)
 {
 {
   int result;
   int result;

+ 1 - 1
libc/sysdeps/linux/sh/bits/machine-gmon.h

@@ -21,7 +21,7 @@
 #define mcount_internal __mcount_internal
 #define mcount_internal __mcount_internal
 
 
 #define _MCOUNT_DECL(frompc, selfpc) \
 #define _MCOUNT_DECL(frompc, selfpc) \
-static void __attribute__((unused)) mcount_internal (u_long frompc, u_long selfpc)
+static void __attribute_used__ mcount_internal (u_long frompc, u_long selfpc)
 
 
 /*
 /*
  * This mcount implementation expect the 'frompc' return address on
  * This mcount implementation expect the 'frompc' return address on

+ 3 - 3
libc/sysdeps/linux/sparc/bits/atomicity.h

@@ -23,7 +23,7 @@
 #include <inttypes.h>
 #include <inttypes.h>
 
 
 static int
 static int
-__attribute__ ((unused))
+__attribute_used__
 exchange_and_add (volatile uint32_t *mem, int val)
 exchange_and_add (volatile uint32_t *mem, int val)
 {
 {
   static unsigned char lock;
   static unsigned char lock;
@@ -46,7 +46,7 @@ exchange_and_add (volatile uint32_t *mem, int val)
 }
 }
 
 
 static void
 static void
-__attribute__ ((unused))
+__attribute_used__
 atomic_add (volatile uint32_t *mem, int val)
 atomic_add (volatile uint32_t *mem, int val)
 {
 {
   static unsigned char lock;
   static unsigned char lock;
@@ -67,7 +67,7 @@ atomic_add (volatile uint32_t *mem, int val)
 }
 }
 
 
 static int
 static int
-__attribute__ ((unused))
+__attribute_used__
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 compare_and_swap (volatile long int *p, long int oldval, long int newval)
 {
 {
   static unsigned char lock;
   static unsigned char lock;

+ 4 - 4
libpthread/linuxthreads_db/td_thr_tls_get_addr.c

@@ -27,10 +27,10 @@
 
 
 
 
 td_err_e
 td_err_e
-td_thr_tls_get_addr (const td_thrhandle_t *th __attribute__ ((unused)),
+td_thr_tls_get_addr (const td_thrhandle_t *th __attribute_used__,
-		     void *map_address __attribute__ ((unused)),
+		     void *map_address __attribute_used__,
-		     size_t offset __attribute__ ((unused)),
+		     size_t offset __attribute_used__,
-		     void **address __attribute__ ((unused)))
+		     void **address __attribute_used__)
 {
 {
 #if USE_TLS
 #if USE_TLS
   size_t modid;
   size_t modid;