From a4b15bee261120085df7496cf988b504bf5d848d Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Mon, 10 Dec 2012 10:05:27 +0100 Subject: wrapper: don't add linker flags if there is nothing to link Otherwise the linker may be called anyways and returns with an error. Signed-off-by: Michael Olbrich --- scripts/wrapper/libwrapper.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'scripts/wrapper') diff --git a/scripts/wrapper/libwrapper.sh b/scripts/wrapper/libwrapper.sh index aa10b5021..3eec11602 100644 --- a/scripts/wrapper/libwrapper.sh +++ b/scripts/wrapper/libwrapper.sh @@ -1,5 +1,6 @@ #!/bin/sh +COMPILING=false LINKING=true FORTIFY=true STDLIB=true @@ -51,11 +52,19 @@ cc_check_args() { echo "${0##*/} $*" >&2 exit 1 ;; + -) + COMPILING=true + ;; + -*) + ;; + *) + COMPILING=true + ;; esac done # Used e.g. by the kernel to get the compiler version. Adding # linker options confuses gcc because there is nothing to link. - if [ "$*" = "-v" ]; then + if ! $COMPILING; then LINKING=false fi } -- cgit v1.2.3