Building oprofile-1.3.0 with upstream binutils fails with error:
bfd_support.cpp:140:53: error: cannot convert 'bfd' to 'const asection' {aka 'const bfd_section*'}
More information about this error can be found here:
http://autobuild.buildroot.net/?reason=oprofile-1.3.0
We got this error for "ARC" architecture because arc-tools binutils are based on master branch rev 20191002, which includes the commit that caused the error. The commit is next:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=fd3619828e94a24a92cddec42cbc0ab33352eeb4
This patch fixes the build for me using binutils 2.34. It will cause compile failures for previous versions, so it needs to be made conditional if compatibility with older versions is needed.
There are still a number of distributions that have older bersions of binutils. This needs to be conditional so oprofile can be compiled with the older binutils. Should have a set of wrapper defines in another header file and have a a test in configure.ac to select the correct wrappers. I have put a patch that does that on https://sourceforge.net/p/oprofile/oprofile/ci/bfd234/tree/
The patch allow oprofile to build on fedora 30 (binutils 2.31) and fedora rawhide (binutils 2.34). If the patch looks reasonable I can merge it into the master branch.
Could you try the current master branch of oprofile and verify that this fixes the reported problem?
master as of now compiles fine for me with binutils 2.34 and 2.33.
Hi,
Tried this patch and the package compiled well. I will send this patch to Buildroot.
Thanks you for fix!