Mailinglist Archive: opensuse-factory (381 mails)

< Previous Next >
Re: [opensuse-factory] Re: where did go?

On Sun, 14 Oct 2018, L A Walsh wrote:
On 10/14/2018 2:16 AM, Simon Lees wrote:
If it existed it would be in a static-devel package generally in
openSUSE we don't ship files for static linking, with a few exceptions
That's part of the problem -- I don't know which have exceptions
nor why.

That's not the point. The .la file is _NOT_ needed[1]. You just need the
static lib (in
/usr/lib{,32,64}/gcc/${host-triplet}/${version}/libstdc++.a, which
will be picked up by the linker when you use '-static -lstdc++'. Not
even a need for -L.

Your project searching for the .la file in /usr/lib64/ is broken.
I should neither explicitly look for the .la file nor explicitly in
/usr/lib64 (or /usr/lib64/foo/../lib64).

Sample host:

$ locate
$ locate libstdc++.a

It's been this way for many many years (at least since oS 12.1 in 2011/11).

Using .la files has been strongly discouraged even before that, and I
think it's policy now for years, though I can't find that online.
JFTR: on a 12.1:

$ ls /usr/lib64/*.la | wc -l
$ ls /usr/lib64/*.a | wc -l
$ ls /usr/lib64/*.so | wc -l
$ rpm -qf /usr/lib64/*.la | sort -u | wc -l

Different host (current):

$ ls /usr/lib64/*.la | wc -l
$ ls /usr/lib64/*.a | wc -l
$ ls /usr/lib64/*.so | wc -l
$ [analog to rpm -qf /usr/lib64/*.la | sort -u | wc -l]

And in both ISTR it's considered a bug that those .la files are there.

Oh, and:

$ cat
#include <iostream>
int main(void) {
std::cout << "Hello World!" << std::endl;
return 0;
$ g++ -Wl,-t -o t.out
-lstdc++ (/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/
$ ./t.out
Hello World!
$ g++ -c -o t.o
$ clang++ -Wl,-t -o t.out t.o
-lstdc++ (/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/
$ clang++ -Wl,-t -o t.out
-lstdc++ (/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/

Go figure!

Actually, explicitly linking against libstdc++ (or libc) is broken
anyway, unless you have very good reasons to directly use ld instead
of g++ or clang++ etc. as a linker call. And if you'd do, you'd not
need to ask.

So, as you're not even telling what "project" that is, and how the
call to the linker is and from where ...


[1] there might be some corner cases, but I know of none.

The documentation is in Japanese. Good luck.
-- Rich $alz
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-factory+owner@xxxxxxxxxxxx

< Previous Next >