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]

Re: Enable shared lib tests for frv, lm32, m32r, microblaze, nds32 and or1k


Hi Alan,

On 07/12/17 09:50, Alan Modra wrote:
On Wed, Dec 06, 2017 at 10:04:37AM +0000, Nick Clifton wrote:
> Hi Alan,
>
> > +   * testsuite/lib/ld-lib.exp (check_shared_lib_support): Return true
> > +   for frv, lm32, m32r, microblaze, nds32 and or1k linux targets.
>
> > -    && ![istarget lm32-*-*]
> > +    && ![istarget lm32-*-elf]
>
> This introduced a whole slew of new failures when I tested a lm32-rtems4.10
> toolchain so I have checked in a little fix for this target:
>
> Cheers
>   Nick
>
> ld/ChangeLog
> 2017-12-06  Nick Clifton  <nickc@redhat.com>
>
>        * testsuite/lib/ld-lib.exp (check_shared_lib_support): Return
>        false for lm32-rtems targets.

Yes, I looked at that function and noticed it wasn't really doing the
right thing.  I should have been a little less lazy and rewritten it.

        * testsuite/lib/ld-lib.exp (check_shared_lib_support): Ask ld
        under test whether -shared is supported.

diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 280a7b1..f960824 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1782,61 +1782,20 @@ proc check_gc_sections_available { } {
 }

 # Returns true if -shared is supported on the target
-# Only used and accurate for ELF targets at the moment

 proc check_shared_lib_support { } {
-    if {![istarget aarch64*-*-elf]
-        && ![istarget arc*-*-elf*]
-        && ![istarget arm*-*-elf]
-        && ![istarget avr-*-*]
-        && ![istarget cr16-*-*]
-        && ![istarget cris*-*-elf]
-        && ![istarget crx-*-*]
-        && ![istarget d10v-*-*]
-        && ![istarget d30v-*-*]
-        && ![istarget dlx-*-*]
-        && ![istarget epiphany-*-*]
-        && ![istarget fr30-*-*]
-        && ![istarget frv-*-elf]
-        && ![istarget ft32-*-*]
-        && ![istarget h8300-*-*]
-        && ![istarget i860-*-*]
-        && ![istarget i960-*-*]
-        && ![istarget ip2k-*-*]
-        && ![istarget iq2000-*-*]
-        && ![istarget lm32-*-elf]
-        && ![istarget lm32-*-rtems*]
-        && ![istarget m32c-*-*]
-        && ![istarget m32r-*-elf]
-        && ![istarget m6811-*-*]
-        && ![istarget m6812-*-*]
-        && ![istarget m68hc1*-*-*]
-        && ![istarget mcore*-*-*]
-        && ![istarget mep-*-*]
-        && ![istarget microblaze-*-elf]
-        && ![istarget mips*-*-elf]
-        && ![istarget mn10200-*-*]
-        && ![istarget moxie-*-*]
-        && ![istarget msp430-*-*]
-        && ![istarget mt-*-*]
-        && ![istarget nds32*-*-elf]
-        && ![istarget nios2-*-elf]
-        && ![istarget or1k*-*-elf]
-        && ![istarget pj-*-*]
-        && ![istarget pru-*-*]
-        && ![istarget rl78-*-*]
-        && ![istarget rx-*-*]
-        && ![istarget spu-*-*]
-        && ![istarget v850*-*-*]
-        && ![istarget visium-*-*]
-        && ![istarget xc16x-*-elf]
-        && ![istarget xgate-*-*]
-        && ![istarget xstormy16-*-*]
-        && ![istarget *-*-irix*]
-        && ![istarget *-*-rtems] } {
-       return 1
+    global shared_available_saved
+    global ld
+
+    if {![info exists shared_available_saved]} {
+       set ld_output [remote_exec host $ld "-shared"]
+       if { [ string first "not supported" $ld_output ] >= 0 } {
+           set shared_available_saved 0
+       } else {
+           set shared_available_saved 1
+       }
     }
-    return 0
+    return $shared_available_saved
 }

 # Return true if target uses genelf.em (assuming it is ELF).


I'm seeing 202 unexpected failures on aarch64-none-elf with this patch.
With errors telling me to recompile with -fPIC or
"newlib/libgloss/aarch64/syscalls.c:639:(.text._sbrk+0x6c): dangerous relocation: unsupported relocation"
Should the tests perhaps be skipped on a bare-metal target?

Thanks,
Kyrill

--
Alan Modra
Australia Development Lab, IBM


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