summaryrefslogtreecommitdiff
path: root/ld/testsuite/config
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-04-17 13:03:53 +0100
committerNick Clifton <nickc@redhat.com>2020-04-17 13:03:53 +0100
commit49c16254b41d56c35ce788eae76a1c1bc22db7ac (patch)
tree4460dc0a0a071847242adef31631ac4d7b0bd709 /ld/testsuite/config
parent3557f442a1881271652581b4a66c206d5b348c5d (diff)
downloadbinutils-gdb-49c16254b41d56c35ce788eae76a1c1bc22db7ac.tar.gz
Commit: Running the linker testsuite with clang
* testsuite/config/default.exp: If not already set then create the CCC_OVERRIDE_OPTIONS environment variable to help when running the testsuite with clang. * testsuite/ld-elf/pr22269-1.c: Add a missing return statement. * testsuite/ld-elfvers/vers.exp: Add checks to detect if files were built before attempting to copy them.
Diffstat (limited to 'ld/testsuite/config')
-rw-r--r--ld/testsuite/config/default.exp50
1 files changed, 50 insertions, 0 deletions
diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp
index 64b78cd18a4..5b7ca7a9394 100644
--- a/ld/testsuite/config/default.exp
+++ b/ld/testsuite/config/default.exp
@@ -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