]> xenbits.xensource.com Git - osstest/rumprun.git/commitdiff
cc: make output of -dump{machine,specs} match reality
authorAntti Kantee <pooka@iki.fi>
Mon, 2 May 2016 14:22:34 +0000 (14:22 +0000)
committerAntti Kantee <pooka@iki.fi>
Mon, 2 May 2016 14:22:34 +0000 (14:22 +0000)
app-tools/cc.in

index 2d78bdf8c49cd0877d440559e8afab01230c111c..b2d0d8dd4dd14b4ea8ebd136882c49372185a6ca 100644 (file)
@@ -68,6 +68,12 @@ for arg in "$@"; do
        [ "${arg}" = "-o" ] && WANTARG=yes && continue
        [ -n "${WANTARG}" ] && OUTFILE=${arg} && WANTARG=
 
+       # If either of these is present on the command line, the
+       # behaviour of gcc seems to be that they silently override
+       # all other flags
+       [ "${arg}" = "-dumpmachine" ] && { MODE=dumpmachine; break; }
+       [ "${arg}" = "-dumpspecs" ] && { MODE=dumpspecs; break; }
+
        # even if the backing compiler supports multiarch, we do not
        [ "${arg}" = "-print-multiarch" ] && \
            { echo "${PROGNAME}: unrecognized option '-print-multiarch'" 2>&1;
@@ -126,6 +132,16 @@ ferment)
        # Some build systems insist that the output looks like an executable.
        chmod +x ${OUTFILE}
        ;;
+
+dumpmachine)
+       echo !TOOLTUPLE!
+       ;;
+
+dumpspecs)
+       ${CC} -dumpspecs
+       cat !DESTDIR!/rumprun-!MACHINE_GNU_ARCH!/lib/specs-compile_or_ferment
+       ;;
+
 *)
        echo "${PROGNAME}: internal error, unknown mode"
        exit 1