OSDN Git Service

PR bootstrap/41245
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 Sep 2009 14:32:51 +0000 (14:32 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 Sep 2009 14:32:51 +0000 (14:32 +0000)
* compare-debug: Handle stripping of dwarf debug sections from darwin
mach-o objects.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151594 138bc75d-0d04-0410-961f-82ee72b054a4

contrib/ChangeLog
contrib/compare-debug

index 3174cff..b4627d2 100644 (file)
@@ -1,3 +1,9 @@
+2009-09-10  Iain Sandoe  <iain.sandoe@sandoe-acoustics.co.uk>
+
+       PR bootstrap/41245
+       * compare-debug: Handle stripping of dwarf debug sections from darwin
+       mach-o objects.
+
 2009-09-04  Alexandre Oliva  <aoliva@redhat.com>
 
        * compare-debug: Grep for blank before dash to avoid grep -e.
index 6f2b4ab..98c80f9 100755 (executable)
@@ -57,11 +57,19 @@ done
 
 trap 'rm -f "$1.$suf1" "$2.$suf2"' 0 1 2 15
 
-cp "$1" "$1.$suf1"
-strip "$1.$suf1"
+case `uname -s` in
+Darwin)
+  ld -S -x -r -no_uuid "$1" -o "$1.$suf1"
+  ld -S -x -r -no_uuid "$2" -o "$2.$suf2"
+  ;;
+*)
+  cp "$1" "$1.$suf1"
+  strip "$1.$suf1"
 
-cp "$2" "$2.$suf2"
-strip "$2.$suf2"
+  cp "$2" "$2.$suf2"
+  strip "$2.$suf2"
+  ;;
+esac
 
 if cmp "$1.$suf1" "$2.$suf2"; then
   status=0