https://bugs.gentoo.org/572038 https://git.savannah.gnu.org/cgit/libtool.git/commit/?id=3221f9f0fb98d5740ab5d0e8db6a731302520644 https://git.savannah.gnu.org/cgit/libtool.git/commit/?id=b8cad780da77b7cf3aae1b660be3298b7fc48d1e https://lists.gnu.org/archive/html/libtool/2024-05/msg00018.html --- ltmain.sh +++ ltmain.sh @@ -5768,7 +5768,7 @@ test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" + add_dir="-L${SYSROOT}$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in @@ -5785,7 +5785,7 @@ fi else # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" + add_dir="-L${SYSROOT}/$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in