]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Clear hwcap_2 with Sun ld
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 20 Feb 2013 10:02:48 +0000 (10:02 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Wed, 20 Feb 2013 10:02:48 +0000 (10:02 +0000)
Backport from mainline:
2012-06-20  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

* gcc.target/i386/clearcapv2.map: New file.
* gcc.target/i386/i386.exp: Try it first before clearcap.map.

From-SVN: r196168

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/clearcapv2.map [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/i386.exp

index e12c918e867dae84a34c4b2624f4d1260749a9a4..5ea9e38d910b52e207bd3a867252dbe2c3c492f2 100644 (file)
@@ -1,3 +1,11 @@
+2013-02-20  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       Backport from mainline:
+       2012-06-20  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * gcc.target/i386/clearcapv2.map: New file.
+       * gcc.target/i386/i386.exp: Try it first before clearcap.map.
+
 2013-02-19  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
diff --git a/gcc/testsuite/gcc.target/i386/clearcapv2.map b/gcc/testsuite/gcc.target/i386/clearcapv2.map
new file mode 100644 (file)
index 0000000..95cb14c
--- /dev/null
@@ -0,0 +1,7 @@
+# clear all hardware capabilities emitted by Sun as: the tests here
+# guard against execution at runtime
+# uses mapfile v2 syntax which is the only way to clear AT_SUN_CAP_HW2 flags
+$mapfile_version 2
+CAPABILITY {
+  HW = ;
+};
index 75bea9be8064d0c9d76674e19b2242b1c5094863..b8bbe1c74f245fb567fd69dfcded2d77205e3401 100644 (file)
@@ -245,12 +245,23 @@ proc check_effective_target_bmi2 { } {
 
 # If the linker used understands -M <mapfile>, pass it to clear hardware
 # capabilities set by the Sun assembler.
-set clearcap_ldflags "-Wl,-M,$srcdir/$subdir/clearcap.map"
+# Try mapfile syntax v2 first which is the only way to clear hwcap_2 flags.
+set clearcap_ldflags "-Wl,-M,$srcdir/$subdir/clearcapv2.map"
 
-if [check_no_compiler_messages mapfile executable {
+if ![check_no_compiler_messages mapfilev2 executable {
+    int main (void) { return 0; }
+} $clearcap_ldflags ] {
+    # If this doesn't work, fall back to the less capable v1 syntax.
+    set clearcap_ldflags "-Wl,-M,$srcdir/$subdir/clearcap.map"
+
+    if ![check_no_compiler_messages mapfile executable {
        int main (void) { return 0; }
-  } $clearcap_ldflags ] {
+    } $clearcap_ldflags ] {
+       unset clearcap_ldflags
+    }
+}
 
+if [info exists clearcap_ldflags] {
   if { [info procs gcc_target_compile] != [list] \
        && [info procs saved_gcc_target_compile] == [list] } {
     rename gcc_target_compile saved_gcc_target_compile