mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-25 06:38:22 +03:00
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
|
nonFlagArgs=1
|
||||||
elif [ "$p" = -m32 ]; then
|
elif [ "$p" = -m32 ]; then
|
||||||
if [ -e @out@/nix-support/dynamic-linker-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
|
||||||
fi
|
fi
|
||||||
n=$((n + 1))
|
n=$((n + 1))
|
||||||
@ -111,9 +111,9 @@ fi
|
|||||||
|
|
||||||
if [[ "$isCpp" = 1 ]]; then
|
if [[ "$isCpp" = 1 ]]; then
|
||||||
if [[ "$cppInclude" = 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
|
fi
|
||||||
NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK $NIX_CXXSTDLIB_LINK"
|
NIX_CFLAGS_LINK+=" $NIX_CXXSTDLIB_LINK"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LD=@ldPath@/ld
|
LD=@ldPath@/ld
|
||||||
|
@ -79,7 +79,7 @@ if [ "$NIX_DONT_SET_RPATH" != 1 ]; then
|
|||||||
case $libPath in
|
case $libPath in
|
||||||
*\ $path\ *) return 0 ;;
|
*\ $path\ *) return 0 ;;
|
||||||
esac
|
esac
|
||||||
libPath="$libPath $path "
|
libPath+=" $path "
|
||||||
}
|
}
|
||||||
|
|
||||||
addToRPath() {
|
addToRPath() {
|
||||||
@ -90,12 +90,12 @@ if [ "$NIX_DONT_SET_RPATH" != 1 ]; then
|
|||||||
case $rpath in
|
case $rpath in
|
||||||
*\ $1\ *) return 0 ;;
|
*\ $1\ *) return 0 ;;
|
||||||
esac
|
esac
|
||||||
rpath="$rpath $1 "
|
rpath+=" $1 "
|
||||||
}
|
}
|
||||||
|
|
||||||
libs=""
|
libs=""
|
||||||
addToLibs() {
|
addToLibs() {
|
||||||
libs="$libs $1"
|
libs+=" $1"
|
||||||
}
|
}
|
||||||
|
|
||||||
rpath=""
|
rpath=""
|
||||||
|
Loading…
Reference in New Issue
Block a user