From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10213 invoked by alias); 1 Feb 2020 03:05:13 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 10202 invoked by uid 89); 1 Feb 2020 03:05:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=H*f:sk:e0a028f, H*i:sk:e0a028f, H*MI:sk:e0a028f, gdbserver's X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 01 Feb 2020 03:05:10 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 46D341E059; Fri, 31 Jan 2020 22:05:08 -0500 (EST) Subject: Re: GDB 8.3.1 gdbserver linker error: needs -lrt To: psmith@gnu.org, Eli Zaretskii Cc: gdb@sourceware.org References: <06b764efa74573c9422da526f9d92aa2d9440e73.camel@gnu.org> <49c1cc4a-fe1b-8e35-b16b-76d9faec2173@simark.ca> <831rrgm5o8.fsf@gnu.org> <2820a9d3d0c191d64f24565d583508db9c1b067f.camel@gnu.org> <83r1zfk0kf.fsf@gnu.org> From: Simon Marchi Message-ID: <67612a6c-8410-b089-d22f-4c7ac47fb32b@simark.ca> Date: Sat, 01 Feb 2020 03:05:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2020-02/txt/msg00000.txt.bz2 On 2020-01-31 12:23 p.m., Paul Smith wrote: > On Fri, 2020-01-31 at 19:17 +0200, Eli Zaretskii wrote: >>> In this case, we need a new library to link gdbserver directly, not >>> because of some other package that gdbserver depends on, so we >>> don't have a package that might contain a pkg-config we could use. >> >> Sorry, I thought liblzma needed -lrt. Apologies if I was confused. > > Oh I see the confusion. > > No, you're absolutely right, liblzma DOES need -lrt. And indeed, we DO > use pkg-config to get info about liblzma. > > And that's why linking of gdb itself succeeds: it links lzma with its > pkg-config options and that causes -lrt to be linked, as a side-effect. > > However, I'm whinging about gdbserver (and libinproctrace.so), and > liblzma is not not linked into those, and so neither is -lrt. I have tried to reproduce the build failure using a Docker container of Centos 6.10. I used the gcc 8 toolchain from softwarecollections.org, and didn't see the undefined reference to clock_gettime. This is despite the system running glibc 2.12, and the clock_gettime man page saying that -lrt is needed to use clock_gettime for glibc < 2.17. Anyway, I suppose adding this to gdbserver's configure.ac would help, could you try? AC_SEARCH_LIBS ([clock_gettime], [rt]) Simon