From b3e4014adc7bbd68ab2c7d99d535f93e90f41665 Mon Sep 17 00:00:00 2001 From: q66 Date: Wed, 23 Dec 2020 23:31:32 +0100 Subject: [PATCH] cross-arm-linux-gnueabihf: clean up libdir handling --- srcpkgs/cross-arm-linux-gnueabihf/template | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template index 64f85b7b9f6..4e46ba1e306 100644 --- a/srcpkgs/cross-arm-linux-gnueabihf/template +++ b/srcpkgs/cross-arm-linux-gnueabihf/template @@ -195,6 +195,8 @@ _glibc_build() { [ ! -d glibc-build ] && mkdir glibc-build cd glibc-build + echo "slibdir=/usr/lib32" > configparms + echo "libc_cv_forced_unwind=yes" > config.cache echo "libc_cv_c_cleanup=yes" >> config.cache @@ -203,6 +205,7 @@ _glibc_build() { export CFLAGS="-Os -pipe ${_archflags}" _args="--prefix=/usr" + _args+=" --libdir=/usr/lib32" _args+=" --host=${_triplet}" _args+=" --with-headers=${_sysroot}/usr/include" _args+=" --config-cache" @@ -238,7 +241,9 @@ _gcc_build() { # Make this link to target libs. if [ ! -f .sed_subst_done ]; then sed -e "s, /lib/, ${_sysroot}/lib/,g;s, /usr/lib/, ${_sysroot}/usr/lib/,g" \ - -i ${_sysroot}/lib/libc.so ${_sysroot}/lib/libpthread.so + -i ${_sysroot}/lib/libc.so + sed -e "s, /lib32/, ${_sysroot}/lib32/,g;s, /usr/lib32/, ${_sysroot}/usr/lib32/,g" \ + -i ${_sysroot}/lib/libc.so touch .sed_subst_done fi _args="--prefix=/usr" @@ -282,7 +287,7 @@ _gcc_build() { } do_build() { - for f in include lib bin; do + for f in include lib libexec bin sbin; do if [ ! -d ${_sysroot}/usr/${f} ]; then mkdir -p ${_sysroot}/usr/${f} fi @@ -290,6 +295,9 @@ do_build() { ln -sfr ${_sysroot}/usr/${f} ${_sysroot}/${f} fi done + ln -sf lib ${_sysroot}/usr/lib32 + ln -sf usr/lib ${_sysroot}/lib32 + # Ensure we use sane environment unset CC CXX CPP LD AS AR RANLIB OBJDUMP READELF NM unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS @@ -304,7 +312,7 @@ do_build() { } do_install() { - for f in include lib bin; do + for f in include lib libexec bin sbin; do if [ ! -d ${DESTDIR}/${_sysroot}/usr/${f} ]; then mkdir -p ${DESTDIR}/${_sysroot}/usr/${f} fi @@ -313,6 +321,9 @@ do_install() { ${DESTDIR}/${_sysroot}/${f} fi done + ln -sf lib ${DESTDIR}/${_sysroot}/usr/lib32 + ln -sf usr/lib ${DESTDIR}/${_sysroot}/lib32 + # install cross binutils cd ${wrksrc}/binutils-build make DESTDIR=${DESTDIR} install