Bug 29630 - gdb link fails on hppa
Summary: gdb link fails on hppa
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-28 13:11 UTC by John David Anglin
Modified: 2022-09-28 20:58 UTC (History)
2 users (show)

See Also:
Host: hppa*-*-linux*
Target: hppa*-*-linux*
Build: hppa*-*-linux*
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2022-09-28 13:11:06 UTC
CXXLD  gdb
/usr/bin/ld: linux-tdep.o: in function `linux_corefile_thread(thread_info*, linux_corefile_thread_data*)':
/home/dave/gnu/gdb/objdir/gdb/../../src/gdb/linux-tdep.c:1831: undefined reference to `gcore_elf_build_thread_register_notes(gdbarch*, thread_info*, gdb_signal, bfd*, std::unique_ptr<char, gdb::xfree_deleter<char> >*, int*)'
/usr/bin/ld: linux-tdep.o: in function `linux_make_corefile_notes(gdbarch*, bfd*, int*)':
/home/dave/gnu/gdb/objdir/gdb/../../src/gdb/linux-tdep.c:2117: undefined reference to `gcore_elf_make_tdesc_note(bfd*, std::unique_ptr<char, gdb::xfree_deleter<char> >*, int*)'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:2149: gdb] Error 1

It seems gcore-elf.c is not built.

I see:
checking for ELF support in BFD... none required

