Index: hal/common/current/ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/hal/common/current/ChangeLog,v retrieving revision 1.109 diff -u -r1.109 ChangeLog --- hal/common/current/ChangeLog 7 Jun 2005 18:31:35 -0000 1.109 +++ hal/common/current/ChangeLog 27 Jun 2005 13:40:04 -0000 @@ -1,3 +1,10 @@ +2005-06-27 Andrew Lunn + + * include/hal_tables.h (CYG_HAL_TABLE_{QUALIFIED_}ENTRY): added + CYGBLD_ATTRIB_USED so that gcc 3.4.4 does not discard entries + which are not refereced explicitly. Problem reported by + Oliver Munz. + 2005-05-19 Peter Korsgaard * doc/porting.sgml: Changed dead sourceware.cygnus.com links to Index: hal/common/current/include/hal_tables.h =================================================================== RCS file: /cvs/ecos/ecos/packages/hal/common/current/include/hal_tables.h,v retrieving revision 1.7 diff -u -r1.7 hal_tables.h --- hal/common/current/include/hal_tables.h 23 May 2002 23:02:47 -0000 1.7 +++ hal/common/current/include/hal_tables.h 27 Jun 2005 13:40:04 -0000 @@ -101,13 +101,15 @@ #ifndef CYG_HAL_TABLE_ENTRY #define CYG_HAL_TABLE_ENTRY( _name ) \ - CYGBLD_ATTRIB_SECTION(".ecos.table." __xstring(_name) ".data") + CYGBLD_ATTRIB_SECTION(".ecos.table." __xstring(_name) ".data") \ + CYGBLD_ATTRIB_USED #endif #ifndef CYG_HAL_TABLE_QUALIFIED_ENTRY #define CYG_HAL_TABLE_QUALIFIED_ENTRY( _name, _qual ) \ CYGBLD_ATTRIB_SECTION(".ecos.table." __xstring(_name) ".data." \ - __xstring(_qual)) + __xstring(_qual)) \ + CYGBLD_ATTRIB_USED #endif /*------------------------------------------------------------------------*/ Index: infra/current/ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/infra/current/ChangeLog,v retrieving revision 1.49 diff -u -r1.49 ChangeLog --- infra/current/ChangeLog 27 Mar 2005 18:14:58 -0000 1.49 +++ infra/current/ChangeLog 27 Jun 2005 13:40:05 -0000 @@ -1,3 +1,9 @@ +2005-06-27 Andrew Lunn + + * include/cyg_type.h: Added CYGBLD_ATTRIB_USED so that we can + indicate to gcc 3.4.4 or above not to throw away a variable or + function even when it appears to be not references. + 2005-03-27 Andrew Lunn * include/diag.h: Added CYGBLD_ATTRIB_PRINTF_FORMAT where Index: infra/current/include/cyg_type.h =================================================================== RCS file: /cvs/ecos/ecos/packages/infra/current/include/cyg_type.h,v retrieving revision 1.22 diff -u -r1.22 cyg_type.h --- infra/current/include/cyg_type.h 27 Mar 2005 18:14:59 -0000 1.22 +++ infra/current/include/cyg_type.h 27 Jun 2005 13:40:05 -0000 @@ -313,6 +313,15 @@ // COMPILER-SPECIFIC STUFF #ifdef __GNUC__ +#if defined(__GNU_PATCHLEVEL__) +# define __GNUC_VERSION__ (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) +#else +# define __GNUC_VERSION__ (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100) +#endif + // Force a 'C' routine to be called like a 'C++' contructor # if !defined(CYGBLD_ATTRIB_CONSTRUCTOR) # define CYGBLD_ATTRIB_CONSTRUCTOR __attribute__((constructor)) @@ -383,6 +392,16 @@ # define CYGBLD_ATTRIB_STRFTIME_FORMAT(__format__, __args__) \ __attribute__((format (strftime, __format__, __args__))) +// Tell the compiler not to throw away a variable or function. Only +// available on 3.3.4 or above. Old version's didn't throw them away, +// but using the unused attribute should stop warnings. +# if !defined(CYGBLD_ATTRIB_USED) +# if __GNUC_VERSION__ >= 30404 +# define CYGBLD_ATTRIB_USED __attribute__((used)) +# else +# define CYGBLD_ATTRIB_USED __attribute__((unused)) +# endif +# endif #else // non-GNU # define CYGBLD_ATTRIB_CONSTRUCTOR