From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16175 invoked by alias); 27 Jun 2005 13:41:43 -0000 Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org Received: (qmail 15696 invoked by uid 22791); 27 Jun 2005 13:41:32 -0000 Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 27 Jun 2005 13:41:32 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1Dmtr5-0004qA-00; Mon, 27 Jun 2005 15:40:55 +0200 Date: Mon, 27 Jun 2005 13:41:00 -0000 To: Andrew Lunn Cc: "oliver munz @ s p e a g" , ecos-devel@sources.redhat.com Subject: Re: why use the SA1110-USB-driver a static /dev/usbs... definition ??? Message-ID: <20050627134055.GG11071@lunn.ch> References: <007a01c57b16$39a30890$5e188481@cadpad> <20050627130201.GD11071@lunn.ch> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="liOOAslEiF7prFVr" Content-Disposition: inline In-Reply-To: <20050627130201.GD11071@lunn.ch> User-Agent: Mutt/1.5.9i From: Andrew Lunn X-SW-Source: 2005-06/txt/msg00011.txt.bz2 --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 349 > What version of gcc are you using? Something newish? My guess would be something like 3.4 or higher. http://www.gnu.org/software/gcc/gcc-3.4/changes.html I says that "Unreferenced static variables and functions are removed" This fits your problem description. Please could you try the attached patch. Thanks Andrew --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="used.diff" Content-length: 4012 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 --liOOAslEiF7prFVr--