debug/gdb: properly link with expat

This patch fixes libexpat detection for gdb-native and
gdb-cross static builds.

For gdb-native build configure should not touch system
/usr/{lib,include} directories while looking for libexpat.
To fix this we pass --without-libexpat-prefix flag
to configure script.

For gdb-cross build configure is allowed to investigate
system /usr/{lib,include} directories, but it does not
hurt to disable this behavior. In this case configure
falls back to -lexpat, which works as expected.

For more info:
http://marc.info/?l=gnulib-bug&m=129660262901148&w=2

Signed-off-by: Kirill Smirnov <kirill.k.smirnov@gmail.com>
This commit is contained in:
Kirill Smirnov 2016-09-09 15:13:23 +03:00 committed by Kirill K. Smirnov
parent 3a36f30ad7
commit 5d5465307b

View File

@ -69,11 +69,8 @@ do_debug_gdb_build() {
cross_extra_config=("${extra_config[@]}") cross_extra_config=("${extra_config[@]}")
cross_extra_config+=("--with-expat") cross_extra_config+=("--with-expat")
# NOTE: DO NOT USE --with-libexpat-prefix (until GDB configure is smarter)!!! cross_extra_config+=("--without-libexpat-prefix")
# It conflicts with a static build: GDB's configure script will find the shared
# version of expat and will attempt to link that, despite the -static flag.
# The link will fail, and configure will abort with "expat missing or unusable"
# message.
case "${CT_THREADS}" in case "${CT_THREADS}" in
none) cross_extra_config+=("--disable-threads");; none) cross_extra_config+=("--disable-threads");;
*) cross_extra_config+=("--enable-threads");; *) cross_extra_config+=("--enable-threads");;
@ -173,11 +170,7 @@ do_debug_gdb_build() {
fi fi
native_extra_config+=("--with-expat") native_extra_config+=("--with-expat")
# NOTE: DO NOT USE --with-libexpat-prefix (until GDB configure is smarter)!!! native_extra_config+=("--without-libexpat-prefix")
# It conflicts with a static build: GDB's configure script will find the shared
# version of expat and will attempt to link that, despite the -static flag.
# The link will fail, and configure will abort with "expat missing or unusable"
# message.
CT_DoLog EXTRA "Configuring native gdb" CT_DoLog EXTRA "Configuring native gdb"