| Summary: | [3.4/gcc] fails with USE="objc objc-gc" | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | William <nicoleef> |
| Component: | [OLD] Core system | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | alephlg, rhill |
| Priority: | Normal | ||
| Version: | 2006.0 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
|
Description
William
2006-06-16 14:26:32 UTC
*** This bug has been marked as a duplicate of 114359 *** this looks like a different bug than #114359. have you tried gcc-3.4.6-r1 or -r2? can you post more of the error? i don't see what the actual error is, just two warnings. just to clarify, this goes away when you have dev-libs/boehm-gc installed? can you also paste the output of 'emerge -pv gcc'? i'll try to reproduce it here. okay, got it. /var/tmp/portage/gcc-3.4.6-r2/work/build/gcc/xgcc -B/var/tmp/portage/gcc-3.4.6-r2/work/build/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -isystem /usr/i686-pc-linux-gnu/sys-include -c -I. -I/var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc -O2 -O2 -march=prescott -pipe -fno-ident -W -Wall -Wwrite-strings -Wstrict-prototypes -DHAVE_GTHR_DEFAULT -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -DOBJC_WITH_GC=1 -I/var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/objc -I/var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/../gcc -I/var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/../gcc/config -I../../gcc -I/var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/../include /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c -fPIC -DPIC -o .libs/gc_gc.o /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:38:16: gc.h: No such file or directory /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:42: error: syntax error before "word" /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:42: warning: type defaults to `int' in declaration of `word' /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:42: warning: data definition has no type or storage class /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:43: error: syntax error before "signed_word" /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:43: warning: type defaults to `int' in declaration of `signed_word' /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:43: warning: data definition has no type or storage class /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:46:22: gc_typed.h: No such file or directory /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:60: error: syntax error before "mask" /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:60: warning: function declaration isn't a prototype /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:62: error: syntax error before "mask" /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:62: warning: function declaration isn't a prototype /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:66: error: syntax error before "mask" /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:67: warning: function declaration isn't a prototype /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c: In function `__objc_gc_setup_array': /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:68: error: `type' undeclared (first use in this function) /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:68: error: (Each undeclared identifier is reported only once /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:68: error: for each function it appears in.) /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:76: error: `mask' undeclared (first use in this function) /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:76: error: `offset' undeclared (first use in this function) /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c: At top level: /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:95: error: syntax error before "mask" /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:96: warning: function declaration isn't a prototype /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c: In function `__objc_gc_setup_struct': /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:101: error: `type' undeclared (first use in this function) /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:123: error: `offset' undeclared (first use in this function) /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:133: warning: implicit declaration of function `GC_set_bit' /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:133: error: `mask' undeclared (first use in this function) /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c: At top level: /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:155: error: syntax error before "mask" /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:156: warning: function declaration isn't a prototype /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c: In function `__objc_gc_setup_union': /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:163: error: `type' undeclared (first use in this function) /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:172: error: `offset' undeclared (first use in this function) /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:172: warning: type defaults to `int' in declaration of `__v' /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:175: error: `mask' undeclared (first use in this function) /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c: At top level: /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:184: error: syntax error before "mask" /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:185: warning: function declaration isn't a prototype /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c: In function `__objc_gc_type_description_from_type': /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:190: error: `type' undeclared (first use in this function) /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:218: error: `mask' undeclared (first use in this function) /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c: In function `__objc_generate_gc_type_description': /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:291: error: `GC_bitmap' undeclared (first use in this function) /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:291: error: syntax error before "mask" /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:308: error: `mask' undeclared (first use in this function) /var/tmp/portage/gcc-3.4.6-r2/work/gcc-3.4.6/libobjc/gc.c:336: warning: implicit declaration of function `GC_make_descriptor' make[2]: *** [gc_gc.lo] Error 1 make[2]: Leaving directory `/var/tmp/portage/gcc-3.4.6-r2/work/build/i686-pc-linux-gnu/libobjc' make[1]: *** [all-target-libobjc] Error 2 make[1]: Leaving directory `/var/tmp/portage/gcc-3.4.6-r2/work/build' make: *** [profiledbootstrap] Error 2 !!! ERROR: sys-devel/gcc-3.4.6-r2 failed. (In reply to comment #2) > this looks like a different bug than #114359. Not really according to output in Comment #3. Marking as duplicate again. *** This bug has been marked as a duplicate of 114359 *** aaaaaaand open again.. ;)
i think the problem is the objc-gc USE flag. even though it's not in IUSE for <=gcc-4.0, is it possible it's still getting passed through to toolchain.eclass and messing with this bit or something similar?
1158 GCC_LANG="c"
1159 is_cxx && GCC_LANG="${GCC_LANG},c++"
1160 is_gcj && GCC_LANG="${GCC_LANG},java"
1161 if is_objc || is_objcxx ; then
1162 GCC_LANG="${GCC_LANG},objc"
1163 use objc-gc && confgcc="${confgcc} --enable-objc-gc"
1164 is_objcxx && GCC_LANG="${GCC_LANG},obj-c++"
1165 fi
The --enable-objc-gc option requires that you have the garbage collector installed on the system before building GCC[1][2]. I don't know much about objc or boehm-gc, so i don't know what the proper way to go with this is. Fix the eclass of course. ;) Remove the option? DEPEND on boehm-gc? GCC 4.0 and up doesn't have this problem, but that could be due to the patches in bug #114359. Can we use those here?
Testcase:
# USE="objc" emerge -av =sys-devel/gcc-3.4.6-r2
* Configuring GCC with:
--prefix=/usr
--bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.4.6
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.6
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.6/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.6/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/include/g++-v3
--host=i686-pc-linux-gnu
--build=i686-pc-linux-gnu
--disable-altivec
--disable-nls
--with-system-zlib
--disable-checking
--disable-werror
--disable-libunwind-exceptions
--disable-multilib
--disable-libgcj
--enable-languages=c,c++,objc,f77
--enable-shared
--enable-threads=posix
--enable-__cxa_atexit
--enable-clocale=gnu
notice no --enable-objc-gc. so --disable appears to be the default for 3.4.6
# USE="objc objc-gc" emerge -av =sys-devel/gcc-3.4.6-r2
* Configuring GCC with:
--prefix=/usr
--bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.4.6
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.6
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.6/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.6/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/include/g++-v3
--host=i686-pc-linux-gnu
--build=i686-pc-linux-gnu
--disable-altivec
--disable-nls
--with-system-zlib
--disable-checking
--disable-werror
--disable-libunwind-exceptions
--disable-multilib
--disable-libgcj
--enable-objc-gc
--enable-languages=c,c++,objc,f77
--enable-shared
--enable-threads=posix
--enable-__cxa_atexit
--enable-clocale=gnu
--enable-objc-gc is added when USE="objc objc-gc" (also when USE="objc objc++ objc-gc").
# USE="objc++ objc-gc" emerge -av =sys-devel/gcc-3.4.6-r2
* Configuring GCC with:
--prefix=/usr
--bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.4.6
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.6
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.6/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.6/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/include/g++-v3
--host=i686-pc-linux-gnu
--build=i686-pc-linux-gnu
--disable-altivec
--disable-nls
--with-system-zlib
--disable-checking
--disable-werror
--disable-libunwind-exceptions
--disable-multilib
--disable-libgcj
--enable-languages=c,c++,f77
--enable-shared
--enable-threads=posix
--enable-__cxa_atexit
--enable-clocale=gnu
This one's odd because it doesn't enable --enable-objc-gc and also doesn't add obj-c++ to the languages list. Actually, it doesn't add it even when you USE="objc++" by itself. It looks like there's really no way to enable objc++ at the moment. But, that's another bug report.
So, my best guess is that objc-gc is being used by toolchain.eclass, even when it's not in IUSE, but enabled in the user's USE flags. This seems like a Bad Thing.
[1] http://gcc.gnu.org/ml/gcc-bugs/2002-02/msg00072.html
[2] http://gcc.gnu.org/onlinedocs/gcc/Garbage-Collection.html
(In reply to comment #5) > This one's odd because it doesn't enable --enable-objc-gc and also doesn't add > obj-c++ to the languages list. Actually, it doesn't add it even when you > USE="objc++" by itself. It looks like there's really no way to enable objc++ > at the moment. But, that's another bug report. Or, it might be because GCC < 4.1 doesn't support obj-c++, and the eclass is smart enough to check. Ignore this bit. :d I hadn't had time earlier because of a loooong emerge -uDN world. Do you still need the the output of 'emerge -pv gcc' or the other error messages? In any other of your questions about gcc, boehm-gc and objc I unfortunately can't really help you because I don't nearly nothing about it. I'm sorry. ;-) i looked at this again and i'm pretty sure the problem is leaky USE flags. gcc versions under 4.0 get objc in IUSE, 4.1 gets objc and objc-gc. but the test that sets up the configure options for objc* doesn't take that into account. because of this, users emerging eg. GCC-3.4.6 with objc and objc-gc in their USE flags will see this:
[ebuild R ] sys-devel/gcc-3.4.6-r2 USE="nopie nossp objc (-altivec) -bootstrap -boundschecking -build -doc -fortran -gcj -gtk (-hardened) -ip28 -ip32r10k (-multilib) -multislot (-n32) (-n64) -nls -nocxx -test -vanilla" 0 kB
but the eclass will still pass --enable-objc-gc to configure. i think anyone would agree that USE flags that are not in IUSE and affect the build are evil. ;)
there's two solutions i can think of - put a conditional around `use objc-gc`
--- toolchain.eclass-orig 2006-10-21 21:39:26.000000000 -0600
+++ toolchain.eclass-mod 2006-10-21 21:39:42.000000000 -0600
@@ -1171,7 +1171,9 @@
is_gcj && GCC_LANG="${GCC_LANG},java"
if is_objc || is_objcxx ; then
GCC_LANG="${GCC_LANG},objc"
- use objc-gc && confgcc="${confgcc} --enable-objc-gc"
+ if tc_version_is_at_least "4.0" ; then
+ use objc-gc && confgcc="${confgcc} --enable-objc-gc"
+ fi
is_objcxx && GCC_LANG="${GCC_LANG},obj-c++"
fi
or add the objc-gc flag to IUSE in gcc-3* and DEPEND on dev-libs/boehm-gc.[1] i've tested both out and either works.
[1] http://gcc.gnu.org/onlinedocs/gcc/Garbage-Collection.html
*** Bug 169043 has been marked as a duplicate of this bug. *** I went with filtering out the flag for <gcc-4.0 since that means we aren't "supporting" any "new" features for it. |