set board_cflags ""
}
+if [board_info [target_info name] exists ldflags] {
+ set board_ldflags " [board_info [target_info name] ldflags]"
+} else {
+ set board_ldflags ""
+}
+
# Create executable containing unique symbol.
-if ![ld_link "$CC_FOR_TARGET $NOPIE_LDFLAGS $board_cflags" "tmpdir/unique_prog" "tmpdir/unique.o"] {
+if ![ld_link "$CC_FOR_TARGET $NOPIE_LDFLAGS $board_cflags $board_ldflags" "tmpdir/unique_prog" "tmpdir/unique.o"] {
fail "Could not link a unique executable"
set fails [expr $fails + 1]
}
global errcnt
global exec_output
global board_cflags
+ global board_ldflags
global STATIC_LDFLAGS
# When using GCC as the linker driver, we need to specify board cflags when
set board_cflags ""
}
+ if [board_info [target_info name] exists ldflags] {
+ set board_ldflags " [board_info [target_info name] ldflags]"
+ } else {
+ set board_ldflags ""
+ }
+
foreach testitem $ldtests {
set testname [lindex $testitem 0]
set ld_options [lindex $testitem 1]
continue;
} else {
if { [string match "" $STATIC_LDFLAGS] \
- && [regexp -- ".* \[-\]+static .*" " $board_cflags $ld_options $objfiles $ld_after "] } {
+ && [regexp -- ".* \[-\]+static .*" " $board_cflags $board_ldflags $ld_options $objfiles $ld_after "] } {
untested $testname
continue
}
- if ![$link_proc $link_cmd $binfile "$board_cflags -L$srcdir/$subdir $ld_options $objfiles $ld_after"] {
+ if ![$link_proc $link_cmd $binfile "$board_cflags $board_ldflags -L$srcdir/$subdir $ld_options $objfiles $ld_after"] {
set failed 1
}
}
global ar
global exec_output
global board_cflags
+ global board_ldflags
global STATIC_LDFLAGS
if [board_info [target_info name] exists cflags] {
set board_cflags ""
}
+ if [board_info [target_info name] exists ldflags] {
+ set board_ldflags " [board_info [target_info name] ldflags]"
+ } else {
+ set board_ldflags ""
+ }
+
foreach testitem $ldtests {
set testname [lindex $testitem 0]
set ldflags [lindex $testitem 1]
}
} else {
if { [string match "" $STATIC_LDFLAGS] \
- && [regexp -- ".* \[-\]+static .*" " $board_cflags $ldflags $objfiles "] } {
+ && [regexp -- ".* \[-\]+static .*" " $board_cflags $board_ldflags $ldflags $objfiles "] } {
untested $testname
continue
}
- ld_link $cc_cmd $binfile "$board_cflags -L$srcdir/$subdir $ldflags $objfiles"
+ ld_link $cc_cmd $binfile "$board_cflags $board_ldflags -L$srcdir/$subdir $ldflags $objfiles"
set ld_output "$exec_output"
if { $check_ld(source) == "regexp" } then {