* [Bug compile/30295] Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool
2023-03-31 6:04 [Bug compile/30295] New: Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool orbea at riseup dot net
@ 2023-03-31 6:06 ` orbea at riseup dot net
2023-03-31 14:05 ` [Bug build/30295] " tromey at sourceware dot org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: orbea at riseup dot net @ 2023-03-31 6:06 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=30295
--- Comment #1 from orbea <orbea at riseup dot net> ---
Created attachment 14793
--> https://sourceware.org/bugzilla/attachment.cgi?id=14793&action=edit
Build log
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/30295] Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool
2023-03-31 6:04 [Bug compile/30295] New: Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool orbea at riseup dot net
2023-03-31 6:06 ` [Bug compile/30295] " orbea at riseup dot net
@ 2023-03-31 14:05 ` tromey at sourceware dot org
2023-03-31 14:17 ` tromey at sourceware dot org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2023-03-31 14:05 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=30295
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|compile |build
CC| |tromey at sourceware dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/30295] Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool
2023-03-31 6:04 [Bug compile/30295] New: Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool orbea at riseup dot net
2023-03-31 6:06 ` [Bug compile/30295] " orbea at riseup dot net
2023-03-31 14:05 ` [Bug build/30295] " tromey at sourceware dot org
@ 2023-03-31 14:17 ` tromey at sourceware dot org
2023-03-31 15:42 ` orbea at riseup dot net
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2023-03-31 14:17 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=30295
--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
The problem here is that gcore-elf depends on ELF-specific code in BFD.
If that code is not compiled in, then gcore-elf.o would end up causing
a link failure (I think).
gdb/configure.ac has:
# Add ELF support to GDB, but only if BFD includes ELF support.
GDB_AC_CHECK_BFD([for ELF support in BFD], gdb_cv_var_elf,
[bfd_get_elf_phdr_upper_bound (NULL)], elf-bfd.h)
if test "$gdb_cv_var_elf" = yes; then
CONFIG_OBS="$CONFIG_OBS elfread.o stap-probe.o dtrace-probe.o \
gcore-elf.o elf-none-tdep.o"
So I think the question is why is that failing.
You could start by looking at the gdb config.log, but it may
just lead to the BFD config.log.
Also I suspect that fbsd-tdep.c and linux-tdep.c might need
some tweaks to check HAVE_ELF. I see this in some other tdep files.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/30295] Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool
2023-03-31 6:04 [Bug compile/30295] New: Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool orbea at riseup dot net
` (2 preceding siblings ...)
2023-03-31 14:17 ` tromey at sourceware dot org
@ 2023-03-31 15:42 ` orbea at riseup dot net
2023-03-31 17:15 ` orbea at riseup dot net
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: orbea at riseup dot net @ 2023-03-31 15:42 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=30295
--- Comment #3 from orbea <orbea at riseup dot net> ---
Created attachment 14794
--> https://sourceware.org/bugzilla/attachment.cgi?id=14794&action=edit
gdb/config.log
Okay I see the real problem in gdb/config.log.
configure:28213: checking for ELF support in BFD
configure:28233: ./libtool --quiet --mode=link x86_64-gentoo-linux-musl-gcc -o
conftest -I./../include -I../bfd -I./../bfd -O2 -pipe
-Werror=implicit-function-declaration -Werror=implicit-int -L../bfd
-L../libiberty -Wl,-O1 -Wl,--as-needed conftest.c -lbfd -liberty -ltinfow
-lncursesw -lm >&5
/usr/lib/gcc/x86_64-gentoo-linux-musl/12/../../../../x86_64-gentoo-linux-musl/bin/ld:
cannot find
/var/tmp/portage/sys-devel/gdb-9999/work/gdb-9999/bfd/.libs/libbfd.so: No such
file or directory
collect2: error: ld returned 1 exit status
It is using './libtool' when it should be using 'rlibtool' which is the
intended slibtool symlink. Mixing libtool implementations is not going to work.
Presumably this is from gdb/acinclude.m4 which sets:
CC="./libtool --quiet --mode=link $CC"
This problem seems to be repeated in libctf/configure.ac and
libctf/testsuite/lib/ctf-lib.exp. Is it required to use libtool as part of the
configure process here? Otherwise perhaps it can be set to the $LIBTOOL
variable?
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/30295] Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool
2023-03-31 6:04 [Bug compile/30295] New: Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool orbea at riseup dot net
` (3 preceding siblings ...)
2023-03-31 15:42 ` orbea at riseup dot net
@ 2023-03-31 17:15 ` orbea at riseup dot net
2023-04-21 18:16 ` orbea at riseup dot net
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: orbea at riseup dot net @ 2023-03-31 17:15 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=30295
--- Comment #4 from orbea <orbea at riseup dot net> ---
Created attachment 14796
--> https://sourceware.org/bugzilla/attachment.cgi?id=14796&action=edit
Build fix patch (Attempt 2)
As a test I removed both of the overridden CC variables from gdb/configure:
CC="./libtool --quiet --mode=link $CC"
Which allows the configure test and build to succeed with both GNU libtool and
slibtool on my system. I am unsure if there is some edge case this would
expose?
I also tried removing it from gdb/acinclude.m4, but it is difficult to test
with autoconf-2.71 which Gentoo provides rather than autoconf-2.69 which GDB
seems to depend on. Regardless I attached a potential patch.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/30295] Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool
2023-03-31 6:04 [Bug compile/30295] New: Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool orbea at riseup dot net
` (4 preceding siblings ...)
2023-03-31 17:15 ` orbea at riseup dot net
@ 2023-04-21 18:16 ` orbea at riseup dot net
2023-08-28 13:53 ` tromey at sourceware dot org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: orbea at riseup dot net @ 2023-04-21 18:16 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=30295
--- Comment #5 from orbea <orbea at riseup dot net> ---
Created attachment 14844
--> https://sourceware.org/bugzilla/attachment.cgi?id=14844&action=edit
Build fix patch (Attempt 3)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/30295] Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool
2023-03-31 6:04 [Bug compile/30295] New: Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool orbea at riseup dot net
` (5 preceding siblings ...)
2023-04-21 18:16 ` orbea at riseup dot net
@ 2023-08-28 13:53 ` tromey at sourceware dot org
2024-02-16 17:20 ` tromey at sourceware dot org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2023-08-28 13:53 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=30295
--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
Hi. Thanks for the patch. gdb doesn't really deal
with patches in bugzilla; instead please see the
contribution checklist:
https://sourceware.org/gdb/wiki/ContributionChecklist
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/30295] Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool
2023-03-31 6:04 [Bug compile/30295] New: Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool orbea at riseup dot net
` (6 preceding siblings ...)
2023-08-28 13:53 ` tromey at sourceware dot org
@ 2024-02-16 17:20 ` tromey at sourceware dot org
2024-02-16 17:29 ` orbea at riseup dot net
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2024-02-16 17:20 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=30295
--- Comment #7 from Tom Tromey <tromey at sourceware dot org> ---
*** Bug 31392 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/30295] Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool
2023-03-31 6:04 [Bug compile/30295] New: Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool orbea at riseup dot net
` (7 preceding siblings ...)
2024-02-16 17:20 ` tromey at sourceware dot org
@ 2024-02-16 17:29 ` orbea at riseup dot net
2024-02-20 18:14 ` tromey at sourceware dot org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: orbea at riseup dot net @ 2024-02-16 17:29 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=30295
--- Comment #8 from orbea <orbea at riseup dot net> ---
I am not sure the current patches are fully applicable anymore, as seen in the
duplicate issue with a more thorough description it needs some way to know the
bfd dependencies such as -lz which are listed in the .la file.
Additionally as suggested I sent the patches to the ML without much follow
through from the reviewer.
Any advice on how to best solve this?
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/30295] Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool
2023-03-31 6:04 [Bug compile/30295] New: Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool orbea at riseup dot net
` (8 preceding siblings ...)
2024-02-16 17:29 ` orbea at riseup dot net
@ 2024-02-20 18:14 ` tromey at sourceware dot org
2024-02-21 0:54 ` orbea at riseup dot net
2024-04-07 18:33 ` orbea at riseup dot net
11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2024-02-20 18:14 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=30295
--- Comment #9 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to orbea from comment #8)
> Additionally as suggested I sent the patches to the ML without much follow
> through from the reviewer.
Sorry about that.
Unfortunately for gdb you often have to "ping" patches.
>
> Any advice on how to best solve this?
From what I can see, there's no real reason for GDB_AC_CHECK_BFD
to be doing a link check at all.
I wonder if changing this to do a compile check would help.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/30295] Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool
2023-03-31 6:04 [Bug compile/30295] New: Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool orbea at riseup dot net
` (9 preceding siblings ...)
2024-02-20 18:14 ` tromey at sourceware dot org
@ 2024-02-21 0:54 ` orbea at riseup dot net
2024-04-07 18:33 ` orbea at riseup dot net
11 siblings, 0 replies; 13+ messages in thread
From: orbea at riseup dot net @ 2024-02-21 0:54 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=30295
--- Comment #10 from orbea <orbea at riseup dot net> ---
> From what I can see, there's no real reason for GDB_AC_CHECK_BFD
> to be doing a link check at all.
> I wonder if changing this to do a compile check would help.
This seems like a good idea, but when I tried it it results in undefined
references to 'bfd_mach_o_lookup_command' since both the ELF and MACH-O tests
now pass.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/30295] Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool
2023-03-31 6:04 [Bug compile/30295] New: Undefined reference for gcore_elf_make_tdesc_note in linux-tdep with slibtool orbea at riseup dot net
` (10 preceding siblings ...)
2024-02-21 0:54 ` orbea at riseup dot net
@ 2024-04-07 18:33 ` orbea at riseup dot net
11 siblings, 0 replies; 13+ messages in thread
From: orbea at riseup dot net @ 2024-04-07 18:33 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=30295
--- Comment #11 from orbea <orbea at riseup dot net> ---
With the current slibtool git repo slibtoolize now exists and can be used
instead of GNU libtoolize. Additionally when using autoreconf it respects
LT_OUTPUT which allows the current gdb check to just work.
However using autoreconf for gdb is far from trivial and I was only able to
test it by hacking autoregen.py to have '-I /usr/share/slibtool' for the
appropriate autotools commands which would not be applicable for any system
that replaces libtool.m4 with a symlink to slibtool.m4.
Normally this can be achieved with:
export ACLOCAL='aclocal -I /usr/share/slibtool'
export LIBTOOLIZE='slibtoolize'
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread