diff options
author | Tom de Vries <tdevries@suse.de> | 2020-12-14 18:16:40 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2020-12-14 18:16:40 +0100 |
commit | 2f4132646d8dbf8c1a82d63cacbb36ee46a289bb (patch) | |
tree | 07f08e58b9b458cf56003a2ecc0c50e0d8b5f1f7 /gdb/testsuite/gdb.btrace | |
parent | a6f3c8a1a8353424f00946f073e11c321119a719 (diff) | |
download | gdb-2f4132646d8dbf8c1a82d63cacbb36ee46a289bb.zip gdb-2f4132646d8dbf8c1a82d63cacbb36ee46a289bb.tar.gz gdb-2f4132646d8dbf8c1a82d63cacbb36ee46a289bb.tar.bz2 |
[gdb/testsuite] Don't pass -fPIC to gdb_compile_shlib
When running test-case gdb.base/info-shared.exp, I see in gdb.log:
...
Executing on host: \
gcc ... -fPIC -fpic -c -o info-shared-solib1.c.o info-shared-solib1.c
...
The -fPIC comes from the test-case:
...
if { [gdb_compile_shlib $srcfile_lib1 $binfile_lib1 \
[list additional_flags=-fPIC]] != "" } {
...
but the -fpic, which overrides the -fPIC comes from gdb_compile_shlib.
The proc gdb_compile_shlib adds the -fpic or similar dependent on platform
and compiler. However, in some cases it doesn't add anything, which is
probably why all those test-case pass -fPIC.
Fix this by removing -fPIC from all the calls to gdb_compile_shlib, and
ensuring that gdb_compile_shlib takes care of adding it, if required.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2020-12-14 Tom de Vries <tdevries@suse.de>
* lib/gdb.exp (gdb_compile_shlib): Make sure it's not necessary to
pass -fPIC.
* gdb.ada/catch_ex_std.exp: Don't pass -fPIC to gdb_compile_shlib.
* gdb.base/break-probes.exp: Same.
* gdb.base/ctxobj.exp: Same.
* gdb.base/dso2dso.exp: Same.
* gdb.base/global-var-nested-by-dso.exp: Same.
* gdb.base/info-shared.exp: Same.
* gdb.base/jit-reader-simple.exp: Same.
* gdb.base/print-file-var.exp: Same.
* gdb.base/skip-solib.exp: Same.
* gdb.btrace/dlopen.exp: Same.
Diffstat (limited to 'gdb/testsuite/gdb.btrace')
-rw-r--r-- | gdb/testsuite/gdb.btrace/dlopen.exp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.btrace/dlopen.exp b/gdb/testsuite/gdb.btrace/dlopen.exp index fc910a9..6839b0f 100644 --- a/gdb/testsuite/gdb.btrace/dlopen.exp +++ b/gdb/testsuite/gdb.btrace/dlopen.exp @@ -31,8 +31,7 @@ set basename_lib dlopen-dso set srcfile_lib $srcdir/$subdir/$basename_lib.c set binfile_lib [standard_output_file $basename_lib.so] -if { [gdb_compile_shlib $srcfile_lib $binfile_lib \ - [list additional_flags=-fPIC]] != "" } { +if { [gdb_compile_shlib $srcfile_lib $binfile_lib {}] != "" } { untested "failed to prepare shlib" return -1 } |