X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=ld%2Ftestsuite%2Flib%2Fld-lib.exp;h=a44358e0aaace22514f1b3a770ff4e9be1938136;hb=7a8eb317c5bce0f1ff290a9343777db74adec663;hp=5ca700bf27a99fe6bc6a6d1f8353cc7dab8685f0;hpb=a44d0bd787e4fdf2424583508f407bafa139ed8a;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index 5ca700bf27..a44358e0aa 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -1381,6 +1381,17 @@ proc run_ld_link_exec_tests { ldtests args } { global CXXFLAGS global errcnt global exec_output + global board_cflags + + # When using GCC as the linker driver, we need to specify board cflags when + # linking because cflags may contain linker options. For example when + # linker options are included in GCC spec files then we need the -specs + # option. + if [board_info [target_info name] exists cflags] { + set board_cflags " [board_info [target_info name] cflags]" + } else { + set board_cflags "" + } foreach testitem $ldtests { foreach target $args { @@ -1440,7 +1451,7 @@ proc run_ld_link_exec_tests { ldtests args } { # compile only pass $testname continue; - } elseif ![$link_proc $link_cmd $binfile "-L$srcdir/$subdir $ld_options $objfiles"] { + } elseif ![$link_proc $link_cmd $binfile "$board_cflags -L$srcdir/$subdir $ld_options $objfiles"] { set failed 1 }