diff options
Diffstat (limited to 'scripts/build/libc')
-rw-r--r-- | scripts/build/libc/glibc.sh | 2 | ||||
-rw-r--r-- | scripts/build/libc/musl.sh | 6 | ||||
-rw-r--r-- | scripts/build/libc/uClibc.sh | 48 |
3 files changed, 8 insertions, 48 deletions
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index 569183aa..a6306336 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -297,6 +297,8 @@ do_libc_backend_once() { # or even after they get installed... echo "ac_cv_path_BASH_SHELL=/bin/bash" >>config.cache + CT_SymlinkToolsMultilib + # Configure with --prefix the way we want it on the target... # There are a whole lot of settings here. You'll probably want # to read up on what they all mean, and customize a bit, possibly diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh index 4ccb84c0..5a53fd0a 100644 --- a/scripts/build/libc/musl.sh +++ b/scripts/build/libc/musl.sh @@ -29,7 +29,9 @@ do_libc() { } do_libc_post_cc() { - : + # MUSL creates dynamic linker symlink with absolute path - which works on the + # target but not on the host. We want our cross-ldd tool to work. + CT_MultilibFixupLDSO } do_libc_backend() { @@ -102,6 +104,8 @@ do_libc_backend_once() { extra_config+=( "--includedir=/usr/include/${hdr_install_subdir}" ) fi + CT_SymlinkToolsMultilib + # NOTE: musl handles the build/host/target a little bit differently # then one would expect: # build : not used diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh index fcabee84..9f1eb370 100644 --- a/scripts/build/libc/uClibc.sh +++ b/scripts/build/libc/uClibc.sh @@ -453,51 +453,5 @@ do_libc_post_cc() { # file in /lib. Thus, need to do this after all the variants are built. # Moreover, need to do this after the final compiler is built: on targets # that use elf2flt, the core compilers cannot find ld when running elf2flt. - CT_DoStep INFO "Checking dynamic linker symlinks" - CT_mkdir_pushd "${CT_BUILD_DIR}/build-libc-post_cc" - echo "int main(void) { return 0; }" > test-ldso.c - CT_IterateMultilibs do_libc_ldso_fixup ldso_fixup - CT_Popd - CT_EndStep -} - -do_libc_ldso_fixup() { - local multi_dir multi_os_dir multi_root multi_flags multi_index multi_count - local binary - local ldso ldso_f ldso_d multilib_dir - - for arg in "$@"; do - eval "${arg// /\\ }" - done - - CT_DoLog EXTRA "Checking dynamic linker for multilib '${multi_flags}'" - - multilib_dir="/lib/${multi_os_dir}" - CT_SanitizeVarDir multilib_dir - - CT_DoExecLog ALL "${CT_TARGET}-${CT_CC}" -o test-ldso ../test-ldso.c ${multi_flags} - if [ -r "test-ldso.gdb" ]; then - binary="test-ldso.gdb" - else - binary="test-ldso" - fi - if ${CT_TARGET}-readelf -Wl "${binary}" | grep -q 'Requesting program interpreter: '; then - ldso=$( ${CT_TARGET}-readelf -Wl "${binary}" | \ - grep 'Requesting program interpreter: ' | \ - sed -e 's,.*: ,,' -e 's,\].*,,' ) - fi - CT_DoLog DEBUG "Detected dynamic linker for multilib '${multi_flags}': '${ldso}'" - - ldso_d="${ldso%/ld*.so.*}" - ldso_f="${ldso##*/}" - # Create symlink if GCC produced an executable, dynamically linked, it was requesting - # a linker not in the current directory, and there is no such file in the expected - # ldso dir. - if [ -n "${ldso}" -a "${ldso_d}" != "${multilib_dir}" -a ! -r "${multi_root}${ldso}" ]; then - # Convert ldso_d to "how many levels we need to go up" and remove - # leading slash. - ldso_d=$( echo "${ldso_d#/}" | sed 's,[^/]\+,..,g' ) - CT_DoExecLog ALL ln -sf "${ldso_d}${multilib_dir}/${ldso_f}" \ - "${multi_root}${ldso}" - fi + CT_MultilibFixupLDSO } |