Go to file
Tom de Vries 2f4132646d [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.
2020-12-14 18:16:40 +01:00
bfd Put bfd_section_from_shdr loop detection array in elf_tdata 2020-12-14 23:36:19 +10:30
binutils Update ELF headers and readelf with recent e_machine assignments. 2020-12-13 15:22:30 -08:00
config
contrib
cpu
elfcpp
etc
gas rx-elf FAIL: SHF_GNU_RETAIN sections 27 2020-12-14 14:05:05 +10:30
gdb [gdb/testsuite] Don't pass -fPIC to gdb_compile_shlib 2020-12-14 18:16:40 +01:00
gdbserver gdbsupport: make use of safe-ctype functions from libiberty 2020-12-11 22:04:28 +00:00
gdbsupport gdbsupport: make use of safe-ctype functions from libiberty 2020-12-11 22:04:28 +00:00
gnulib
gold Re-enable incremental tests that were failing with GCC 9+. 2020-12-13 16:50:52 -08:00
gprof
include Update ELF headers and readelf with recent e_machine assignments. 2020-12-13 15:22:30 -08:00
intl
ld Add a plugin for processing static library dependencies. 2020-12-14 14:26:11 +00:00
libctf libctf: Pass format argument to asprintf 2020-11-25 19:11:36 +00:00
libdecnumber
libiberty
opcodes RISC-V: Add sext.[bh] and zext.[bhw] pseudo instructions. 2020-12-10 10:50:44 +08:00
readline
sim sim/mips/cp1.c: Include <stdlib.h> for abort() declaration 2020-12-14 07:02:05 +04:00
texinfo
zlib
.cvsignore
.gitattributes
.gitignore Add gnu global outputs to .gitignore 2020-12-02 10:00:27 -05:00
ar-lib
ChangeLog Add gnu global outputs to .gitignore 2020-12-02 10:00:27 -05:00
compile
config-ml.in
config.guess
config.rpath
config.sub
configure
configure.ac
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
depcomp
djunpack.bat
install-sh
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
README-maintainer-mode
setup.com
src-release.sh
symlink-tree
test-driver
ylwrap

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.