aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-06-29 11:07:18 +0100
committerSam James <sam@gentoo.org>2024-06-29 17:13:14 +0100
commit17c78a23491ce76fd6d21cdbf2db3c0cf02145e0 (patch)
tree625749ba9328a0a62e6af8c0e6297406cf3c1afb
parent17de5033a28cd04f9e16730b353ad7c08ec5d8c1 (diff)
downloadgdb-17c78a23491ce76fd6d21cdbf2db3c0cf02145e0.zip
gdb-17c78a23491ce76fd6d21cdbf2db3c0cf02145e0.tar.gz
gdb-17c78a23491ce76fd6d21cdbf2db3c0cf02145e0.tar.bz2
ld: pass -g for ld-elf tests
The "DWARF parse during linker error" and "Build warn libbar.so" tests require debug information. configure defaults to "-O2 -g" but if overriding *FLAGS when building tests, this might be lost. Explicitly pass -g given these tests require it. Originally reported downstream in Gentoo at https://bugs.gentoo.org/934149. ld/ * testsuite/ld-elf/dwarf.exp: Pass -g for "DWARF parse during linker error". * testsuite/ld-elf/shared.exp: Ditto for "Build warn libbar.so".
-rw-r--r--ld/testsuite/ld-elf/dwarf.exp2
-rw-r--r--ld/testsuite/ld-elf/shared.exp2
2 files changed, 2 insertions, 2 deletions
diff --git a/ld/testsuite/ld-elf/dwarf.exp b/ld/testsuite/ld-elf/dwarf.exp
index a4748a4..1ca1ec5 100644
--- a/ld/testsuite/ld-elf/dwarf.exp
+++ b/ld/testsuite/ld-elf/dwarf.exp
@@ -50,7 +50,7 @@ set build_tests {
"-s -shared" "-fPIC -g -feliminate-dwarf2-dups"
{dwarf1.c} {} "libdwarf1.so"}
{"DWARF parse during linker error"
- "" "-fno-toplevel-reorder"
+ "" "-g -fno-toplevel-reorder"
{dwarf2a.c dwarf2b.c} {{error_output "dwarf2.err"}} "dwarf2.x"}
}
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index 9e89077..97ca778 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -552,7 +552,7 @@ set build_tests {
"-shared" "-fPIC"
{begin.c end.c} {} "libbar.so"}
{"Build warn libbar.so"
- "-shared" "-fPIC"
+ "-shared" "-fPIC -g"
{beginwarn.c end.c}
{{readelf {-S --wide} libbarw.rd}
{warning {^.*beginwarn.c:7:\(.*\): warning: function foo is deprecated\n?$}}}