public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* GDB 8.3.1 gdbserver linker error: needs -lrt
@ 2020-01-30 21:23 Paul Smith
  2020-01-30 21:35 ` Simon Marchi
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Smith @ 2020-01-30 21:23 UTC (permalink / raw)
  To: gdb

Hi all;

I was trying to compile the latest GDB for my system and the link of
gdbserver failed:

.../lib64/libstdc++.a(chrono.o):function std::chrono::_V2::system_clock::now(): error: undefined reference to 'clock_gettime'
.../lib64/libstdc++.a(chrono.o):function std::chrono::_V2::steady_clock::now(): error: undefined reference to 'clock_gettime'

As you can see I compile with static libstdc++.  Also, I'm building
against a pretty old version of GNU/Linux with an older GNU libc
(CentOS 6.5 or so).

The problem is that on systems this old you need to add -lrt to the
link line in order to get clock_gettime(), and the configure script
doesn't look for this.

This causes both gdbserver and libinproctrace.so to fail to link,
unless I hack the makefiles.

Gdb itself links properly because I'm linking with lzma and those libs
happen to include -lrt:

  LIBLZMA = .../lib/liblzma.a -lrt


Oddly enough, adding GDBSERVER_LIBS="-ldl -lrt" to the top GDB make
command doesn't work (even for gdbserver: libinproctrace.so has no
equivalent customizable library). I didn't look through the build
system to figure out how my command line overrides are being lost but
that's also something that should be fixed...

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-02-01  3:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-30 21:23 GDB 8.3.1 gdbserver linker error: needs -lrt Paul Smith
2020-01-30 21:35 ` Simon Marchi
2020-01-30 22:17   ` Paul Smith
2020-01-30 22:50     ` Simon Marchi
2020-01-31  7:44       ` Eli Zaretskii
2020-01-31 16:48         ` Paul Smith
2020-01-31 17:17           ` Eli Zaretskii
2020-01-31 17:23             ` Paul Smith
2020-02-01  3:05               ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).