Skip to content
Snippets Groups Projects
Commit fa4035cb authored by Alessandro Di Federico's avatar Alessandro Di Federico
Browse files

Old glibc LDFLAGS: pass sysroot only to the linker

In order to link against an old version of the glibc, we have to pass a
set of flags, some at compile time (CFLAGS), some at link-time
(LDFLAGS).

At compile-time, we set the sysroot to root/link-only, in order to have
the compiler look there first for header.
At link-time, we manually specify `-Lroot/link-only/lib` and reset
sysroot to /.
However, this often creates issues at configure-time, since in this
situation CFLAGS and LDFLAGS are often use at the same time, leading to
usage of / as sysroot.

This commit fixes the problem by ensuring that the `--sysroot` flag in
LDFLAGS will be available only to the link, by simply adding `-Wl,`.
parent c4d70318
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ modern_linker_flags: (@= modern_linker_flags @)
regular_linker_flags: -stdlib=libc++ (@= modern_linker_flags @)
sanitizers_libs_path: lib64/clang/(@= clang_release_version @)/lib/linux
use_old_glibc_cflags: --sysroot $INSTALL_LINK_ONLY_PATH -idirafter /usr/local/include -idirafter /usr/include/x86_64-linux-gnu -idirafter /usr/include
use_old_glibc_ldflags: -L$INSTALL_LINK_ONLY_PATH/lib -lrt --sysroot=/
use_old_glibc_ldflags: -L$INSTALL_LINK_ONLY_PATH/lib -L$ORCHESTRA_ROOT/lib -lrt -Wl,--sysroot=/
parallelism: $(nproc)
build_from_source:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment