I had to make this small change to libobjc/gc.c to be able to compile it. There was missing definition for BITS_PER_WORD.
Created attachment 4643 [details] The patch.
Can you post this to gcc-patches@ after reading <http://gcc.gnu.org/contribute.html> and make a changelog for it?
http://gcc.gnu.org/ml/gcc-patches/2003-08/msg01385.html
This patch is wrong. coretypes.h and tm.h are not to be referenced outside of the gcc directory -- I realize that some files in libobjc already do that, but that's not a reason to do it more. See if you can't include <limits.h> and use CHAR_BIT * sizeof(void *) or a similar construct.
Subject: Re: Patch for libobjc/gc.c that fixes compilation error of Objective-C with garbage collector enabled "zack at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes: | This patch is wrong. coretypes.h and tm.h are not to be referenced | outside of the gcc directory -- I realize that some files in libobjc | already do that, but that's not a reason to do it more. I completely agree. For that matter, something similar was proposed for V3 and I strongly disagreed with doing so. -- Gaby
I was going to clean up libobjc one of these days to remove the references to GCC's internal header files but it is going to be hard because libobjc needs to find the layout of a struct.
I am doing the cleanup.
I think there is a better patch: Index: gc.c =============================================================== ==== RCS file: /cvs/gcc/gcc/libobjc/gc.c,v retrieving revision 1.6 diff -u -p -r1.6 gc.c --- gc.c 23 May 2003 20:04:58 -0000 1.6 +++ gc.c 20 Dec 2004 21:51:20 -0000 @@ -40,18 +40,6 @@ Boston, MA 02111-1307, USA. */ typedef GC_word word; typedef GC_signed_word signed_word; -#if BITS_PER_WORD == 32 -# define LOGWL 5 -# define modWORDSZ(n) ((n) & 0x1f) /* n mod size of word */ -#endif - -#if BITS_PER_WORD == 64 -# define LOGWL 6 -# define modWORDSZ(n) ((n) & 0x3f) /* n mod size of word */ -#endif - -#define divWORDSZ(n) ((n) >> LOGWL) /* divide n by size of word */ - #include <gc_typed.h> /* The following functions set up in `mask` the corresponding pointers. Which just removes the use of BITS_PER_WORD which are not used anywhere else.
Subject: Bug 12035 CVSROOT: /cvs/gcc Module name: gcc Changes by: pinskia@gcc.gnu.org 2004-12-20 22:32:42 Modified files: libobjc : ChangeLog gc.c Log message: 2004-12-20 Andrew Pinski <pinskia@physics.uc.edu> PR libobjc/12035 * gc.c: Remove definition of LOGWL, modWORDSZ, and divWORDSZ since they are not used. Include limits.h and stdlib.h. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libobjc/ChangeLog.diff?cvsroot=gcc&r1=1.155&r2=1.156 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libobjc/gc.c.diff?cvsroot=gcc&r1=1.6&r2=1.7
Subject: Bug 12035 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: pinskia@gcc.gnu.org 2004-12-20 22:34:18 Modified files: libobjc : ChangeLog gc.c Log message: 2004-12-20 Andrew Pinski <pinskia@physics.uc.edu> PR libobjc/12035 * gc.c: Remove definition of LOGWL, modWORDSZ, and divWORDSZ since they are not used. Include limits.h and stdlib.h. Define BITS_PER_WORD. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libobjc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.106.2.6&r2=1.106.2.7 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libobjc/gc.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.6&r2=1.6.16.1
Subject: Bug 12035 CVSROOT: /cvs/gcc Module name: gcc Changes by: pinskia@gcc.gnu.org 2004-12-20 22:35:08 Modified files: libobjc : ChangeLog Log message: change the changelog entry to: 2004-12-20 Andrew Pinski <pinskia@physics.uc.edu> PR libobjc/12035 * gc.c: Remove definition of LOGWL, modWORDSZ, and divWORDSZ since they are not used. Include limits.h and stdlib.h. Define BITS_PER_WORD. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libobjc/ChangeLog.diff?cvsroot=gcc&r1=1.156&r2=1.157
Fixed with a slightly different patch that I added before.