]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/build] Fix build breaker with --enable-shared
authorTom de Vries <tdevries@suse.de>
Mon, 27 Jun 2022 13:36:19 +0000 (15:36 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 27 Jun 2022 13:36:19 +0000 (15:36 +0200)
commit95127faf50eef65b381dd1e5eb7c7db43915e54c
tree20e74e8ae477b2f3599e1118f094bd88d67e5508
parent171fba11ab27089cffd6f85655ab987a937fea25
[gdb/build] Fix build breaker with --enable-shared

When building gdb with --enable-shared, I run into:
...
ld: build/zlib/libz.a(libz_a-inffast.o): relocation R_X86_64_32S against \
  `.rodata' can not be used when making a shared object; recompile with -fPIC
ld: build/zlib/libz.a(libz_a-inflate.o): warning: relocation against \
  `inflateResetKeep' in read-only section `.text'
collect2: error: ld returned 1 exit status
make[3]: *** [libbfd.la] Error 1
...

This is a regression since commit a08bdb159bb ("[gdb/build] Fix gdbserver
build with -fsanitize=thread").

The problem is that a single case statement in configure is shared to handle
special requirements for both the host libiberty and host zlib, which has the
effect that only one is handled.

Fix this by handling libiberty and zlib each in its own case statement.

Build on x86_64-linux, with and without --enable-shared.

ChangeLog:

2022-06-27  Tom de Vries  <tdevries@suse.de>

* configure.ac: Set extra_host_libiberty_configure_flags and
extra_host_zlib_configure_flags in separate case statements.
* configure: Regenerate.
configure
configure.ac