cc-wrapper/ld-wrapper: Minor speedup in string concatenation
There is still a O(n) pattern match in ld-wrapper, so we should probably rewrite that code to use associative arrays.
This commit is contained in:
parent
6669a3b477
commit
aa4a92d2df
@ -55,7 +55,7 @@ while [ $n -lt ${#params[*]} ]; do
|
||||
nonFlagArgs=1
|
||||
elif [ "$p" = -m32 ]; then
|
||||
if [ -e @out@/nix-support/dynamic-linker-m32 ]; then
|
||||
NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)"
|
||||
NIX_LDFLAGS+=" -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)"
|
||||
fi
|
||||
fi
|
||||
n=$((n + 1))
|
||||
@ -111,9 +111,9 @@ fi
|
||||
|
||||
if [[ "$isCpp" = 1 ]]; then
|
||||
if [[ "$cppInclude" = 1 ]]; then
|
||||
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE ${NIX_CXXSTDLIB_COMPILE-@default_cxx_stdlib_compile@}"
|
||||
NIX_CFLAGS_COMPILE+=" ${NIX_CXXSTDLIB_COMPILE-@default_cxx_stdlib_compile@}"
|
||||
fi
|
||||
NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK $NIX_CXXSTDLIB_LINK"
|
||||
NIX_CFLAGS_LINK+=" $NIX_CXXSTDLIB_LINK"
|
||||
fi
|
||||
|
||||
LD=@ldPath@/ld
|
||||
|
@ -79,7 +79,7 @@ if [ "$NIX_DONT_SET_RPATH" != 1 ]; then
|
||||
case $libPath in
|
||||
*\ $path\ *) return 0 ;;
|
||||
esac
|
||||
libPath="$libPath $path "
|
||||
libPath+=" $path "
|
||||
}
|
||||
|
||||
addToRPath() {
|
||||
@ -90,12 +90,12 @@ if [ "$NIX_DONT_SET_RPATH" != 1 ]; then
|
||||
case $rpath in
|
||||
*\ $1\ *) return 0 ;;
|
||||
esac
|
||||
rpath="$rpath $1 "
|
||||
rpath+=" $1 "
|
||||
}
|
||||
|
||||
libs=""
|
||||
addToLibs() {
|
||||
libs="$libs $1"
|
||||
libs+=" $1"
|
||||
}
|
||||
|
||||
rpath=""
|
||||
|
Loading…
Reference in New Issue
Block a user