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

mirror: Define PACKAGE at build time when trying to detect libbfd #169

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

qmonnet
Copy link
Member

@qmonnet qmonnet commented Oct 14, 2024

Feature detection from the Makefile.feature for libbfd (with the different variants of the probe) may fail on some systems where the bfd.h and dis-asm.h headers expect the PACKAGE or PACKAGE_VERSION macros to be defined. In the kernel tree, feature detection addresses it by defining the PACKAGE macro when invoking the compiler. Add a similar definition for the mirror repository.

Note that this issue has remained undetected for a while. This is because the bfd.h included in some distributions (Debian/Ubuntu, for example) does not contain the inclusion guard.

Fixes: #166
Fixes: #167

Feature detection from the Makefile.feature for libbfd (with the
different variants of the probe) may fail on some systems where the
bfd.h and dis-asm.h headers expect the PACKAGE or PACKAGE_VERSION macros
to be defined [0]. In the kernel tree, feature detection addresses it by
defining the PACKAGE macro when invoking the compiler [1]. Add a similar
definition for the mirror repository.

Note that this issue has remained undetected for a while. This is
because the bfd.h included in some distributions (Debian/Ubuntu, for
example) does not contain the inclusion guard [2].

[0] https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/bfd-in.h;h=04e65aad5f0c235a5013513c545e57a01e96541f;hb=binutils-2_43_1#l27
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/build/feature/Makefile?h=v6.11#n114
[2] https://git.launchpad.net/ubuntu/+source/binutils/tree/debian/rules?h=applied/2.43.1-5#n1031

Reported-by: Holger Hoffstätte <[email protected]>
Signed-off-by: Quentin Monnet <[email protected]>
@qmonnet qmonnet merged commit bf9e060 into libbpf:main Oct 14, 2024
6 checks passed
@qmonnet qmonnet deleted the pr/define-package branch October 14, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant