[obv] Fix broken build on Fedora 23.
[deliverable/binutils-gdb.git] / gdb / contrib / cc-with-tweaks.sh
index fbb2b88f640da22cac89015b4bbd3e08aaff955d..f491a0fb615c8d8a65182b05fd39fe9522496014 100755 (executable)
@@ -2,7 +2,7 @@
 # Wrapper around gcc to tweak the output in various ways when running
 # the testsuite.
 
-# Copyright (C) 2010-2012 Free Software Foundation, Inc.
+# Copyright (C) 2010-2016 Free Software Foundation, Inc.
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 3 of the License, or
@@ -30,6 +30,9 @@
 #   CC_FOR_TARGET="/bin/sh $srcdir/gdb/contrib/cc-with-tweaks.sh ARGS gcc" \
 #   CXX_FOR_TARGET="/bin/sh $srcdir/gdb/contrib/cc-with-tweaks.sh ARGS g++"
 #
+# For documentation on Fission and dwp files:
+#     http://gcc.gnu.org/wiki/DebugFission
+#     http://gcc.gnu.org/wiki/DebugFissionDWP
 # For documentation on index files: info -f gdb.info -n "Index Files"
 # For information about 'dwz', see the announcement:
 #     http://gcc.gnu.org/ml/gcc/2012-04/msg00686.html
@@ -40,6 +43,7 @@
 # -z compress using dwz
 # -m compress using dwz -m
 # -i make an index
+# -p create .dwp files (Fission), you need to also use gcc option -gsplit-dwarf
 # If nothing is given, no changes are made
 
 myname=cc-with-tweaks.sh
@@ -175,8 +179,13 @@ fi
 if [ "$want_dwp" = true ]; then
     dwo_files=$($READELF -wi "${output_file}" | grep _dwo_name | \
        sed -e 's/^.*: //' | sort | uniq)
-    $DWP -o "${output_file}.dwp" ${dwo_files} > /dev/null
-    rm -f ${dwo_files}
+    rc=0
+    if [ -n "$dwo_files" ]; then
+       $DWP -o "${output_file}.dwp" ${dwo_files} > /dev/null
+       rc=$?
+       [ $rc != 0 ] && exit $rc
+       rm -f ${dwo_files}
+    fi
 fi
 
 rm -f "$index_file"
This page took 0.039136 seconds and 4 git commands to generate.