Bug 51883 - static linking of C/C++ & glibc fails with looping error message
static linking of C/C++ & glibc fails with looping error message
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
Depends On:
  Show dependency treegraph
Reported: 2001-08-16 10:43 EDT by greg hosler
Modified: 2016-11-24 10:25 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-08-17 12:56:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
output of make (12.78 KB, text/plain)
2001-08-16 19:24 EDT, greg hosler
no flags Details

  None (edit)
Description greg hosler 2001-08-16 10:43:43 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.78 [en] (X11; U; Linux 2.4.6-3.1smp i686; Nav)

Description of problem:
I have a relatively large C/C++/X/Motif application. linking it
dynamically works fine. linking it statically yields the following
ld failure message:

/usr/bin/ld: /lib/ld-linux.so.2: indirect symbol `__libc_internal_tsd_set'
to `__libc_internal_tsd_set@@GLIBC_2.0' is a loop
/lib/ld-linux.so.2: could not read symbols: Invalid operation
collect2: ld returned 1 exit status

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

How reproducible:

Steps to Reproduce:
1. have not tried w/ smaller test cases. If necessary I will try
to generate one.

Actual Results:  failed link

Expected Results:  successful link (or at least a list of missing symbols,
a common situation with static links)

Additional info:
Comment 1 Glen Foster 2001-08-16 14:59:26 EDT
This defect is considered SHOULD-FIX for Fairfax.
Comment 2 Jakub Jelinek 2001-08-16 15:57:37 EDT
This probably means you're passing explicit shared library filename
in the link command.
Can you please check if that's true?
By explicit shared library filename I mean something like
/usr/lib/libfoo.so, ie. not -lfoo (the latter would just moan
that it could not find the library if only .so existed and not .a).
Comment 3 greg hosler 2001-08-16 19:24:04 EDT
no explicit libraries referenced. The attached file has the link line, and the
output error message.
Comment 4 greg hosler 2001-08-16 19:24:51 EDT
Created attachment 28215 [details]
output of make
Comment 5 Jakub Jelinek 2001-08-17 12:56:19 EDT
Yeah, but you have -lComboBox -lXmt before -Wl,-Bstatic, which means
that those libs (if they are shared) will be linked in shared, while the rest
will be linked in statically.
I don't know what all you'd like to link in statically, if all X libs too or not,
in any case it would be good to add -Wl,-Bdynamic at the end of the command line.
Comment 6 greg hosler 2001-08-18 07:24:16 EDT
adding -Wl,-Bdynamic at the end of the command line resolves the static link

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