diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2014-12-14 16:22:04 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2014-12-14 16:24:31 +0100 |
commit | 1a0a1619206f4a25d724bf04027980b45b15b16e (patch) | |
tree | 856155a8c4470052392fac7c1b38c8769685e5e4 /pkgs/build-support/gcc-wrapper-old/gnatlink-wrapper.sh | |
parent | 9cdd231ad3c8fdfcff20c7a9f42a7180dc8fabb0 (diff) | |
download | nixlib-1a0a1619206f4a25d724bf04027980b45b15b16e.tar nixlib-1a0a1619206f4a25d724bf04027980b45b15b16e.tar.gz nixlib-1a0a1619206f4a25d724bf04027980b45b15b16e.tar.bz2 nixlib-1a0a1619206f4a25d724bf04027980b45b15b16e.tar.lz nixlib-1a0a1619206f4a25d724bf04027980b45b15b16e.tar.xz nixlib-1a0a1619206f4a25d724bf04027980b45b15b16e.tar.zst nixlib-1a0a1619206f4a25d724bf04027980b45b15b16e.zip |
gnat: make it build again (close #5307)
Problems are worked around by using older gcc wrapper for gnat bootstrap. (from ca441636f1^) I tried nicer solutions first, but I was unable to fix all problems for hours.
Diffstat (limited to 'pkgs/build-support/gcc-wrapper-old/gnatlink-wrapper.sh')
-rw-r--r-- | pkgs/build-support/gcc-wrapper-old/gnatlink-wrapper.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/build-support/gcc-wrapper-old/gnatlink-wrapper.sh b/pkgs/build-support/gcc-wrapper-old/gnatlink-wrapper.sh new file mode 100644 index 000000000000..25907108b4db --- /dev/null +++ b/pkgs/build-support/gcc-wrapper-old/gnatlink-wrapper.sh @@ -0,0 +1,43 @@ +#! @shell@ -e + +# Add the flags for the GNAT compiler proper. +extraAfter="--GCC=@out@/bin/gcc" +extraBefore=() + +# Add the flags that should be passed to the linker (and prevent +# `ld-wrapper' from adding NIX_LDFLAGS again). +#for i in $NIX_LDFLAGS_BEFORE; do +# extraBefore=(${extraBefore[@]} "-largs $i") +#done + +# Optionally print debug info. +if test "$NIX_DEBUG" = "1"; then + echo "original flags to @gnatlinkProg@:" >&2 + for i in "$@"; do + echo " $i" >&2 + done + echo "extraBefore flags to @gnatlinkProg@:" >&2 + for i in ${extraBefore[@]}; do + echo " $i" >&2 + done + echo "extraAfter flags to @gnatlinkProg@:" >&2 + for i in ${extraAfter[@]}; do + echo " $i" >&2 + done +fi + +if test -n "$NIX_GNAT_WRAPPER_EXEC_HOOK"; then + source "$NIX_GNAT_WRAPPER_EXEC_HOOK" +fi + + +# Call the real `gcc'. Filter out warnings from stderr about unused +# `-B' flags, since they confuse some programs. Deep bash magic to +# apply grep to stderr (by swapping stdin/stderr twice). +if test -z "$NIX_GNAT_NEEDS_GREP"; then + @gnatlinkProg@ ${extraBefore[@]} "$@" ${extraAfter[@]} +else + (@gnatlinkProg@ ${extraBefore[@]} "$@" ${extraAfter[@]} 3>&2 2>&1 1>&3- \ + | (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3- + exit $? +fi |