Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 707850

Summary: dev-util/oprofile-1.3.0 : bfd_support.cpp:140:53: error: cannot convert bfd* to const asection* {aka const bfd_section* }
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Andrew Savchenko <bircoph>
Status: RESOLVED FIXED    
Severity: normal CC: drmccoy, gentoobugs, kentnl
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://sourceforge.net/p/oprofile/bugs/292/
See Also: https://github.com/gentoo/gentoo/pull/15469
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 707898    
Attachments: emerge-info.txt
dev-util:oprofile-1.3.0:20200202-005410.log
emerge-history.txt
environment
etc.portage.tbz2
logs.tbz2
temp.tbz2
Fix compile with binutils 2.34

Description Toralf Förster gentoo-dev 2020-02-02 04:13:26 UTC
x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I..  -I ../libutil -I ../libop -I ../libpp   -W -Wall -fno-common -O2 -pipe -march=native -fno-common -c -o bfd_support.o bfd_support.cpp
bfd_support.cpp: In function ‘bool {anonymous}::get_build_id(bfd*, unsigned char*)’:
bfd_support.cpp:140:53: error: cannot convert ‘bfd*’ to ‘const asection*’ {aka ‘const bfd_section*’}
  140 |  bfd_size_type buildid_sect_size = bfd_section_size(ibfd, sect);
      |                                                     ^~~~
      |                                                     |

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_hardened-libressl_test-20200126-104546

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-9.2.0 *

clang:
clang version 9.0.1 
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/9/bin
llvm:
9.0.1
Available Python interpreters, in order of preference:
  [1]   python3.8
  [2]   python3.7
  [3]   python3.6
  [4]   python2.7 (fallback)
  [5]   pypy3 (fallback)

Available Rust versions:
  [1]   rust-1.40.0 *
java-config:
The following VMs are available for generation-2:
*)	AdoptOpenJDK JRE 8.242_p08 [openjdk-jre-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-jre-bin-8  system-vm
ghc:
The Glorious Glasgow Haskell Compilation System, version 8.0.2

repository:
==> /var/db/repos/gentoo/metadata/timestamp.chk <==
Sat, 01 Feb 2020 23:27:56 +0000

emerge -qpvO dev-util/oprofile
[ebuild   R   ] dev-util/oprofile-1.3.0  USE="-java (-pch)"
Comment 1 Toralf Förster gentoo-dev 2020-02-02 04:13:29 UTC
Created attachment 610804 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2020-02-02 04:13:32 UTC
Created attachment 610806 [details]
dev-util:oprofile-1.3.0:20200202-005410.log
Comment 3 Toralf Förster gentoo-dev 2020-02-02 04:13:35 UTC
Created attachment 610808 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2020-02-02 04:13:38 UTC
Created attachment 610810 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2020-02-02 04:13:41 UTC
Created attachment 610812 [details]
etc.portage.tbz2
Comment 6 Toralf Förster gentoo-dev 2020-02-02 04:13:44 UTC
Created attachment 610814 [details]
logs.tbz2
Comment 7 Toralf Förster gentoo-dev 2020-02-02 04:13:47 UTC
Created attachment 610816 [details]
temp.tbz2
Comment 8 Sven Hesse 2020-02-02 11:12:33 UTC
Created attachment 611012 [details, diff]
Fix compile with binutils 2.34

Attaching a patch that fixes compilation, found in the Ubuntu repository https://launchpad.net/ubuntu/+source/oprofile/1.3.0-0ubuntu12 ( https://launchpadlibrarian.net/461801511/oprofile_1.3.0-0ubuntu11_1.3.0-0ubuntu12.diff.gz ), by Matthias Klose.
Comment 9 Matt Whitlock 2020-02-04 00:27:44 UTC
(In reply to Sven Hesse from comment #8)

Attached patch fixes the build failure for me.
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2020-06-26 10:50:52 UTC
Comment on attachment 611012 [details, diff]
Fix compile with binutils 2.34

As suggested upstream, that patch is correct for binutils-2.34 but breaks compatibility with older binutils versions.
Comment 11 Larry the Git Cow gentoo-dev 2020-06-27 18:23:13 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c852a7c84f28fe745437bcddc4d88b9dc44c85f5

commit c852a7c84f28fe745437bcddc4d88b9dc44c85f5
Author:     Andrew Savchenko <bircoph@gentoo.org>
AuthorDate: 2020-06-27 18:19:05 +0000
Commit:     Andrew Savchenko <bircoph@gentoo.org>
CommitDate: 2020-06-27 18:22:49 +0000

    dev-util/oprofile: fix build with binutils-2.34
    
    Use upstream patch 377610414fb6cd7ac30e4485d9d6482fcf29aca6 to fix
    build with new binutils api (2.34) while keeping compatibility
    support with older versions.
    
    Closes: https://bugs.gentoo.org/707850
    Closes: https://github.com/gentoo/gentoo/pull/15469
    Package-Manager: Portage-2.3.82, Repoman-2.3.20
    Signed-off-by: Andrew Savchenko <bircoph@gentoo.org>

 dev-util/oprofile/files/binutils-2.34.patch | 157 ++++++++++++++++++++++++++++
 dev-util/oprofile/oprofile-1.3.0.ebuild     |   8 +-
 2 files changed, 164 insertions(+), 1 deletion(-)