Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When moving gcc libs, prefer the same directory as libc #639

Merged
merged 10 commits into from
Mar 19, 2017

Conversation

stilor
Copy link
Contributor

@stilor stilor commented Mar 10, 2017

If libc ended up in a directory other than /lib, place GCC's libs
in that directory as well.

Signed-off-by: Alexey Neyman stilor@att.net

If libc ended up in a directory other than /lib, place GCC's libs
in that directory as well.

Signed-off-by: Alexey Neyman <stilor@att.net>
@stilor
Copy link
Contributor Author

stilor commented Mar 10, 2017

I noticed that the glibc-based toolchains where the glibc's default installation directory is not lib (e.g., aarch64-*-linux-gnu where it is lib64) fail in buildroot because, e.g., libraries end up in /lib64 and dynamic linker is installed into /lib.

Before this change, even libraries were split between both locations. I'll propose a patch to handle ld-so being in a different directory to buildroot (this seems to be the case with multilib-musl as well).

@stilor
Copy link
Contributor Author

stilor commented Mar 11, 2017

Causes a regression in powerpc64le-unknown-linux-gnu, where ld's and gcc's search paths differ: gcc wants to use /lib64 and ld searches /lib64le. As a result, libgcc_s.so (needed by libexpat.so but not specified explicitly via the -lgcc_s) is not found by linker.

binutils 2.23 and earlier are not affected, they had the correct code.

Signed-off-by: Alexey Neyman <stilor@att.net>
@stilor stilor added this to the 1.23.0 milestone Mar 12, 2017
... and in addition to final toolchain aliasing, use it when configuring
multilibs for glibc/musl. Note that uClibc does not need it, it is
explicitly selecting the tools using CROSS_PREFIX.

Signed-off-by: Alexey Neyman <stilor@att.net>
Convert absolute targets to relative so that they are valid on the host,
too. The procedure is very similar to uclibc, so it is moved into a
common function.

Signed-off-by: Alexey Neyman <stilor@att.net>
Also a fix for CT_IterateMultilibs: it didn't pass multi_os_dir_gcc, so
it only worked if the caller did *not* declare it as a local variable.

Signed-off-by: Alexey Neyman <stilor@att.net>
... as we are going through various multilibs in ld.so.conf

Signed-off-by: Alexey Neyman <stilor@att.net>
Signed-off-by: Alexey Neyman <stilor@att.net>
... and default to 'n'.

Signed-off-by: Alexey Neyman <stilor@att.net>
GCC does not distinguish the resulting binary by the CFLAGS (e.g. based
on which -march= was given). This means, while it will use the right
libraries for linking, at runtime they are all going to request the same
ld.so path and load the libraries from the same default path.

Signed-off-by: Alexey Neyman <stilor@att.net>
It turns out buildroot does not currently accept a toolchain where a dynamic
linker does not reside in the multi-os-directory. Unfortunately this is
how glibc installs itself on AArch64 without any extra tricks.

So, provide an option to force everything into /lib or /usr/lib; patch to
buildroot will be worked on separately.

Signed-off-by: Alexey Neyman <stilor@att.net>
@stilor stilor merged commit 89f0971 into crosstool-ng:master Mar 19, 2017
@stilor stilor deleted the tweak-gcc-movelibs branch March 20, 2017 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants