debug
optimize=-O2
additional_flags=-ffunction-sections
- additional_flags=-largs
- additional_flags=-Wl,--gc-sections
- additional_flags=-margs
+ ldflags=-largs
+ ldflags=-Wl,--gc-sections
+ ldflags=-margs
additional_flags=-gnatn
}
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $options] != ""} {
standard_testfile .cc
if {[build_executable_from_specs $testfile.exp $testfile \
- {c++ additional_flags=-Wl,--gc-sections} \
+ {c++ ldflags=-Wl,--gc-sections} \
$srcfile {debug c++ additional_flags=-ffunction-sections}]} {
untested "failed to compile"
return -1
set opts [list debug]
lappend opts "additional_flags=-ffunction-sections"
lappend opts "additional_flags=-fdata-sections"
-lappend opts "additional_flags=-Wl,-gc-sections"
-lappend opts "additional_flags=-Wl,-e,main"
+lappend opts "ldflags=-Wl,-gc-sections"
+lappend opts "ldflags=-Wl,-e,main"
# Place variables in .data instead of .sdata.
if {[istarget "riscv*-*-*"]} {
if [istarget "alpha*-*-*"] then {
# SREC etc cannot handle 64-bit addresses. Force the test
# program into the low 31 bits of the address space.
- lappend options "additional_flags=-Wl,-taso"
+ lappend options "ldflags=-Wl,-taso"
}
# Runs the command 'print zero_all ()'. Uses the PRINT_ZERO_ALL_COUNT
untested "failed to compile"
return -1
}
- set opts [list debug shlib=${binfile_lib} additional_flags=-Wl,-z,relro]
+ set opts [list debug shlib=${binfile_lib} ldflags=-Wl,-z,relro]
if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
unsupported "-Wl,-z,relro compilation failed"
return -1
set final_opts {}
# Force lazy binding so we don't resolve everything at process startup.
- lappend exec_opts "additional_flags=-Wl,-z,lazy"
- lappend lib_opts "additional_flags=-Wl,-z,lazy"
+ lappend exec_opts "ldflags=-Wl,-z,lazy"
+ lappend lib_opts "ldflags=-Wl,-z,lazy"
if {$resolver_attr} {
lappend lib_opts "additional_flags=-DIFUNC_RESOLVER_ATTR"
if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" \
{debug c++ additional_flags=-fuse-ld=gold \
- additional_flags=-Wl,--gdb-index \
+ ldflags=-Wl,--gdb-index \
additional_flags=-ggnu-pubnames}]} {
return -1
}
standard_testfile
if { [build_executable "failed to prepare" $testfile $srcfile \
- {debug additional_flags=-Wl,--build-id}] } {
+ {debug ldflags=-Wl,--build-id}] } {
return
}
set opts {}
lappend opts debug
-lappend opts "additional_flags=-nostdlib -emain -Wl,-Ttext=0x00 -Wl,-N"
+lappend opts "ldflags=-nostdlib -emain -Wl,-Ttext=0x00 -Wl,-N"
-set ld_flags additional_flags=-Wl,--no-warn-rwx-segments
+set ld_flags ldflags=-Wl,--no-warn-rwx-segments
if { [gdb_can_simple_compile ld-flags {int main () { return 0; }} executable \
$ld_flags] } {
lappend opts $ld_flags
lappend flags debug
lappend flags additional_flags=-std=gnu99
-set ld_flags additional_flags=-Wl,--no-warn-execstack
+set ld_flags ldflags=-Wl,--no-warn-execstack
if { [gdb_can_simple_compile ld-flags {int main () { return 0; }} executable \
$ld_flags] } {
lappend flags $ld_flags
lappend flags debug
lappend flags additional_flags=-std=gnu99
-set ld_flags additional_flags=-Wl,--no-warn-execstack
+set ld_flags ldflags=-Wl,--no-warn-execstack
if { [gdb_can_simple_compile ld-flags {int main () { return 0; }} executable \
$ld_flags] } {
lappend flags $ld_flags
if {[gdb_compile "${binfile_main}.o" "${binfile_main}" executable \
[list debug "additional_flags=-L$testobjdir" \
"additional_flags=-l${test}" \
- "additional_flags=-Wl,-rpath=$testobjdir"]] != ""} {
+ "ldflags=-Wl,-rpath=$testobjdir"]] != ""} {
return -1
}
standard_testfile
if { [build_executable "failed to prepare" $testfile $srcfile \
- {debug additional_flags=-Wl,--build-id}] == -1 } {
+ {debug ldflags=-Wl,--build-id}] == -1 } {
return
}
# invalid core file.
if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable \
- [concat $exec_opts additional_flags=-Wl,-z,norelro]] != ""
+ [concat $exec_opts ldflags=-Wl,-z,norelro]] != ""
&& [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable $exec_opts] != "" } {
untested "failed to compile"
return -1
set opts [list debug]
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${objfile}" object $opts] != ""
- || ([gdb_compile_pthreads "${objfile}" "${binfile}" executable [concat $opts {additional_flags=-Wl,-z,norelro}] ] != ""
+ || ([gdb_compile_pthreads "${objfile}" "${binfile}" executable [concat $opts {ldflags=-Wl,-z,norelro}] ] != ""
&& [gdb_compile_pthreads "${objfile}" "${binfile}" executable $opts] != "") } {
return -1
}
set shlib_found 1
if { ([istarget "*-*-mingw*"]
|| [istarget *-*-cygwin*]) } {
- lappend new_options "additional_flags=-Wl,--enable-auto-import"
+ lappend new_options "ldflags=-Wl,--enable-auto-import"
}
if { [test_compiler_info "gcc-*"] || [test_compiler_info "clang-*"] } {
# Undo debian's change in the default.
} else {
set name ${dest}
}
- lappend link_options "additional_flags=-Wl,--out-implib,${name}.a"
+ lappend link_options "ldflags=-Wl,--out-implib,${name}.a"
} else {
# Set the soname of the library. This causes the linker on ELF
# systems to create the DT_NEEDED entry in the executable referring
# rpath=$ORIGIN value when building the executable, so that it's
# able to find the library in its own directory.
set destbase [file tail $dest]
- lappend link_options "additional_flags=-Wl,-soname,$destbase"
+ lappend link_options "ldflags=-Wl,-soname,$destbase"
}
}
if {[gdb_compile "${objects}" "${dest}" executable $link_options] != ""} {
# Return 1 if linker supports -Ttext-segment, otherwise return 0.
gdb_caching_proc linker_supports_Ttext_segment_flag {
set me "linker_supports_Ttext_segment_flag"
- set flags additional_flags="-Wl,-Ttext-segment=0x7000000"
+ set flags ldflags="-Wl,-Ttext-segment=0x7000000"
set src { int main() { return 0; } }
return [gdb_simple_compile $me $src executable $flags]
}
# Return 1 if linker supports -Ttext, otherwise return 0.
gdb_caching_proc linker_supports_Ttext_flag {
set me "linker_supports_Ttext_flag"
- set flags additional_flags="-Wl,-Ttext=0x7000000"
+ set flags ldflags="-Wl,-Ttext=0x7000000"
set src { int main() { return 0; } }
return [gdb_simple_compile $me $src executable $flags]
}
# Return 1 if linker supports --image-base, otherwise 0.
gdb_caching_proc linker_supports_image_base_flag {
set me "linker_supports_image_base_flag"
- set flags additional_flags="-Wl,--image-base=0x7000000"
+ set flags ldflags="-Wl,--image-base=0x7000000"
set src { int main() { return 0; } }
return [gdb_simple_compile $me $src executable $flags]
}