[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libtool is adding "-L/usr/lib" even for cross-compilation with sysroot

From: Xi Ruoyao
Subject: libtool is adding "-L/usr/lib" even for cross-compilation with sysroot
Date: Mon, 14 Feb 2022 10:55:32 +0800
User-agent: Evolution 3.42.4

Hi libtool dev,

We've recently hit an issue cross-compiling some package using libtool
for sysroot.  Saying contains


Then libtool will add "-L/usr/lib" to the linker command line during a
"relink" against, because

>           else
>             # We cannot seem to hardcode it, guess we'll fake it.
>             add_dir=-L$libdir
>             # Try looking first in the location we're being installed to.
>             if test -n "$inst_prefix_dir"; then
>               case $libdir in
>                 [\\/]*)
>                   func_append add_dir " -L$inst_prefix_dir$libdir"
>                   ;;
>               esac
>             fi
>             add=-l$name
>           fi

Now the linker will try to use the system library in /usr/lib, causing
link error or runtime issue.

There is a patch at
changing -L$libdir to -L$lt_sysroot$libdir at this line, but maybe the
author didn't submitted it properly (I guess it should be submitted into, instead of the list). 
Could this change, or something similar be applied in the incoming new
Xi Ruoyao <>
School of Aerospace Science and Technology, Xidian University

reply via email to

[Prev in Thread] Current Thread [Next in Thread]