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.

+6 -6
+3 -3
pkgs/build-support/cc-wrapper/cc-wrapper.sh
··· 55 nonFlagArgs=1 56 elif [ "$p" = -m32 ]; then 57 if [ -e @out@/nix-support/dynamic-linker-m32 ]; then 58 - NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" 59 fi 60 fi 61 n=$((n + 1)) ··· 111 112 if [[ "$isCpp" = 1 ]]; then 113 if [[ "$cppInclude" = 1 ]]; then 114 - NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE ${NIX_CXXSTDLIB_COMPILE-@default_cxx_stdlib_compile@}" 115 fi 116 - NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK $NIX_CXXSTDLIB_LINK" 117 fi 118 119 LD=@ldPath@/ld
··· 55 nonFlagArgs=1 56 elif [ "$p" = -m32 ]; then 57 if [ -e @out@/nix-support/dynamic-linker-m32 ]; then 58 + NIX_LDFLAGS+=" -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" 59 fi 60 fi 61 n=$((n + 1)) ··· 111 112 if [[ "$isCpp" = 1 ]]; then 113 if [[ "$cppInclude" = 1 ]]; then 114 + NIX_CFLAGS_COMPILE+=" ${NIX_CXXSTDLIB_COMPILE-@default_cxx_stdlib_compile@}" 115 fi 116 + NIX_CFLAGS_LINK+=" $NIX_CXXSTDLIB_LINK" 117 fi 118 119 LD=@ldPath@/ld
+3 -3
pkgs/build-support/cc-wrapper/ld-wrapper.sh
··· 79 case $libPath in 80 *\ $path\ *) return 0 ;; 81 esac 82 - libPath="$libPath $path " 83 } 84 85 addToRPath() { ··· 90 case $rpath in 91 *\ $1\ *) return 0 ;; 92 esac 93 - rpath="$rpath $1 " 94 } 95 96 libs="" 97 addToLibs() { 98 - libs="$libs $1" 99 } 100 101 rpath=""
··· 79 case $libPath in 80 *\ $path\ *) return 0 ;; 81 esac 82 + libPath+=" $path " 83 } 84 85 addToRPath() { ··· 90 case $rpath in 91 *\ $1\ *) return 0 ;; 92 esac 93 + rpath+=" $1 " 94 } 95 96 libs="" 97 addToLibs() { 98 + libs+=" $1" 99 } 100 101 rpath=""