Bug 726495 - glibc fails to build on ARM due to linking issues caused by -static-libgcc
Summary: glibc fails to build on ARM due to linking issues caused by -static-libgcc
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: arm7
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jeff Law
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: ARMTracker
TreeView+ depends on / blocked
 
Reported: 2011-07-28 19:50 UTC by Niels de Vos
Modified: 2016-11-24 15:54 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-02 12:03:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
ugly hack for adding "-W,l:.../libc.a" when -static-libc is used (508 bytes, patch)
2011-08-13 21:13 UTC, Niels de Vos
no flags Details | Diff

Description Niels de Vos 2011-07-28 19:50:13 UTC
Description of problem:
Building the current rawhide (or any previous) glibc.src.rpm on ARM, fails. The linker can not find __stack_chk_guard (full error below).

Version-Release number of selected component (if applicable):
glibc-2.14.90-4

How reproducible:
100%

Steps to Reproduce:
1. fedpkg clone glibc
2. cd glibc
3. arm-koji build --scratch dist-f14 $(fedpkg giturl)
   (dist-f14 is currently the latest buildroot available)

Actual results:
A (temporary) scratch build can be found here:
- http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=137888

sotruss-lib.c:293:3: warning: #warning "pltenter for architecture not supported"
sotruss-lib.c:332:3: warning: #warning "pltexit for architecture not supported"
sotruss-lib.c:244:1: warning: 'print_enter' defined but not used
sotruss-lib.c:298:1: warning: 'print_exit' defined but not used
/usr/lib/gcc/armv5tel-redhat-linux-gnueabi/4.5.1/libgcc_eh.a(unwind-arm.o): In function `__gnu_Unwind_Backtrace':
(.text+0xf28): undefined reference to `__stack_chk_guard'
collect2: ld returned 1 exit status
make[2]: *** [/builddir/build/BUILD/glibc-2.14-121-g5551a7b/build-armv5tel-redhat-linuxeabi/elf/sotruss-lib.so] Error 1
make[2]: Leaving directory `/builddir/build/BUILD/glibc-2.14-121-g5551a7b/elf'
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory `/builddir/build/BUILD/glibc-2.14-121-g5551a7b'
make: *** [all] Error 2


Expected results:
Build succeeds.

Additional info:
sotruss-lib.so is the first .so that is linked, previous versions from glibc failed with similar errors, but on LibBrokenLocale.so.

Removing the -static-libgcc option from ./configure makes glibc compile successfully. The current Fedora ARM package is built with a patched .spec like:

sed -i 's/libc_cv_gcc_static_libgcc=-static-libgcc/libc_cv_gcc_static_libgcc=/' ./configure

This may well be a gcc issue, as -static-libgcc does not seem to work. Feel free to change the component accordingly.

Comment 1 Andrew Haley 2011-08-01 08:50:51 UTC
I suspect this is just another manifestation of the bug, now fixed, that causes gcj programs not to link,  I certainly had no such problem when I built libc yesterday.

Comment 2 Niels de Vos 2011-08-13 21:13:11 UTC
Created attachment 518160 [details]
ugly hack for adding "-W,l:.../libc.a" when -static-libc is used

Andrew mentioned in http://lists.fedoraproject.org/pipermail/arm/2011-August/001755.html that __stack_chk_guard should be defined in libc.a. This seems to be the case, but while building any .so, libc.a is not found automatically.

The attached patch adds libc.a to the linker search path when the -static-libgcc option is used (by sed'ing ./configure). This is surely not the right way, but I have not yet figured out how libc.a should be found otherwise.

Comment 3 Fedora Admin XMLRPC Client 2011-11-14 19:14:33 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Fedora Admin XMLRPC Client 2011-11-15 04:46:38 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Niels de Vos 2012-02-02 12:03:06 UTC
It seems that glibc-2.14.1-2 was built successfully:
- http://arm.koji.fedoraproject.org/koji/buildinfo?buildID=35478

Same for glibc-2.15-4.fc17:
- http://arm.koji.fedoraproject.org/koji/buildinfo?buildID=48517

Closing this, please file a new bug in case the problem occurs with a newer Fedora release.


Note You need to log in before you can comment on or make changes to this bug.