diff options
author | Andrew Burgess <aburgess@redhat.com> | 2024-05-14 11:29:49 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2024-05-14 16:51:50 +0100 |
commit | c2b915e2a5cdb2ef79124e1a558f67959c78cc62 (patch) | |
tree | fdd1516d9578b32203e9dbdd8215be2ddf29f5eb /gdb/reverse.c | |
parent | 4ac16d6607c045d2c4fa4b3712eb8f617af09e1b (diff) | |
download | gdb-c2b915e2a5cdb2ef79124e1a558f67959c78cc62.zip gdb-c2b915e2a5cdb2ef79124e1a558f67959c78cc62.tar.gz gdb-c2b915e2a5cdb2ef79124e1a558f67959c78cc62.tar.bz2 |
gdb/testsuite: remove unnecessary -Wl,-soname,NAME build flags
While working on another patch I needed to pass -Wl,-soname,NAME as a
compiler flag. I initially looked for other tests that did this, and
found a few examples, so I copied what they did.
But when I checked the gdb.log file I noticed that we were actually
getting -Wl,-soname passed twice.
I tracked the repeated option to 'proc gdb_compile_shlib_1' in
lib/gdb.exp. It turns out that we always add -Wl,-soname when
compiling a shared library.
Here's an example of a build command from gdb.base/prelink.exp:
builtin_spawn -ignore SIGHUP gcc -fno-stack-protector \
/tmp/build/gdb/testsuite/outputs/gdb.base/prelink/prelink-lib.c.o \
-fdiagnostics-color=never -shared -g \
-Wl,-soname,prelink.so -Wl,-soname,prelink.so -lm \
-o /tmp/build/gdb/testsuite/outputs/gdb.base/prelink/prelink.so
Notice that '-Wl,-soname,prelink.so' is repeated.
I believe that all of the places where tests add '-Wl,-soname,NAME' as
a build option, are unnecessary.
In this commit I propose we remove them all.
As part of this change I've switched from calling gdb_compile_shlib
directly, to instead call build_executable and adding the 'shlib'
flag.
I've tested with gcc and clang and see no changes in the test results
after this commit. All the compile commands still have -Wl,-soname
added, but now it's only added once, from within lib/gdb.exp.
There should be no change in what is tested after this commit.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/reverse.c')
0 files changed, 0 insertions, 0 deletions