This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 726495 - glibc fails to build on ARM due to linking issues caused by -static-libgcc
glibc fails to build on ARM due to linking issues caused by -static-libgcc
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
rawhide
arm7 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Jeff Law
Fedora Extras Quality Assurance
:
Depends On:
Blocks: ARMTracker
  Show dependency treegraph
 
Reported: 2011-07-28 15:50 EDT by Niels de Vos
Modified: 2012-02-02 07:03 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-02-02 07:03:06 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Niels de Vos 2011-07-28 15:50:13 EDT
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 04:50:51 EDT
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 17:13:11 EDT
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 14:14:33 EST
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-14 23:46:38 EST
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 07:03:06 EST
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.