Re: libbfd version

Brilliantov Kirill Vladimirovich <[email protected]> Thu, 13 Feb 2020 20:44:31 +0300
Newsgroups gmane.linux.oprofile
Message-ID <[email protected]>
On 2020-02-12 20:38:15, Brilliantov Kirill Vladimirovich wrote:
> Hello!
> I try cross-compile oprofile-1.0.0, unfortunately build failed with error
> ```
> ...........
> Making all in .
> bfd_support.cpp: In function 'bool {anonymous}::get_build_id(bfd*, unsigned char*)':
> bfd_support.cpp:142:63: error: cannot convert 'bfd*' to 'const asection* {aka const bfd_section*}' for argument '1' to 'bfd_size_type bfd_section_size(const asection*)'
>   bfd_size_type buildid_sect_size = bfd_section_size(ibfd, sect);
>                                                                ^
> bfd_support.cpp: In function 'bool {anonymous}::get_debug_link_info(bfd*, std::string&, long unsigned int&)':
> bfd_support.cpp:193:60: error: cannot convert 'bfd*' to 'const asection* {aka const bfd_section*}' for argument '1' to 'bfd_size_type bfd_section_size(const asection*)'
>   bfd_size_type debuglink_size = bfd_section_size(ibfd, sect);
>                                                             ^
> bfd_support.cpp: In function 'void {anonymous}::fixup_linenr(bfd*, asection*, asymbol**, const string&, bfd_vma, const char**, unsigned int*)':
> bfd_support.cpp:351:54: error: cannot convert 'bfd*' to 'const asection* {aka const bfd_section*}' for argument '1' to 'bfd_size_type bfd_section_size(const asection*)'
>   size_t section_size = bfd_section_size(abfd, section);
>                                                       ^
> bfd_support.cpp: In function 'const linenr_info find_nearest_line(const bfd_info&, const op_bfd_symbol&, bfd_vma, bool)':
> bfd_support.cpp:824:42: error: 'bfd_get_section_flags' was not declared in this scope
>   if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0)
>                                           ^
> bfd_support.cpp:827:42: error: cannot convert 'bfd*' to 'const asection* {aka const bfd_section*}' for argument '1' to 'bfd_size_type bfd_section_size(const asection*)'
>   if (pc >= bfd_section_size(abfd, section))
>                                           ^
> Makefile:383: recipe for target 'bfd_support.o' failed
> ...........
> ```
> I check libbfd API and found what it different, file bfd.h
> static inline bfd_size_type bfd_section_size (const asection *sec)
> I build libbfd.a and libiberty.a from binutils-2.34, which version of the
> binutils should I use?
> Thank you and excuse my bad english.
> 

Ok, problem solved after rollback to binutils-2.30.
At this moment I also can't build oprofile for mipsel with uclibs
```
operf.cpp: In function 'void convert_sample_data()':
operf.cpp:900:84: error: 'nftw' was not declared in this scope
   if (nftw(previous_sampledir.c_str(), __delete_old_previous_sample_data, 32, flags) !=0 &&
```
But this is another issue ;)