Bug 4021 - uClibc: undefined reference to `__GI___errno_location'
Summary: uClibc: undefined reference to `__GI___errno_location'
Status: NEW
Alias: None
Product: uClibc
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords: link-failure
Depends on:
Blocks:
 
Reported: 2011-07-28 08:37 UTC by Oleg
Modified: 2015-12-02 19:38 UTC (History)
2 users (show)

See Also:
Host: sparc
Target:
Build: x86


Attachments
.config (19.07 KB, application/x-config)
2011-07-28 08:37 UTC, Oleg
Details
get rid of errno_location error (338 bytes, patch)
2011-11-16 12:11 UTC, ke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg 2011-07-28 08:37:32 UTC
Created attachment 3517 [details]
.config

Buildroot version 2011.05:

  AR cr lib/libc.a
  STRIP -x -R .note -R .comment lib/libc.a
  AR cr lib/uclibc_nonshared.a
  STRIP -x -R .note -R .comment lib/uclibc_nonshared.a
  AR cr libc/libc_so.a
  STRIP -x -R .note -R .comment libc/libc_so.a
  LD libuClibc-0.9.31.1.so
libc/libc_so.a(fork.os): In function `__GI_fork':
(.text+0x14): undefined reference to `__GI___errno_location'
collect2: ld returned 1 exit status
Comment 1 Oleg 2011-07-28 11:08:20 UTC
Version 2011.02 build properly
Comment 2 Peter Korsgaard 2011-07-28 18:26:30 UTC
(In reply to comment #1)
> Version 2011.02 build properly

And latest git? I'm almost ready to release 2011.08-rc1.
Comment 3 Oleg 2011-07-28 20:36:53 UTC
(In reply to comment #2)
> And latest git? I'm almost ready to release 2011.08-rc1.

Daily snapshot doesn't compile too
Comment 4 Kevin Robbins 2011-11-07 23:53:13 UTC
I can confirm that this bug remains in both current head and 2011.08. I, too, am building for a LEON3 SPARC v8 processor with a hardware FPU. uLibc fails in just the same way for versions 0.9.31, 0.9.32, and today's daily snapshot.
Comment 5 ke 2011-11-16 12:11:59 UTC
Created attachment 3752 [details]
get rid of errno_location error

Unhide __errno_location to avoid undefined symbol errror
Comment 6 Peter Korsgaard 2011-11-17 05:57:54 UTC
Fixed by Gustavos in git (8c38a0a44), thanks
Comment 7 Mike Frysinger 2011-11-20 08:02:11 UTC
uClibc master branch is still using HIDDEN_JUMPTARGET (like it should be).  the proposed patch is wrong imo and really shouldn't be in buildroot, but i'll let the BR guys worry about that.

why is your libc/misc/internals/__errno_location.c not being compiled with this symbol ?  it should look like:
$ readelf -sW libc/misc/internals/__errno_location.os  | grep FUNC
     8: 0000000000000000     8 FUNC    WEAK   HIDDEN     1 __GI___errno_location
    11: 0000000000000000     8 FUNC    WEAK   DEFAULT    1 __errno_location
Comment 8 Bernhard Reutner-Fischer 2014-07-24 19:04:58 UTC
hidden weak handling is unfortunately pretty broken in recent gcc. Since (IIRC) c++ and/or TLS handling elsewhere started to rely on this broken behaviour chances are low that it will be fixed (as in behaviour of previous gcc reinstated). An alternative was applied as 00f425b39b9258a78df47cebdd0d2c779753392f and the earlier acfc107a50344b100b9ea492678928acc047c6ae
Comment 9 mail 2014-07-26 08:51:42 UTC
Hi,

tried with current master and the problem still exist.
Can you share your working environment data? (build system, gcc version, binutils version)
Removing HIDDEN_JUMPTARGET still make it work.

best regards
 Waldemar