From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93020 invoked by alias); 4 Feb 2020 22:04:19 -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 92318 invoked by uid 89); 4 Feb 2020 22:04:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=unavailable version=3.3.1 spammy=Buildroot X-HELO: mail-wm1-f65.google.com Received: from mail-wm1-f65.google.com (HELO mail-wm1-f65.google.com) (209.85.128.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Feb 2020 22:04:16 +0000 Received: by mail-wm1-f65.google.com with SMTP id b17so358013wmb.0 for ; Tue, 04 Feb 2020 14:04:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile-fr.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1rT2cECKKpOlOTelgATjanqwm7TXaw1oJiu34417wb4=; b=NsqJYtuZIbETA4R/6+qnzmprcQYeU1Rgf0G8wd7wWpwxHOal4LJpWETME5FsSSJdz1 o5t5Hzm4t8AEO6LWtSJzV0n/Ra0ynM2jSE2WI63EcySXOb64d2nfdg3XS3WWIof9RzrB tusnvYWhWynooQb3fzfmhzMoxxQA2MWTEo6yWHzoMYMY7gGOAUu3Zh161RqlgAUF7QAx gC7oKlTThuORiqT/0wL/NE+9QAoMOZojJSLZ/iyyHP1QdJMTjNBfWZhilP11UdeFYJKq gIY3gH15mH/XMzCyxt+SVuenHKTrvblMZkus38j3IXuHGCZ85TDJqKl4S+Zag2rnEz2B DXOA== Return-Path: Received: from [192.168.42.181] (70.168.185.81.rev.sfr.net. [81.185.168.70]) by smtp.gmail.com with ESMTPSA id a16sm5754618wrx.87.2020.02.04.14.04.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Feb 2020 14:04:13 -0800 (PST) Subject: Re: Bug#950414: binutils-dev: failed to build linux perf (tools/perf) due to missing functions To: Hagen Paul Pfeifer , Matthias Klose Cc: 950414@bugs.debian.org, Ben Hutchings , Stephen Rothwell , Arnaldo Carvalho de Melo , binutils , gdb@sourceware.org, Alan Modra , "H.J. Lu" , Nick Clifton References: <20200201095306.GD9786@laniakea> <005fbdf3-a9c6-36d8-c2e8-0d307de5a40d@debian.org> <20200203210310.GA217509@virgo> <20200204153557.GA280113@virgo> From: Romain Naour Message-ID: Date: Tue, 04 Feb 2020 22:04: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: <20200204153557.GA280113@virgo> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2020-02/txt/msg00016.txt.bz2 Hi All, Le 04/02/2020 à 16:35, Hagen Paul Pfeifer a écrit : > * Matthias Klose | 2020-02-03 22:29:21 [+0100]: > > [CCing Alan Modra, H.J. Lu, Nick Clifton & Arnaldo] > > Ok, I tried to check what happens: > > - Alan Modra modified the bfd_section_* macros (see commit fd3619828e94a) > upstream (https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=summary) > Or in other words: this patch removed/renamed the macros silently. This was > back in September last Year. No __attribute__ deprecation warning or other > information was given a priori to react. > - This went mainline and was now taken by Debian Bullseye the last couple of > days. RedHat and other distributions will probably run in the same problems, > once they upgrade binutils. > - Linux perf and other applications build on these functionality are now > doomed. Binutils 2.34 broke also elf2flt tool: https://github.com/uclinux-dev/elf2flt/blob/453398f917d167f8c308c8f997270c48ae8f8b12/elf2flt.c#L326 elf2flt is used in Buildroot build for armv7m (cortex-m4) and m68k-codefire. https://gitlab.com/kubu93/toolchains-builder/-/jobs/423715926 Best regards, Romain > >> binutils doesn't have any comitment to a stable ABI/API for libopcodes and >> libbfd. > > Sure? They exposed bfd_get_section_flags and friends in bfd.h - it was not > hidden somewhere in private header files nor was it guarded by any other > measure. Correct me if I am wrong! > > And: the functions/macros where used in the wild! They where helpful and > serviceable to the broader audience - which is (sorry: "was" :-) great! > > The following patch fixed the problem for me to build Linux perf again: > > --- /usr/include/bfd.h 2020-02-04 15:24:36.746534674 +0000 > +++ /usr/include/bfd.new.h 2020-02-04 15:24:39.486542126 +0000 > @@ -1243,6 +1243,11 @@ > return (sec->flags & SEC_IS_COMMON) != 0; > } > > +#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) > +#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) > +#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) > +#define bfd_get_section_size(ptr) ((ptr)->size) > + > > > Note: for binutils ./bfd/bfd-in.h should be adjusted - sure. > > Hagen Paul Pfeifer > >>> It seems other people (kernel folks, Stephen) have the identical error as >>> well: https://lkml.org/lkml/2020/1/30/1005 >>> Stephen: or is the bug fixed somewhere else? Do you have an workaround?a >> >> I don't have a work-around. If you rely on binutils internals, you really should >> adjust to binutils upstream.