From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125055 invoked by alias); 31 Jan 2020 16:48:56 -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 125043 invoked by uid 89); 31 Jan 2020 16:48:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=H*f:sk:831rrgm, H*MI:sk:831rrgm, H*i:sk:831rrgm X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 31 Jan 2020 16:48:53 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48773) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ixZTP-0006bY-6H; Fri, 31 Jan 2020 11:48:51 -0500 Received: from [50.226.24.42] (port=37620 helo=pdslaptop) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ixZTO-0003TV-BK; Fri, 31 Jan 2020 11:48:50 -0500 Message-ID: <2820a9d3d0c191d64f24565d583508db9c1b067f.camel@gnu.org> Subject: Re: GDB 8.3.1 gdbserver linker error: needs -lrt From: Paul Smith Reply-To: psmith@gnu.org To: Eli Zaretskii , Simon Marchi Cc: gdb@sourceware.org Date: Fri, 31 Jan 2020 16:48:00 -0000 In-Reply-To: <831rrgm5o8.fsf@gnu.org> References: <06b764efa74573c9422da526f9d92aa2d9440e73.camel@gnu.org> <49c1cc4a-fe1b-8e35-b16b-76d9faec2173@simark.ca> <831rrgm5o8.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00086.txt.bz2 On Fri, 2020-01-31 at 09:44 +0200, Eli Zaretskii wrote: > > From: Simon Marchi > > Date: Thu, 30 Jan 2020 17:49:59 -0500 > > > > > > That would work around the problem, but if you want to fix it > > > > for good, for all users in the same situation, then it would > > > > probably require a patch to configure.ac, to add "-lrt" to LIBS > > > > when needed. > > > > > > Yes, definitely... that's why I posted the message :). > > Any reason why we don't use pkg-config for finding out these > dependencies? I'm not sure how pkg-config helps in this situation... isn't pkg-config used for obtaining correct options for using another package? 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. Maybe you mean, a pkg-config for libstdc++ static linking? I'm not sure GCC installs such a thing. I'm pretty sure there are a LOT of configure.ac files out there that search for -lrt that could be used as. It's just that in this case we didn't realize we needed it, because (a) it's needed by libstdc++.a but probably not if you dynamically link libstdc++ (becase the .so probably links librt.so) and (b) it's only needed with older GNU libc; I think newer versions of GNU libc have moved clock_gettime etc. into the normal library and -lrt is obsolete.