[Bug 674696] New: gcc resolves -lX to libX.so
https://bugzilla.novell.com/show_bug.cgi?id=674696
https://bugzilla.novell.com/show_bug.cgi?id=674696#c0
Summary: gcc resolves -lX to libX.so
Classification: openSUSE
Product: openSUSE 11.3
Version: Final
Platform: x86-64
OS/Version: openSUSE 11.3
Status: NEW
Severity: Minor
Priority: P5 - None
Component: Development
AssignedTo: pth@novell.com
ReportedBy: giecrilj@stegny.2a.pl
QAContact: qa@suse.de
Found By: ---
Blocker: ---
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; pl-PL; rv:1.9.2.13)
Gecko/20101203 SUSE/3.6.13-0.2.1 Firefox/3.6.13
The documentation for GCC Linker Options [1] states that -lX == find libX.a
along the search path. GCC at openSuSE does not comply, providing an
undocumented extension.
Reproducible: Always
Steps to Reproduce:
{ rm -f liblib-search-bug.a &&
echo 'int openSuSE_gcc_bug_lib_search;' > lib-search-bug.c &&
gcc -shared lib-search-bug.c -o liblib-search-bug.so &&
gcc -L. lib-search-bug.c -llib-search-bug
}
Actual Results:
ld: undefined reference to `main'
Expected Results:
ld: cannot find -llib-search-bug
[1]
https://bugzilla.novell.com/show_bug.cgi?id=674696
https://bugzilla.novell.com/show_bug.cgi?id=674696#c
Christopher Yeleighton
https://bugzilla.novell.com/show_bug.cgi?id=674696
https://bugzilla.novell.com/show_bug.cgi?id=674696#c1
--- Comment #1 from Christopher Yeleighton
-- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=674696
https://bugzilla.novell.com/show_bug.cgi?id=674696#c2
Philipp Thomas
https://bugzilla.novell.com/show_bug.cgi?id=674696
https://bugzilla.novell.com/show_bug.cgi?id=674696#c3
Christopher Yeleighton
https://bugzilla.novell.com/show_bug.cgi?id=674696
https://bugzilla.novell.com/show_bug.cgi?id=674696#c4
Richard Guenther
./a.out /a.out: error while loading shared libraries: libt2.so: cannot open shared object file: No such file or directory
because . is not in LD_LIBRARY_PATH. You can circumvent this security measure by adding -Wl,-rpath=. This is not a bug in GCC. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=674696
https://bugzilla.novell.com/show_bug.cgi?id=674696#c5
Christopher Yeleighton
https://bugzilla.novell.com/show_bug.cgi?id=674696
https://bugzilla.novell.com/show_bug.cgi?id=674696#c6
Karl Eichwalder
https://bugzilla.novell.com/show_bug.cgi?id=674696
https://bugzilla.novell.com/show_bug.cgi?id=674696#c7
Christopher Yeleighton
According to the devel guys it is not a bug.
The docs team does not provide SDK-like documentation.
Consult
Please, consider to add an article about gcc and linking options to the wiki (http://en.opensuse.org).
Very gladly, but that will not make up for the deficiency in the documentation installed off line. Additionally, were I expert enough do that, I would have no need to look at the info pages. I am sorry for the reopening ping-pong, but it seems your invalidation was based on an invalid assumption :-( -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=674696
https://bugzilla.novell.com/show_bug.cgi?id=674696#c8
Karl Eichwalder
https://bugzilla.novell.com/show_bug.cgi?id=674696
https://bugzilla.novell.com/show_bug.cgi?id=674696#c9
--- Comment #9 from Christopher Yeleighton
https://bugzilla.novell.com/show_bug.cgi?id=674696
https://bugzilla.novell.com/show_bug.cgi?id=674696#c10
Richard Guenther
https://bugzilla.novell.com/show_bug.cgi?id=674696
https://bugzilla.novell.com/show_bug.cgi?id=674696#c11
Christopher Yeleighton
Or are you refering to the documentation not mentioning _shared_ libraries (thus, the .so suffix compared to the .a suffix)? The documentation
Your perspicacity is stupendous :-) In other words, I am.
is probably unchanged from the distant past where there wasn't any ELF port. On darwin, for example, .dylib, on migw64, for example, .lib suffixes are used (and possibly different or no prefixes may apply).
-- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=674696
https://bugzilla.novell.com/show_bug.cgi?id=674696#c12
Richard Guenther
participants (1)
-
bugzilla_noreply@novell.com