binutils-wrapper: Try to avoid adding unnecessary -L flags
(cherry picked from commit f3758258b8895508475caf83e92bfb236a27ceb9) Signed-off-by: Domen Kožar <domen@dev.si>
This commit is contained in:
parent
37273afd27
commit
24596d7a4a
1 changed files with 7 additions and 1 deletions
|
@ -20,7 +20,13 @@ bintoolsWrapper_addLDVars () {
|
|||
fi
|
||||
|
||||
if [[ -d "$1/lib" ]]; then
|
||||
export NIX_${role_pre}LDFLAGS+=" -L$1/lib"
|
||||
# Don't add the /lib directory if it actually doesn't contain any libraries. For instance,
|
||||
# Python and Haskell packages often only have directories like $out/lib/ghc-8.4.3/ or
|
||||
# $out/lib/python3.6/, so having them in LDFLAGS just makes the linker search unnecessary
|
||||
# directories and bloats the size of the environment variable space.
|
||||
if [[ -n "$(echo $1/lib/lib*)" ]]; then
|
||||
export NIX_${role_pre}LDFLAGS+=" -L$1/lib"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue