bintools-wrapper: support post linker hooks
This commit is contained in:
parent
eb8f8afac7
commit
15637fe621
|
@ -102,6 +102,8 @@ declare -a libDirs
|
||||||
declare -A libs
|
declare -A libs
|
||||||
declare -i relocatable=0 link32=0
|
declare -i relocatable=0 link32=0
|
||||||
|
|
||||||
|
linkerOutput="a.out"
|
||||||
|
|
||||||
if
|
if
|
||||||
[ "$NIX_DONT_SET_RPATH_@suffixSalt@" != 1 ] \
|
[ "$NIX_DONT_SET_RPATH_@suffixSalt@" != 1 ] \
|
||||||
|| [ "$NIX_SET_BUILD_ID_@suffixSalt@" = 1 ] \
|
|| [ "$NIX_SET_BUILD_ID_@suffixSalt@" = 1 ] \
|
||||||
|
@ -153,6 +155,24 @@ then
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Determine linkerOutput
|
||||||
|
prev=
|
||||||
|
for p in \
|
||||||
|
${extraBefore+"${extraBefore[@]}"} \
|
||||||
|
${params+"${params[@]}"} \
|
||||||
|
${extraAfter+"${extraAfter[@]}"}
|
||||||
|
do
|
||||||
|
case "$prev" in
|
||||||
|
-o)
|
||||||
|
# Informational for post-link-hook
|
||||||
|
linkerOutput="$p"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
prev="$p"
|
||||||
|
done
|
||||||
|
|
||||||
if [[ "$link32" = "1" && "$setDynamicLinker" = 1 && -e "@out@/nix-support/dynamic-linker-m32" ]]; then
|
if [[ "$link32" = "1" && "$setDynamicLinker" = 1 && -e "@out@/nix-support/dynamic-linker-m32" ]]; then
|
||||||
# We have an alternate 32-bit linker and we're producing a 32-bit ELF, let's
|
# We have an alternate 32-bit linker and we're producing a 32-bit ELF, let's
|
||||||
# use it.
|
# use it.
|
||||||
|
@ -223,7 +243,11 @@ fi
|
||||||
|
|
||||||
PATH="$path_backup"
|
PATH="$path_backup"
|
||||||
# Old bash workaround, see above.
|
# Old bash workaround, see above.
|
||||||
exec @prog@ \
|
@prog@ \
|
||||||
${extraBefore+"${extraBefore[@]}"} \
|
${extraBefore+"${extraBefore[@]}"} \
|
||||||
${params+"${params[@]}"} \
|
${params+"${params[@]}"} \
|
||||||
${extraAfter+"${extraAfter[@]}"}
|
${extraAfter+"${extraAfter[@]}"}
|
||||||
|
|
||||||
|
if [ -e "@out@/nix-support/post-link-hook" ]; then
|
||||||
|
source @out@/nix-support/post-link-hook
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue