[binutils-gdb] [PR gdb/23985] Fix libinproctrace.so build
Szabolcs Nagy
nsz@sourceware.org
Wed Jan 30 18:04:00 GMT 2019
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=956cc47c5614b0d50bf538e3dcc88c81560fa64c
commit 956cc47c5614b0d50bf538e3dcc88c81560fa64c
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Fri Dec 14 14:02:54 2018 +0000
[PR gdb/23985] Fix libinproctrace.so build
The IPA objects currently may use gnulib replacement apis, which is
wrong: gnulib is not linked into the produced dso and it cannot be
because it is not built with -fPIC -fvisibility=hidden.
The gnulib replacement detection is broken under cross compilation:
for targets other than *-gnu*, replacements are enabled that depend
on execution time detection. This causes unnecessary build failure
when the target has proper support for the replaced api.
This fix tries to undo the replacements, which is tricky because the
gnulib headers are still used for various compile time fixups and
there is no simple knob in gnulib to only turn the replacements off.
Without this workaround gdb fails to cross build to non-gnu targets:
ld: tracepoint-ipa.o: in function `gdb_agent_helper_thread(void*)':
gdb/gdbserver/tracepoint.c:7221: undefined reference to `rpl_strerror'
...
Makefile:434: recipe for target 'libinproctrace.so' failed
gdb/gdbserver/ChangeLog:
PR gdb/23985
* Makefile.in (IPAGENT_CFLAGS): Add UNDO_GNULIB_CFLAGS.
(UNDO_GNULIB_CFLAGS): Undo gnulib replacements.
Diff:
---
gdb/gdbserver/ChangeLog | 6 ++++++
gdb/gdbserver/Makefile.in | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index a244c4f..be9a263 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,9 @@
+2018-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ PR gdb/23985
+ * Makefile.in (IPAGENT_CFLAGS): Add UNDO_GNULIB_CFLAGS.
+ (UNDO_GNULIB_CFLAGS): Undo gnulib replacements.
+
2019-01-25 Tom Tromey <tom@tromey.com>
* Makefile.in (INCLUDE_CFLAGS): Don't add -I for common.
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 8cffe3dd..f5fc550 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -544,9 +544,15 @@ regdat_sh = $(srcdir)/../regformats/regdat.sh
UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
+# Undo gnulib replacements for the IPA shared library build.
+# The gnulib headers are still needed, but gnulib is not linked
+# into the IPA lib so replacement apis don't work.
+UNDO_GNULIB_CFLAGS = -Drpl_strerror=strerror
+
# Note, we only build the IPA if -fvisibility=hidden is supported in
# the first place.
IPAGENT_CFLAGS = $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
+ $(UNDO_GNULIB_CFLAGS) \
-fPIC -DIN_PROCESS_AGENT \
-fvisibility=hidden
More information about the Gdb-cvs
mailing list