From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4234 invoked by alias); 11 Sep 2018 18:22:08 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 4224 invoked by uid 89); 11 Sep 2018 18:22:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=54B1, 237A, 28bf, 7628 X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Sep 2018 18:22:01 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 88DEC40200A8; Tue, 11 Sep 2018 18:21:59 +0000 (UTC) Received: from localhost (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 20340FA96F; Tue, 11 Sep 2018 18:21:59 +0000 (UTC) From: Sergio Durigan Junior To: Pedro Alves Cc: Rich Felker , Romain Naour , Thomas Petazzoni , Romain Naour , buildroot@buildroot.org, gdb-patches@sourceware.org Subject: Re: [Buildroot] [PATCH 2/2] package/gdb: use stat() privided by the system References: <20180909163750.14196-1-romain.naour@gmail.com> <20180909163750.14196-2-romain.naour@gmail.com> <20180910174900.0b9f4133@windsurf> <20180910224128.GT1878@brightrain.aerifal.cx> <87lg88oolv.fsf@redhat.com> <13772de6-1197-4182-e13f-3b4f27dfa22d@redhat.com> Date: Tue, 11 Sep 2018 18:22:00 -0000 In-Reply-To: <13772de6-1197-4182-e13f-3b4f27dfa22d@redhat.com> (Pedro Alves's message of "Tue, 11 Sep 2018 10:51:20 +0100") Message-ID: <87d0tjopx5.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00343.txt.bz2 On Tuesday, September 11 2018, Pedro Alves wrote: > On 09/11/2018 01:38 AM, Sergio Durigan Junior wrote: > >> This is happening because, before the commit mentioned above, >> 'common-utils.c' (which gets transformed into 'common-utils-ipa.c' >> during the gdbserver build) wasn't calling 'stat'. It doesn't seem like >> a regression; it seems like a hidden problem that was uncovered by the >> need of 'stat'. >> >> I don't know why this problem is manifesting only when compiling IPA, >> and not when compiling 'common-utils.c' during GDB's/gdbserver's build. > > Because the IPA doesn't link with gnulib. And the answer to that wouldn't > be as simple as "just link it in", because the IPA objects are supposed > to be compiled with -fPIC and -fvisibility=hidden. So we'd need a third > build of gnulib for the IPA. That explains it. It seems strange to me that we still include the gnulib headers when compiling IPA; I confess I just assumed IPA was linking with gnulib because of this. > It doesn't seem like this code that calls stat (is_regular_file?) is > useful for the IPA, so a quicker/simpler fix would be to simply move > that function out of common-utils.c into some other file that is not > shared with the IPA. It's not useful for IPA; it could be moved to common/filestuff.c, for example. But IMHO, we should probably have an explicit file just for IPA, because otherwise we'll forget about this restriction and re-add some 'stat' calls to common-utils.c. Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/