how to link with old versions of glibc?
Carlos O'Donell
carlos@redhat.com
Thu May 21 15:30:48 GMT 2020
On 5/21/20 3:01 AM, Szabolcs Nagy wrote:
> note that for crt*.o -L is not enough, i think you
> need -B for that.
Using the built crt*.o is *immensely* complicated.
It depends on *what* you are building.
It depends on *how* the compiler behaves.
It *varies* by multilib.
... and you must use ld correctly, IMO, to get the
control required to avoid the compiler driver from
selecting system paths.
I cover the issue here with concrete examples:
https://sourceware.org/glibc/wiki/Testing/Builds#Building_with_completely_new_files
I agree it could, at a toolchain level, do with some
simplification, but the use case is incredibly esoteric.
Most, 99.999% of users, don't need such a feature.
> for runtime lib paths i would prefer if there was
> a way to only set the --dynamic-linker and then
> ld.so could look at a config file with the paths
> at a path relative to itself. (so instead of rpath
> the libc paths would be in a file like
> $LDSO_ORIGIN/../etc/ld.so.conf)
Agreed, but that's a lot of work for a small use case.
If you have *enough* of the toolchain installed you can
use --sysroot, but the problem is that if you only build
glibc and install glibc, it's not enough of the toolchain
for the resulting sysroot to work for linking against.
We are way off topic though... nerding out over how to
native cross build is a sore spot in all of the tools
today :-)
--
Cheers,
Carlos.
More information about the Libc-help
mailing list