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

backward-cpp: Make sure to properly link against bfd.a #68

Merged
merged 1 commit into from
Sep 1, 2017

Conversation

krf
Copy link
Contributor

@krf krf commented Jul 19, 2017

On some distributions, libbfd is only available as static library. E.g.
on OpenSuse Leap 42.2, there are these two files:
libbfd.a
libbfd-2.28-system.so

backward-cpp, when attempting to link to bfd, will select the static
library and fail b/c there are undefined references to symbols from
libiberty/libz:

/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/libbfd.a(elflink.o):
In function `elf_link_add_object_symbols':
/home/abuild/rpmbuild/BUILD/binutils-2.26.1/build-dir/bfd/../../bfd/elflink.c:4733:
undefined reference to `objalloc_free_block'
/home/abuild/rpmbuild/BUILD/binutils-2.26.1/build-dir/bfd/../../bfd/elflink.c:5027:
undefined reference to `_sch_istable'
...

After this patch we also link against the direct dependencies of libbfd.a, namely libiberty and libz

Also see: KDAB/GammaRay#386

On some distributions, libbfd is only available as static library. E.g.
on OpenSuse Leap 42.2, there are these two files:
  libbfd.a
  libbfd-2.28-system.so

backward-cpp, when attempting to link to bfd, will select the static
library and fail b/c there are undefined references to symbols from
libiberty/libz:
```
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/libbfd.a(elflink.o):
In function `elf_link_add_object_symbols':
/home/abuild/rpmbuild/BUILD/binutils-2.26.1/build-dir/bfd/../../bfd/elflink.c:4733:
undefined reference to `objalloc_free_block'
/home/abuild/rpmbuild/BUILD/binutils-2.26.1/build-dir/bfd/../../bfd/elflink.c:5027:
undefined reference to `_sch_istable'
...
```

After this patch we also link against the direct dependencies of libbfd.a, namely libiberty and libz

Also see: KDAB/GammaRay#386
@krf
Copy link
Contributor Author

krf commented Jul 31, 2017

Bump?

@bombela bombela merged commit b4c35c3 into bombela:master Sep 1, 2017
@bombela
Copy link
Owner

bombela commented Sep 1, 2017

Sorry for the lag. Thank you for this PR.

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.

2 participants