]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Re: ld: Skip the LTO archive member only for the earlier DSO
authorAlan Modra <amodra@gmail.com>
Mon, 14 Apr 2025 00:33:22 +0000 (10:03 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 14 Apr 2025 21:29:15 +0000 (06:59 +0930)
Add -fPIC when compiling the test, to fix complaints on some targets
about certains relocation not being valid for shared libraries.

ld/testsuite/ld-plugin/lto.exp

index 726dd9333292a7bbced64e0122c79ac6c81fbfd1..3a56fb57545678a86fb15bc395418976381ec20f 100644 (file)
@@ -1215,24 +1215,24 @@ if { [is_elf_format] && [check_lto_shared_available] } {
     if { [check_lto_fat_available] } {
        run_cc_link_tests [list \
            [list \
-               "Build libpr32846a.a" \
-               "$plug_opt" "-O2 -flto $lto_no_fat" \
-               {pr32846a.c pr32846b.c} {} "libpr32846a.a" \
+               "Build libpr32846a.a" \
+               "$plug_opt" "-fPIC -O2 -flto $lto_no_fat" \
+               {pr32846a.c pr32846b.c} {} "libpr32846a.a" \
            ] \
            [list \
                "Build libpr32846b.a" \
-               "$plug_opt" "-O2 -flto $lto_no_fat" \
+               "$plug_opt" "-fPIC -O2 -flto $lto_no_fat" \
                {pr32846a.c pr32846b.c pr32846c.c} {} "libpr32846b.a" \
            ] \
            [list \
-               "Build pr32846d.o" \
-               "$plug_opt" "-O2 -flto $lto_no_fat" \
-               {pr32846d.c} {} \
+               "Build pr32846d.o" \
+               "$plug_opt" "-fPIC -O2 -flto $lto_no_fat" \
+               {pr32846d.c} {} \
            ] \
            [list \
-               "Build pr32846e.o" \
-               "$plug_opt" "-O2 -flto $lto_no_fat" \
-               {pr32846e.c} {} \
+               "Build pr32846e.o" \
+               "$plug_opt" "-fPIC -O2 -flto $lto_no_fat" \
+               {pr32846e.c} {} \
            ] \
            [list \
                "Build pr32846" \