summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2012-12-10 10:05:27 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2012-12-10 10:05:31 +0100
commita4b15bee261120085df7496cf988b504bf5d848d (patch)
treea6d422b8463ef8749192e960fdea59adee29d411
parent314dcd3a3c8987022641769360b1ff1a11f7b730 (diff)
downloadptxdist-a4b15bee261120085df7496cf988b504bf5d848d.tar.gz
ptxdist-a4b15bee261120085df7496cf988b504bf5d848d.tar.xz
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 <m.olbrich@pengutronix.de>
-rw-r--r--scripts/wrapper/libwrapper.sh11
1 files changed, 10 insertions, 1 deletions
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
}