Commit: Running the linker testsuite with clang
[deliverable/binutils-gdb.git] / ld / testsuite / config / default.exp
index 7998f4efb851e51d065cd6a52f8f395751fb6777..5b7ca7a93948c1a76dc90d6b80f2411a6a03c5e3 100644 (file)
@@ -95,6 +95,56 @@ if {![info exists CXXFLAGS]} {
     set CXXFLAGS ""
 }
 
+# This allows us to run the linker testsuite with clang as the compilation
+# driver instead of gcc.  The syntax of the overrides are as follows, one
+# per line:
+#
+#  '#': Silence information about the changes to the command line arguments.
+#
+#  '^': Add FOO as a new argument at the beginning of the command line.
+#
+#  '+': Add FOO as a new argument at the end of the command line.
+#
+#  's/XXX/YYY/': Substitute the regular expression XXX with YYY in the command
+#  line.
+#
+#  'xOPTION': Removes all instances of the literal argument OPTION.
+#
+#  'XOPTION': Removes all instances of the literal argument OPTION,
+#  and the following argument.
+#
+#  'Ox': Removes all flags matching 'O' or 'O[sz0-9]' and adds 'Ox'
+#  at the end of the command line.
+#
+# \param OS - The stream to write edit information to.
+# \param Args - The vector of command line arguments.
+# \param Edit - The override command to perform.
+# \param SavedStrings - Set to use for storing string representations.
+
+global env
+# Only set up the environment variable if the user has not already provided one.
+if {! [info exists env(CCC_OVERRIDE_OPTIONS)]} {
+    set env(CCC_OVERRIDE_OPTIONS) "#\
+  +-Wno-unused-command-line-argument \
+  +-Wno-unknown-attributes \
+  +-Wno-tautological-compare \
+  +-Wno-ignored-optimization-argument \
+  +-Wno-deprecated \
+  +-fuse-ld=$ld \
+  x-Wa,--elf-stt-common=yes \
+  x-Wa,-mx86-used-note=no \
+  x-Wa,-mx86-used-note=yes \
+  x-Wa,-madd-bnd-prefix \
+  x-fno-early-inlining \
+  x-fno-toplevel-reorder \
+  x-flto-partition=none \
+  x-feliminate-dwarf2-dups \
+  s/-Wa,-mrelax-relocations=yes,-mx86-used-note=yes/-Wa,-mrelax-relocations=yes/ \
+  s/-Wa,--compress-debug-sections=zlib/-Wa,-compress-debug-sections=zlib/ \
+  s/-Wa,--compress-debug-sections=zlib-gabi/-Wa,-compress-debug-sections=zlib-gabi/ \
+"
+}
+
 # The mips64-*-linux-gnu compiler defaults to the N32 ABI after
 # installed, but to the O32 ABI in the build tree, because of some
 # specs-file hacks.  Make sure we use an ABI that is compatible with
@@ -358,7 +408,7 @@ if { ![info exists NOCF_PROTECTION_CFLAGS] } then {
            append flags " [board_info [target_info name] ldflags]"
        }
 
-       set basename "tmpdir/nopie[pid]"
+       set basename "tmpdir/available[pid]"
        set src ${basename}.c
        set output ${basename}
        set f [open $src "w"]
@@ -367,12 +417,12 @@ if { ![info exists NOCF_PROTECTION_CFLAGS] } then {
        if [is_remote host] {
            set src [remote_download host $src]
        }
-       set nopie_available [run_host_cmd_yesno "$CC" "$flags -fcf-protection=none $src -o $output"]
+       set available [run_host_cmd_yesno "$CC" "$flags -fcf-protection=none $src -o $output"]
        remote_file host delete $src
        remote_file host delete $output
        file delete $src
 
-       if { $nopie_available == 1 } then {
+       if { $available == 1 } then {
            set NOCF_PROTECTION_CFLAGS "-fcf-protection=none"
        } else {
            set NOCF_PROTECTION_CFLAGS ""
This page took 0.024404 seconds and 4 git commands to generate.