aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-bootstrap/bootstrap.exp
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-bootstrap/bootstrap.exp')
-rw-r--r--ld/testsuite/ld-bootstrap/bootstrap.exp60
1 files changed, 32 insertions, 28 deletions
diff --git a/ld/testsuite/ld-bootstrap/bootstrap.exp b/ld/testsuite/ld-bootstrap/bootstrap.exp
index 726b3fe..9a68ebe 100644
--- a/ld/testsuite/ld-bootstrap/bootstrap.exp
+++ b/ld/testsuite/ld-bootstrap/bootstrap.exp
@@ -48,13 +48,25 @@ if [check_plugin_api_available] {
# order to test -r. Then link the result into an executable, ld1, to
# really test -r. Use ld1 to link a fresh ld, ld2. Use ld2 to link a
# new ld, ld3. ld2 and ld3 should be identical.
-set test_flags {"" "strip" "--static" "--traditional-format"
- "--no-keep-memory" "--relax"}
+set test_flags {"" "strip" "--static" "-Wl,--traditional-format"
+ "-Wl,--no-keep-memory" "-Wl,--relax"}
if { [istarget "powerpc-*-*"] } {
- lappend test_flags "--ppc476-workaround"
+ lappend test_flags "-Wl,--ppc476-workaround"
+}
+
+set gcc_B_opt_save $gcc_B_opt
+
+foreach ldexe {ld1 ld2 ld3} {
+ if {![file isdirectory tmpdir/gcc$ldexe]} then {
+ catch "exec mkdir tmpdir/gcc$ldexe" status
+ catch "exec ln -s ../$ldexe tmpdir/gcc$ldexe/ld" status
+ catch "exec ln -s ld tmpdir/gcc$ldexe/collect-ld" status
+ catch "exec ln -s ../../../gas/as-new tmpdir/gcc$ldexe/as" status
+ }
}
foreach flags $test_flags {
+ set gcc_B_opt $gcc_B_opt_save
set do_strip "no"
if {"$flags" == "strip"} {
set testname "bootstrap with $flags"
@@ -67,8 +79,8 @@ foreach flags $test_flags {
}}
# --static is meaningless and --relax is incompatible with -r.
- set partial_flags "$flags"
- if { "$flags" == "--static" || "$flags" == "--relax" } {
+ regsub -- "-Wl," $flags "" partial_flags
+ if { "$partial_flags" == "--static" || "$partial_flags" == "--relax" } {
set partial_flags ""
}
@@ -140,7 +152,7 @@ foreach flags $test_flags {
setup_xfail "mips*-*-irix5*"
}
- if ![ld_link $ld tmpdir/ld1 "$flags tmpdir/ld-partial.o $BFDLIB $LIBIBERTY $extralibs"] {
+ if ![ld_link $CC tmpdir/ld1 "$flags tmpdir/ld-partial.o $BFDLIB $LIBIBERTY $extralibs"] {
fail $testname
continue
}
@@ -155,36 +167,27 @@ foreach flags $test_flags {
}
}
- if ![ld_link tmpdir/ld1 tmpdir/ld2 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
+ regsub /tmpdir/ld/ $gcc_B_opt_save /tmpdir/gccld1/ gcc_B_opt
+ if ![ld_link $CC tmpdir/ld2 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
fail $testname
continue
}
- if ![ld_link tmpdir/ld2 tmpdir/ld3 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
+ regsub /tmpdir/ld/ $gcc_B_opt_save /tmpdir/gccld2/ gcc_B_opt
+ if ![ld_link $CC tmpdir/ld3 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
fail $testname
continue
}
- if {"$flags" == "--static"} {
- if { [istarget ia64-*-elf*]
- || [istarget ia64-*-linux*] } {
- # On ia64, tmpdir/ld2 != tmpdir/ld3 is normal since they are
- # generated by different linkers, tmpdir/ld1 and tmpdir/ld2.
- # So we rebuild tmpdir/ld2 with tmpdir/ld3.
- if ![ld_link tmpdir/ld3 tmpdir/ld2 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
- fail $testname
- continue
- }
- }
- } else {
- if { [istarget mips*-*-linux*] } {
- # On Linux/mips, tmpdir/ld2 != tmpdir/ld3 is normal since
- # they are generated by different linkers, tmpdir/ld1 and
- # tmpdir/ld2. So we rebuild tmpdir/ld2 with tmpdir/ld3.
- if ![ld_link tmpdir/ld3 tmpdir/ld2 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
- fail $testname
- continue
- }
+ if { "$flags" == "--static" && { [istarget ia64-*-elf*] || [istarget ia64-*-linux*] }
+ || [istarget mips*-*-linux*] } {
+ # On ia64 and mips, tmpdir/ld2 != tmpdir/ld3 is normal since they are
+ # generated by different linkers, tmpdir/ld1 and tmpdir/ld2.
+ # So we rebuild tmpdir/ld2 with tmpdir/ld3.
+ regsub /tmpdir/ld/ $gcc_B_opt_save /tmpdir/gccld3/ gcc_B_opt
+ if ![ld_link $CC tmpdir/ld2 "$flags $OFILES $BFDLIB $LIBIBERTY $extralibs"] {
+ fail $testname
+ continue
}
}
@@ -222,5 +225,6 @@ foreach flags $test_flags {
}
}
+set gcc_B_opt $gcc_B_opt_save
catch "exec rm -f tmpdir/ld-partial.o tmpdir/ld1 tmpdir/ld2 tmpdir/ld3" status
catch "exec rm -f tmpdir/ld2tail tmpdir/ld3tail" status