configure:17418: checking for ELF support in BFD
configure:17438: gcc -o conftest -I../../src/gdb/../include -I../bfd -I../../src
/gdb/../bfd -g -O2      -L../bfd -L../libiberty -L../zlib -lzstd   conftest.c -l
bfd -liberty -lz  -lncursesw -lm  >&5
/usr/bin/ld: ../bfd/libbfd.a(compress.o): in function `decompress_contents':
/home/dave/gnu/gdb/objdir/bfd/../../src/bfd/compress.c:42: undefined reference t
o `ZSTD_decompress'
/usr/bin/ld: /home/dave/gnu/gdb/objdir/bfd/../../src/bfd/compress.c:44: undefine
d reference to `ZSTD_isError'
/usr/bin/ld: ../bfd/libbfd.a(compress.o): in function `bfd_compress_section_cont
ents':
/home/dave/gnu/gdb/objdir/bfd/../../src/bfd/compress.c:195: undefined reference
to `ZSTD_compress'
/usr/bin/ld: /home/dave/gnu/gdb/objdir/bfd/../../src/bfd/compress.c:198: undefin
ed reference to `ZSTD_isError'
collect2: error: ld returned 1 exit status
configure:17438: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define HAVE_DLFCN_H 1
| #define _FILE_OFFSET_BITS 64
| #define HAVE_CXX11 1
| #define PACKAGE "gdb"
| #define DEBUGDIR "/home/dave/opt/gnu/lib/debug"
| #define DEBUGDIR_RELOCATABLE 1
| #define BINDIR "/home/dave/opt/gnu/bin"
| #define GDB_DATADIR "/home/dave/opt/gnu/share/gdb"
| #define GDB_DATADIR_RELOCATABLE 1
| #define AUTO_LOAD_DIR "$debugdir:$datadir/auto-load"
| #define AUTO_LOAD_SAFE_PATH "$debugdir:$datadir/auto-load"
| #define SIZEOF_VOID_P 4
| #define DEFAULT_BFD_ARCH bfd_hppa_arch
| #define DEFAULT_BFD_VEC hppa_elf32_linux_vec
| #define HAVE_LIBDEBUGINFOD 1
| #define HAVE_MONSTARTUP 1
| #define HAVE__MCLEANUP 1
| #define HAVE__ETEXT 1
| #define HAVE_ETEXT 1
| #define PKGVERSION "(GDB) "
| #define REPORT_BUGS_TO "<https://www.gnu.org/software/gdb/bugs/>"
| #define HAVE_LIBM 1
| #define HAVE_ZSTD 1
| #define HAVE_ICONV 1
| #define ICONV_CONST
| #define SIZEOF_UNSIGNED_LONG_LONG 8
| #define SIZEOF_UNSIGNED_LONG 4
| #define SIZEOF_UNSIGNED___INT128 0
| #define JIT_READER_DIR "/home/dave/opt/gnu/lib/gdb"
| #define JIT_READER_DIR_RELOCATABLE 1
| #define HAVE_LIBEXPAT 1
| #define HAVE_XML_STOPPARSER 1
| #define HAVE_LIBGMP 1
| #define HAVE_LIBMPFR 1
| #define WITH_PYTHON_PATH "/usr"
| #define PYTHON_PATH_RELOCATABLE 0
| #define HAVE_PYTHON 1
| #define WITH_PYTHON_LIBDIR "/usr/lib"
| #define PYTHON_LIBDIR_RELOCATABLE 0
| #define HAVE_SOURCE_HIGHLIGHT 1
| #define STDC_HEADERS 1
| #define HAVE_NLIST_H 1
| #define HAVE_THREAD_DB_H 1
| #define HAVE_SYS_FILE_H 1
| #define HAVE_SYS_IOCTL_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_SYS_RESOURCE_H 1
| #define HAVE_SYS_PTRACE_H 1
| #define HAVE_TERMIOS_H 1
| #define HAVE_SYS_USER_H 1
| #define HAVE_CURSES_H 1
| #define HAVE_NCURSES_H 1
| #define HAVE_NCURSESW_NCURSES_H 1
| #define HAVE_TERM_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_EXECINFO_H 1
| #define HAVE_LONG_LONG 1
| #define SIZEOF_LONG_LONG 8
| #define HAVE_DECL_BASENAME 1
| #define HAVE_DECL_FFS 1
| #define HAVE_DECL_ASPRINTF 1
| #define HAVE_DECL_VASPRINTF 1
| #define HAVE_DECL_SNPRINTF 1
| #define HAVE_DECL_VSNPRINTF 1
| #define HAVE_DECL_STRTOL 1
| #define HAVE_DECL_STRTOUL 1
| #define HAVE_DECL_STRTOLL 1
| #define HAVE_DECL_STRTOULL 1
| #define HAVE_DECL_STRVERSCMP 1
| #define HAVE_DECL_SNPRINTF 1
| #define HAVE_LC_MESSAGES 1
| #define HAVE_SOCKLEN_T 1
| #define WORDS_BIGENDIAN 1
| #define HAVE_GETUID 1
| #define HAVE_GETGID 1
| #define HAVE_PIPE 1
| #define HAVE_PREAD 1
| #define HAVE_PREAD64 1
| #define HAVE_PWRITE 1
| #define HAVE_RESIZE_TERM 1
| #define HAVE_GETPGID 1
| #define HAVE_SETSID 1
| #define HAVE_SIGACTION 1
| #define HAVE_SIGSETMASK 1
| #define HAVE_SOCKETPAIR 1
| #define HAVE_WBORDER 1
| #define HAVE_WRESIZE 1
| #define HAVE_SETLOCALE 1
| #define HAVE_BTOWC 1
| #define HAVE_SETRLIMIT 1
| #define HAVE_GETRLIMIT 1
| #define HAVE_POSIX_MADVISE 1
| #define HAVE_WAITPID 1
| #define HAVE_USE_DEFAULT_COLORS 1
| #define HAVE_LANGINFO_CODESET 1
| #define HAVE_STDLIB_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_PARAM_H 1
| #define STDC_HEADERS 1
| #define HAVE_ALLOCA_H 1
| #define HAVE_ALLOCA 1
| #define HAVE_LANGINFO_CODESET 1
| #define HAVE_LINUX_PERF_EVENT_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_SYS_RESOURCE_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_UN_H 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_THREAD_DB_H 1
| #define HAVE_WAIT_H 1
| #define HAVE_TERMIOS_H 1
| #define HAVE_DLFCN_H 1
| #define HAVE_LINUX_ELF_H 1
| #define HAVE_PROC_SERVICE_H 1
| #define HAVE_POLL_H 1
| #define HAVE_SYS_POLL_H 1
| #define HAVE_SYS_SELECT_H 1
| #define HAVE_GETPAGESIZE 1
| #define HAVE_MMAP 1
| #define HAVE_FORK 1
| #define HAVE_VFORK 1
| #define HAVE_WORKING_VFORK 1
| #define HAVE_WORKING_FORK 1
| #define HAVE_GETRLIMIT 1
| #define HAVE_PIPE 1
| #define HAVE_PIPE2 1
| #define HAVE_POLL 1
| #define HAVE_SOCKETPAIR 1
| #define HAVE_SIGACTION 1
| #define HAVE_SBRK 1
| #define HAVE_SETNS 1
| #define HAVE_SIGALTSTACK 1
| #define HAVE_SIGPROCMASK 1
| #define HAVE_SETPGID 1
| #define HAVE_SETPGRP 1
| #define HAVE_GETRUSAGE 1
| #define HAVE_GETAUXVAL 1
| #define HAVE_SIGTIMEDWAIT 1
| #define HAVE_DECL_ADDR_NO_RANDOMIZE 1
| #define HAVE_DECL_STRSTR 1
| #define HAVE_STRUCT_STAT_ST_BLOCKS 1
| #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
| #define HAVE_PTHREAD_PRIO_INHERIT 1
| #define HAVE_PTHREAD_SIGMASK 1
| #define HAVE_PTHREAD_SETNAME_NP 1
| #define CXX_STD_THREAD 1
| #define HAVE_SIGSETJMP 1
| #define PRINTF_HAS_LONG_LONG 1
| #define _STRUCTURED_PROC 1
| #define HAVE_SYS_PROCFS_H 1
| #define HAVE_PRGREGSET_T 1
| #define HAVE_PRFPREGSET_T 1
| #define HAVE_LWPID_T 1
| #define HAVE_PSADDR_T 1
| #define HAVE_ELF_FPREGSET_T 1
| #define HAVE_SYS_PTRACE_H 1
| #define PTRACE_TYPE_RET long
| #define PTRACE_TYPE_ARG1 enum __ptrace_request
| #define PTRACE_TYPE_ARG3 long
| #define PTRACE_TYPE_ARG4 long
| #define SETPGRP_VOID 1
| #define HAVE_PTRACE_GETREGS 1
| #define HAVE_PTRACE_GETFPXREGS 1
| #define HAVE_LONG_DOUBLE 1
| #define PRINTF_HAS_LONG_DOUBLE 1
| #define SCANF_HAS_LONG_DOUBLE 1
| #define HAVE_EXECINFO_BACKTRACE 1
| #define THREAD_DB_HAS_TD_NOTALLOC 1
| #define THREAD_DB_HAS_TD_VERSION 1
| #define THREAD_DB_HAS_TD_NOTLS 1
| #define GDBINIT ".gdbinit"
| #define GDBEARLYINIT ".gdbearlyinit"
| #define TARGET_SYSTEM_ROOT "/"
| #define TARGET_SYSTEM_ROOT_RELOCATABLE 0
| #define SYSTEM_GDBINIT ""
| #define SYSTEM_GDBINIT_RELOCATABLE 0
| #define SYSTEM_GDBINIT_DIR ""
| #define SYSTEM_GDBINIT_DIR_RELOCATABLE 0
| /* end confdefs.h.  */
| #include <stdlib.h>
|          #include <string.h>
|          #include "bfd.h"
|          #include "elf-bfd.h"
| int
| main ()
| {
| return bfd_get_elf_phdr_upper_bound (NULL);
|
|   ;
|   return 0;
| }
configure:17448: result: no

So, the check seems to fail because of the undefined reference to ZSTD_isError in libbfd.
Comment 2 dave.anglin 2022-09-28 18:33:39 UTC
On 2022-09-28 12:31 p.m., simon.marchi at polymtl dot ca wrote:
> Should be fixed by:
> https://inbox.sourceware.org/gdb-patches/ec44c3f4-efc9-2adc-6fdf-8ca20688c268@palves.net/T/#u
Yes.
Comment 3 Pedro Alves 2022-09-28 19:29:01 UTC
Hi Dave, long time no hear.  Thanks for filing the bug.

I've merged the patch to master now.
Comment 4 dave.anglin 2022-09-28 20:58:01 UTC
On 2022-09-28 3:29 p.m., pedro at palves dot net wrote:
> Hi Dave, long time no hear.  Thanks for filing the bug.
Your welcome 😁