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
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

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
Comment by Urs Wolfer (uwolfer) - Monday, 25 May 2009, 17:52 GMT
Confirmed.
Comment by Allan McRae (Allan) - Monday, 25 May 2009, 17:57 GMT
I just ran into this issue too...

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.
Comment by Geir Erikstad (baldr) - Monday, 25 May 2009, 21:46 GMT
I got the same issue with gcc-4.4.0-2, when I compiled my own code.

Downgraded to gcc-4.4.0-1, and now it's working.
Comment by Hussam Al-Tayeb (hussam) - Monday, 25 May 2009, 21:54 GMT
Why are we using a post 4.4.0 snapshot anyway?
Comment by Allan McRae (Allan) - Tuesday, 26 May 2009, 01:21 GMT
> Why are we using a post 4.4.0 snapshot anyway?
Because it actually fixes several compiling issues...
Comment by Allan McRae (Allan) - Tuesday, 26 May 2009, 07:09 GMT
Just noting that rebuilding the 4.4-20090505 snapshot does not fix the problem but building the 4.4.0 release does... So a "bug fix" created this... I will look into more recent snapshots.
Comment by MonkeeSage (MonkeeSage) - Wednesday, 27 May 2009, 03:13 GMT
I pulled the gcc PKGBUILD + files from svn (per http://www.archlinux.org/svn/), added '--with-arch=i686' to the end of the configure line, rebuilt and installed, and it works properly now (i.e., I'm no longer required to build packages with '-march=i686'). I'm guessing that the PKGBUILD should call configure with something like '--with-arch=$CARCH'
Comment by Allan McRae (Allan) - Wednesday, 27 May 2009, 03:20 GMT
My testing shows that the bug was fixed on the gcc-4.4 branch somewhere between 20090505 (snapshot we are using) and 20090519. No additional configure option is needed. I will push a fixed version to the repos soon.
Comment by MonkeeSage (MonkeeSage) - Wednesday, 27 May 2009, 03:35 GMT
Ah, thanks.

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?
Comment by Allan McRae (Allan) - Wednesday, 27 May 2009, 03:49 GMT
If the de_DE locale is not available, a bug appears in the translations.
Comment by MonkeeSage (MonkeeSage) - Wednesday, 27 May 2009, 05:35 GMT
Thanks. I thought something like that might be why, but was curious. (Sorry for the noise.)
Comment by Jan de Groot (JGC) - Thursday, 28 May 2009, 11:59 GMT
The de_DE locale is needed because configure checks for bugs in glibc using this locale. If that check fails because de_DE isn't present, gcc assumes glibc has buggy locale support and uses a different, non-standard way of locale support.
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.

Loading...