cc-wrapper: Clean up dynamic linking with x86 multilib

It's better layering to do everything in ld-wrapper.
This commit is contained in:
John Ericson 2017-08-30 14:57:20 -04:00
parent 0cdbd2d662
commit 94c0267fc1
2 changed files with 15 additions and 4 deletions

View File

@ -57,10 +57,6 @@ while (( "$n" < "$nParams" )); do
cppInclude=0
elif [ "${p:0:1}" != - ]; then
nonFlagArgs=1
elif [ "$p" = -m32 ]; then
if [ -e @out@/nix-support/dynamic-linker-m32 ]; then
NIX_@infixSalt@_LDFLAGS+=" -dynamic-linker $(< @out@/nix-support/dynamic-linker-m32)"
fi
fi
n+=1
done

View File

@ -63,6 +63,21 @@ fi
extraAfter+=($NIX_@infixSalt@_LDFLAGS_AFTER)
# Choose 32-bit dynamic linker if needed
if [ -e @out@/nix-support/dynamic-linker-m32 ]; then
prev=
for p in ${params+"${params[@]}"}; do
if [[ "$prev" = "-m" && "$p" = "elf_i386" ]]; then
extraAfter+=(
'-dynamic-linker'
"$(< @out@/nix-support/dynamic-linker-m32)"
)
break
fi
prev="$p"
done
fi
declare -a libDirs
declare -A libs
relocatable=