global OBJDUMPFLAGS NMFLAGS ASFLAGS OBJCOPYFLAGS READELFFLAGS LDFLAGS
global host_triplet runtests
global env verbose
+ global ld_elf_shared_opt
+
+ if { [is_elf_format] && [check_shared_lib_support] } {
+ set ld_extra_opt "$ld_elf_shared_opt"
+ } else {
+ set ld_extra_opt ""
+ }
if [string match "*/*" $name] {
set file $name
# Add -L$srcdir/$subdir so that the linker command can use
# linker scripts in the source directory.
- set cmd "$LD $LDFLAGS -L$srcdir/$subdir \
+ set cmd "$LD $ld_extra_opt $LDFLAGS -L$srcdir/$subdir \
$opts(ld) -o $objfile $objfiles $opts(ld_after_inputfiles)"
# If needed then check for, or add a -Map option.
global CFLAGS
global runtests
global exec_output
+ global ld_elf_shared_opt
+
+ if { [is_elf_format] && [check_shared_lib_support] } {
+ set ld_extra_opt "$ld_elf_shared_opt"
+ } else {
+ set ld_extra_opt ""
+ }
foreach testitem $ldtests {
set testname [lindex $testitem 0]
if { ![ar_simple_create $ar $ld_options $binfile "$objfiles $ld_after"] } {
set failed 1
}
- } elseif { ![ld_simple_link $ld $binfile "-L$srcdir/$subdir $ld_options $objfiles $ld_after"] } {
+ } elseif { ![ld_simple_link $ld $binfile "$ld_extra_opt -L$srcdir/$subdir $ld_options $objfiles $ld_after"] } {
set maybe_failed 1
set ld_output "$exec_output"
}