mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 19:09:31 +08:00
Set PLT_CFLAGS to "-fplt" if supported
GCC 6 supports -fno-plt. But some linker tests expect PLT. This patch defines PLT_CFLAGS to "-fplt" if target compiler supports it. * config/default.exp (PLT_CFLAGS): New.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* config/default.exp (PLT_CFLAGS): New.
|
||||||
|
|
||||||
2015-07-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
2015-07-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
||||||
|
|
||||||
PR ld/18705
|
PR ld/18705
|
||||||
|
@ -278,3 +278,38 @@ if ![info exists LD] then {
|
|||||||
if ![info exists LDFLAGS] then {
|
if ![info exists LDFLAGS] then {
|
||||||
set LDFLAGS {}
|
set LDFLAGS {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Set PLT_CFLAGS to "-fplt" if target compiler supports it.
|
||||||
|
|
||||||
|
if { ![info exists PLT_CFLAGS] } then {
|
||||||
|
if { [which $CC] != 0 } {
|
||||||
|
# Check if gcc supports -fplt
|
||||||
|
set flags ""
|
||||||
|
if [board_info [target_info name] exists cflags] {
|
||||||
|
append flags " [board_info [target_info name] cflags]"
|
||||||
|
}
|
||||||
|
if [board_info [target_info name] exists ldflags] {
|
||||||
|
append flags " [board_info [target_info name] ldflags]"
|
||||||
|
}
|
||||||
|
|
||||||
|
set basename "tmpdir/plt[pid]"
|
||||||
|
set src ${basename}.c
|
||||||
|
set output ${basename}.o
|
||||||
|
set f [open $src "w"]
|
||||||
|
puts $f ""
|
||||||
|
close $f
|
||||||
|
remote_download host $src
|
||||||
|
set plt_available [run_host_cmd_yesno "$CC" "$flags -c -fplt $src -o $output"]
|
||||||
|
remote_file host delete $src
|
||||||
|
remote_file host delete $output
|
||||||
|
file delete $src
|
||||||
|
|
||||||
|
if { $plt_available == 1 } then {
|
||||||
|
set PLT_CFLAGS "-fplt"
|
||||||
|
} else {
|
||||||
|
set PLT_CFLAGS ""
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
set PLT_CFLAGS ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user