Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
2.1 kB · 72 lines
Shell
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273# Binutils Wrapper hygiene## See comments in cc-wrapper's setup hook. This works exactly the same way.
# Skip setup hook if we're neither a build-time dep, nor, temporarily, doing a# native compile.## TODO(@Ericson2314): No native exception[[ -z ${strictDeps-} ]] || (( "$hostOffset" < 0 )) || return 0
bintoolsWrapper_addLDVars () { # See ../setup-hooks/role.bash local role_post getHostRoleEnvHook
if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then export NIX_LDFLAGS${role_post}+=" -L$1/lib64" fi
if [[ -d "$1/lib" ]]; then # Don't add the /lib directory if it actually doesn't contain any libraries. For instance, # Python and Haskell packages often only have directories like $out/lib/ghc-8.4.3/ or # $out/lib/python3.6/, so having them in LDFLAGS just makes the linker search unnecessary # directories and bloats the size of the environment variable space. local -a glob=( $1/lib/lib* ) if [ "${#glob[*]}" -gt 0 ]; then export NIX_LDFLAGS${role_post}+=" -L$1/lib" fi fi}
# See ../setup-hooks/role.bashgetTargetRolegetTargetRoleWrapper
addEnvHooks "$targetOffset" bintoolsWrapper_addLDVars
# shellcheck disable=SC2157if [ -n "@bintools_bin@" ]; then addToSearchPath _PATH @bintools_bin@/binfi
# shellcheck disable=SC2157if [ -n "@libc_bin@" ]; then addToSearchPath _PATH @libc_bin@/binfi
# shellcheck disable=SC2157if [ -n "@coreutils_bin@" ]; then addToSearchPath _PATH @coreutils_bin@/binfi
# Export tool environment variables so various build systems use the right ones.
export NIX_BINTOOLS${role_post}=@out@
for cmd in \ ar as ld nm objcopy objdump readelf ranlib strip strings size windresdo if PATH=$_PATH type -p "@targetPrefix@${cmd}" > /dev/null then export "${cmd^^}${role_post}=@targetPrefix@${cmd}"; fidone
# If unset, assume the default hardening flags.: ${NIX_HARDENING_ENABLE="@default_hardening_flags_str@"}export NIX_HARDENING_ENABLE
# No local scope in sourced fileunset -v role_post cmd upper_case