This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ld, testsuite] Always assemble those intermeidate .o files used later


On 22/01/17 21:18, Alan Modra wrote:
On Fri, Jan 20, 2017 at 04:17:37PM +0000, Jiong Wang wrote:
         * ld/testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Append
         board_cflags as gcc is used as linker driver.
         * ld/testsuite/ld-unique/unique.exp: Likewise
Thanks, this is OK.

Thanks for the review, pushed.

The only remaining failures on AArch64 bare-metal on my test environment is

FAIL: LTO 7
FAIL: LTO 8

which are caused by missing intermediate .o files.  The reason looks like the
assemble of some prerequisite .o files are gated by shared library check while
these .o are used later by non shared tests.

This patch simply split those compilation tests out to always run them,
meanwhile "LTO 7" has one .so participate linking, so it's gated by share
library check.

After this patch, above FAILs become UNSUPPORTED.
(I found some bare-metal tests actually are able to run on simulator, while ld
testsuite environment seems only support native run, might be a seperate issue)

Is this OK for master?

ld/
2017-01-23  Jiong Wang  <jiong.wang@arm.com>

        * testsuite/ld-plugin/lto.exp (lto_link_elf_tests): Move "Compile 7",
        "Compile 8a", "Compile 8b"...
        (lto_compile_elf_tests): ...to here.  Always run these tests.
        (lto_run_elf_tests): Move "LTO 7"...
        (lto_run_elf_shared_tests): ...to here.  Restrict these tests on
        environment where share library is supported.

diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index b525acf..c738895 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -219,20 +219,23 @@ if { [at_least_gcc_version 4 7] } {
     ]]
 }
 
-# Generate input files for complex LTO tests for ELF.
-set lto_link_elf_tests [list \
+set lto_compile_elf_tests [list \
   [list "Compile 7" \
    "" "-flto -O2" \
    {lto-7a.c lto-7b.c lto-7c.c} {} ""] \
-  [list "Build liblto-7.so" \
-   "-shared" "-O2 -fpic" \
-   {lto-7d.c} {} "liblto-7.so" "c"] \
   [list "Compile 8a" \
    "" "-O2" \
    {lto-8a.c} {} ""] \
   [list "Compile 8b" \
    "" "-flto -O2" \
    {lto-8b.c} {} ""] \
+]
+
+# Generate input files for complex LTO tests for ELF.
+set lto_link_elf_tests [list \
+  [list "Build liblto-7.so" \
+   "-shared" "-O2 -fpic" \
+   {lto-7d.c} {} "liblto-7.so" "c"] \
   [list "Build liblto-17a.so" \
    "-shared -O2 -fpic -flto -fuse-linker-plugin" "-O2 -fpic -flto" \
    {lto-17a.c} {{"nm" {} "lto-17a.d"}} "liblto-17a.so" "c"] \
@@ -377,11 +380,15 @@ if { [at_least_gcc_version 4 7] } {
     ]]
 }
 
-# LTO run-time tests for ELF
-set lto_run_elf_tests [list \
+# LTO run-time tests for ELF which require shared library support.
+set lto_run_elf_shared_tests [list \
   [list "LTO 7" \
    "-O2 -flto -fuse-linker-plugin tmpdir/lto-7b.o tmpdir/lto-7c.o tmpdir/lto-7a.o -Wl,--no-as-needed tmpdir/liblto-7.so" "" \
    {dummy.c} "lto-7.exe" "lto-7.out" "" "c"] \
+]
+
+# LTO run-time tests for ELF
+set lto_run_elf_tests [list \
   [list "LTO 8" \
    "-O2 -flto -fuse-linker-plugin tmpdir/lto-8b.o tmpdir/lto-8a.o" "" \
    {dummy.c} "lto-8.exe" "lto-8.out" "" "c"] \
@@ -392,6 +399,10 @@ set lto_run_elf_tests [list \
 
 run_cc_link_tests $lto_link_tests
 
+# These compilation tests generate intermediate object files which will be used
+# by some elf tests besides shared libs tests.  So, always compile them.
+run_cc_link_tests $lto_compile_elf_tests
+
 # Restrict these to ELF targets that support shared libs and PIC.
 if { [is_elf_format] && [check_lto_shared_available] } {
     run_cc_link_tests $lto_link_elf_tests
@@ -487,6 +498,10 @@ if { [is_elf_format] } {
     run_ld_link_exec_tests $lto_run_elf_tests
 }
 
+if { [is_elf_format] && [check_lto_shared_available] } {
+    run_ld_link_exec_tests $lto_run_elf_shared_tests
+}
+
 proc pr20103 {cflags libs} {
     global CC
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]