FS#14825 - unresolved symbols with gcc-4.4.0-2
Attached to Project:
Arch Linux
Opened by Roman Himmes (Kretikus) - Monday, 25 May 2009, 14:12 GMT
Last edited by Allan McRae (Allan) - Sunday, 31 May 2009, 06:09 GMT
Opened by Roman Himmes (Kretikus) - Monday, 25 May 2009, 14:12 GMT
Last edited by Allan McRae (Allan) - Sunday, 31 May 2009, 06:09 GMT
|
Details
Description:
After updating from gcc-4.3.x to 4.4.0. While compiling an own project gcc prints out: /home/zz/dev/cryptotec/libs/debug/libzzz_gui_lib.a(zzz_init.o): In function `__gnu_cxx::__exchange_and_add(int volatile*, int)': /usr/lib/gcc/i686-pc-linux-gnu/4.4.0/../../../../include/c++/4.4.0/ext/atomicity.h:46: undefined reference to `__sync_fetch_and_add_4' /home/zz/dev/cryptotec/libs/debug/libzzz_gui_lib.a(zzzmainwindow.o): In function `__gnu_cxx::__exchange_and_add(int volatile*, int)': /usr/lib/gcc/i686-pc-linux-gnu/4.4.0/../../../../include/c++/4.4.0/ext/atomicity.h:46: undefined reference to `__sync_fetch_and_add_4' /home/zz/dev/cryptotec/libs/debug/libzzz_gui_lib.a(zzzmainwindow.o): In function `cryptotec::zzz::gui::ZZZMainWindow::checkUpdate(bool)': Found http://archives.devshed.com/forums/development-94/new-undefined-reference-to-sync-fetch-and-add-4t-1971252.html with a description: "Then, it looks like _GLIBCXX_ATMIC_BUILTINS is defined for that installation of GCC. In turn, this is not supposed to happen for ?86, *any* ?. Either something is wrong in the installation (something was forced overriding the configure choices) or there are glitches in the recent changes" |
This task depends upon
Closed by Allan McRae (Allan)
Sunday, 31 May 2009, 06:09 GMT
Reason for closing: Fixed
Additional comments about closing: gcc-4.4.0-3
Sunday, 31 May 2009, 06:09 GMT
Reason for closing: Fixed
Additional comments about closing: gcc-4.4.0-3
The short term solution is to use "g++ -march=i686" to compile your code. In fact anything above i486 is enough...
I just rebuilt gcc with a patch from Fedora that I thought would fix this issue but that did not work. According to some searching, it may be fix in more recent snapshots from the gcc-4.4 branch. There is a snapshot due to be release today which I will test out soon.
Downgraded to gcc-4.4.0-1, and now it's working.
Because it actually fixes several compiling issues...
BTW, I didn't need de_DE installed, I commented that section and build went fine. Why would you need a particular locale installed in order to build?
As for the --with-arch=$CARCH option, I think that makes the default compile flag "-march=$CARCH" when specifying no architecture in CFLAGS. This is unwanted behaviour.