X-Git-Url: http://drtracing.org/?a=blobdiff_plain;ds=sidebyside;f=ld%2Ftestsuite%2Fconfig%2Fdefault.exp;h=9e89ca1283472c2ab071fb65104007e3246f7a1a;hb=5fd104addfddb68844fb8df67be832ee98ad9888;hp=952be42a331bc340ae6f4649680fc8b84f64eac0;hpb=bba21f1561dba85f85c50bc995443fd51c80609d;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp index 952be42a33..9e89ca1283 100644 --- a/ld/testsuite/config/default.exp +++ b/ld/testsuite/config/default.exp @@ -1,6 +1,5 @@ # Basic expect script for LD Regression Tests -# Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2001, 2003, 2007 -# Free Software Foundation, Inc. +# Copyright (C) 1993-2020 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -50,32 +49,30 @@ if ![info exists strip] then { set strip [findfile $base_dir/../binutils/strip-new $base_dir/../binutils/strip-new [transform strip]] } -remote_exec host "mkdir -p tmpdir" - -# Make a symlink from tmpdir/as to the assembler in the build tree, so -# that we can use a -B option to gcc to force it to use the newly -# built assembler. -if {![file isdirectory tmpdir/gas]} then { - catch "exec mkdir tmpdir/gas" status - catch "exec ln -s ../../../gas/as-new tmpdir/gas/as" status +if ![info exists size] then { + set size [findfile $base_dir/../binutils/size] } -set gcc_gas_flag "-B[pwd]/tmpdir/gas/" -# Make a symlink from tmpdir/ld to the linker in the build tree, so -# that we can use a -B option to gcc to force it to use the newly -# built linker. +remote_exec host "mkdir -p tmpdir" + +# Make symlinks from tmpdir/ld to the linker and assembler in the +# build tree, so that we can use a -B option to gcc to force it to use +# the newly built linker and assembler. if {![file isdirectory tmpdir/ld]} then { catch "exec mkdir tmpdir/ld" status catch "exec ln -s ../../ld-new tmpdir/ld/ld" status + catch "exec ln -s ld tmpdir/ld/collect-ld" status + catch "exec ln -s ../../../gas/as-new tmpdir/ld/as" status } -set gcc_ld_flag "-B[pwd]/tmpdir/ld/" +set gcc_B_opt "-B[pwd]/tmpdir/ld/" # load the linker path +set ld_L_opt "" if {[file exists tmpdir/libpath.exp]} { load_lib tmpdir/libpath.exp foreach dir $libpath { - set gcc_ld_flag "$gcc_ld_flag -L$dir" + append ld_L_opt " -L$dir" } } @@ -95,6 +92,55 @@ 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. + +# 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 @@ -103,32 +149,17 @@ if {[istarget mips64*-*-linux*] && (![board_info [target_info name] exists multilib_flags] || ![string match "*-mabi" [board_info [target_info name] multilib_flags]]) } { - append gcc_gas_flag " -mabi=n32" + append gcc_B_opt " -mabi=n32" +} + +if { [istarget rx-*-*] } { + global ASFLAGS + set ASFLAGS "-muse-conventional-section-names" } # load the utility procedures load_lib ld-lib.exp -proc get_link_files {varname} { - global $varname - global target_triplet - global srcdir - global CC - if ![info exists $varname] { - #configure.host returns variables that can be substituted into - #makefile rules, with embedded shell variable expansions. - #make wants $$shell_var, we want $shell_var ... - set cmd "host='$target_triplet' && . $srcdir/../configure.host && sed -e 's,\\\$\\\$,\$,g' <