Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build works on my machine now with these changes #242

Closed
wants to merge 1 commit into from

Conversation

m-fin
Copy link

@m-fin m-fin commented Nov 18, 2020

Before when I tried to build, I would get these errors:

Scanning dependencies of target cogutil
[ 5%] Building C object opencog/util/CMakeFiles/cogutil.dir/backtrace-symbols.c.o
/home/matt/OPENCOG/cogutil/opencog/util/backtrace-symbols.c: In function ‘find_address_in_section’:
/home/matt/OPENCOG/cogutil/opencog/util/backtrace-symbols.c:130:10: warning: implicit declaration of function ‘bfd_get_section_flags’; did you mean ‘bfd_set_section_flags’? [-Wimplicit-function-declaration]
130 | if ((bfd_get_section_flags(abfd) & SEC_ALLOC) == 0) return;
| ^~~~~~~~~~~~~~~~~~~~~
| bfd_set_section_flags
/home/matt/OPENCOG/cogutil/opencog/util/backtrace-symbols.c:132:11: warning: implicit declaration of function ‘bfd_get_section_vma’; did you mean ‘bfd_set_section_vma’? [-Wimplicit-function-declaration]
132 | vma = bfd_get_section_vma(abfd, section);
| ^~~~~~~~~~~~~~~~~~~
| bfd_set_section_vma
/home/matt/OPENCOG/cogutil/opencog/util/backtrace-symbols.c:135:29: warning: passing argument 1 of ‘bfd_section_size’ from incompatible pointer type [-Wincompatible-pointer-types]
135 | size = bfd_section_size(abfd, section);
| ^~~~
| |
| bfd * {aka struct bfd *}
In file included from /home/matt/OPENCOG/cogutil/opencog/util/backtrace-symbols.c:73:
/usr/include/bfd.h:1206:35: note: expected ‘const asection *’ {aka ‘const struct bfd_section *’} but argument is of type ‘bfd *’ {aka ‘struct bfd *’}
1206 | bfd_section_size (const asection *sec)
| ~~~~~~~~~~~~~~~~^~~
/home/matt/OPENCOG/cogutil/opencog/util/backtrace-symbols.c:135:12: error: too many arguments to function ‘bfd_section_size’
135 | size = bfd_section_size(abfd, section);
| ^~~~~~~~~~~~~~~~
In file included from /home/matt/OPENCOG/cogutil/opencog/util/backtrace-symbols.c:73:
/usr/include/bfd.h:1206:1: note: declared here
1206 | bfd_section_size (const asection *sec)
| ^~~~~~~~~~~~~~~~
make[2]: *** [opencog/util/CMakeFiles/cogutil.dir/build.make:76: opencog/util/CMakeFiles/cogutil.dir/backtrace-symbols.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:368: opencog/util/CMakeFiles/cogutil.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

By deleting this lines the build worked with 100% success. Maybe this was just something unique to machine, or there's probably a better solution, so up to you if you want to actually commit the changes.

Before when I tried to build, I would get these errors:

Scanning dependencies of target cogutil
[  4%] Building CXX object opencog/util/CMakeFiles/cogutil.dir/ansi.cc.o
[  9%] Building C object opencog/util/CMakeFiles/cogutil.dir/backtrace-symbols.c.o
/home/matt/OPENCOG/cogutil-2.0.3-stable/opencog/util/backtrace-symbols.c: In function ‘find_address_in_section’:
/home/matt/OPENCOG/cogutil-2.0.3-stable/opencog/util/backtrace-symbols.c:148:12: warning: implicit declaration of function ‘bfd_get_section_flags’; did you mean ‘bfd_set_section_flags’? [-Wimplicit-function-declaration]
  148 |       if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0)
      |            ^~~~~~~~~~~~~~~~~~~~~
      |            bfd_set_section_flags
/home/matt/OPENCOG/cogutil-2.0.3-stable/opencog/util/backtrace-symbols.c:151:13: warning: implicit declaration of function ‘bfd_get_section_vma’; did you mean ‘bfd_set_section_vma’? [-Wimplicit-function-declaration]
  151 |       vma = bfd_get_section_vma(abfd, section);
      |             ^~~~~~~~~~~~~~~~~~~
      |             bfd_set_section_vma
/home/matt/OPENCOG/cogutil-2.0.3-stable/opencog/util/backtrace-symbols.c:155:31: warning: passing argument 1 of ‘bfd_section_size’ from incompatible pointer type [-Wincompatible-pointer-types]
  155 |       size = bfd_section_size(abfd, section);
      |                               ^~~~
      |                               |
      |                               bfd * {aka struct bfd *}
In file included from /home/matt/OPENCOG/cogutil-2.0.3-stable/opencog/util/backtrace-symbols.c:68:
/usr/include/bfd.h:1206:35: note: expected ‘const asection *’ {aka ‘const struct bfd_section *’} but argument is of type ‘bfd *’ {aka ‘struct bfd *’}
 1206 | bfd_section_size (const asection *sec)
      |                   ~~~~~~~~~~~~~~~~^~~
/home/matt/OPENCOG/cogutil-2.0.3-stable/opencog/util/backtrace-symbols.c:155:14: error: too many arguments to function ‘bfd_section_size’
  155 |       size = bfd_section_size(abfd, section);
      |              ^~~~~~~~~~~~~~~~
In file included from /home/matt/OPENCOG/cogutil-2.0.3-stable/opencog/util/backtrace-symbols.c:68:
/usr/include/bfd.h:1206:1: note: declared here
 1206 | bfd_section_size (const asection *sec)
      | ^~~~~~~~~~~~~~~~
make[2]: *** [opencog/util/CMakeFiles/cogutil.dir/build.make:76: opencog/util/CMakeFiles/cogutil.dir/backtrace-symbols.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:362: opencog/util/CMakeFiles/cogutil.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

By deleting this lines the build worked with 100% success. Maybe this was just something unique to machine, or there's probably a better solution, so up to you if you want to actually commit the changes.
@ntoxeg
Copy link
Contributor

ntoxeg commented Nov 19, 2020

There is already the solution that I’ve submitted - you just removed the code that actually has to be there, I’ve added more comprehensive checks so that this should build with various versions of Binutils. You can use my fork until they merge it upstream.

@linas
Copy link
Member

linas commented Jan 23, 2021

Closing without merge; this is fixed correctly in #240

@linas linas closed this Jan 23, 2021
@linas
Copy link
Member

linas commented Jan 23, 2021

Thanks anyway; but this fix was too simple. There are multiple incompatible versions of the BFD API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants