-
Notifications
You must be signed in to change notification settings - Fork 96
Makefile: Print all detected features when building source #186
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,7 @@ endif # disassembler-four-args | |
ifneq ($(findstring disassembler-init-styled,$(FEATURE_TESTS)),) | ||
DISASSEMBLER_STYLED_PROBE := '$(pound)include <dis-asm.h>\n' | ||
DISASSEMBLER_STYLED_PROBE += 'int main(void) {' | ||
DISASSEMBLER_STYLED_PROBE += ' init_disassemble_info(NULL, 0, NULL, NULL);' | ||
DISASSEMBLER_STYLED_PROBE += ' init_disassemble_info(NULL, 0, NULL);' | ||
DISASSEMBLER_STYLED_PROBE += ' return 0;' | ||
DISASSEMBLER_STYLED_PROBE += '}' | ||
|
||
|
@@ -100,6 +100,26 @@ feature-disassembler-init-styled := \ | |
$(findstring 1, $(call disassembler_build,$(DISASSEMBLER_STYLED_PROBE))) | ||
endif # disassembler-init-styled | ||
|
||
### feature-libelf-zstd | ||
|
||
ifneq ($(findstring libelf-zstd,$(FEATURE_TESTS)),) | ||
LIBELF_ZSTD_PROBE := '$(pound)include <elf.h>\n' | ||
LIBELF_ZSTD_PROBE += 'int main(void) {' | ||
LIBELF_ZSTD_PROBE += ' Elf *e = NULL;' | ||
LIBELF_ZSTD_PROBE += ' return 0;' | ||
LIBELF_ZSTD_PROBE += '}' | ||
LIBELF_ZSTD_PROBE_CMD = printf '%b\n' $(LIBELF_ZSTD_PROBE) | \ | ||
$(CC) $(CFLAGS) -Wall -Werror -x c - -lelf -lz -S -o - >/dev/null | ||
|
||
define libelf_zstd_build | ||
$(call detect,$(LIBELF_ZSTD_PROBE_CMD)) | ||
endef | ||
|
||
$(call LOG,Probing: feature-libelf-zstd) | ||
feature-libelf-zstd := \ | ||
$(findstring 1, $(call libelf_zstd_build)) | ||
endif # libelf-zstd | ||
|
||
Comment on lines
+103
to
+122
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's leave this one out for now, please. There's a bit more to it, it should be addressed in #179 (I need to get back to that one!). |
||
### feature-libcap | ||
|
||
ifneq ($(findstring libcap,$(FEATURE_TESTS)),) | ||
|
@@ -169,9 +189,15 @@ endef | |
feature_print_status = $(eval $(print_status)) $(info $(MSG)) | ||
|
||
$(call feature_print_status,$(HAS_LIBBFD),libbfd) | ||
$(call feature_print_status,$(feature-libbfd-liberty),libbfd-liberty) | ||
$(call feature_print_status,$(feature-libbfd-liberty-z),libbfd-liberty-z) | ||
|
||
$(foreach feature,$(filter-out libbfd%,$(FEATURE_DISPLAY)), \ | ||
$(call feature_print_status,$(feature-$(feature)),$(feature))) | ||
|
||
$(call feature_print_status,$(feature-disassembler-four-args),disassembler-four-args) | ||
$(call feature_print_status,$(feature-disassembler-init-styled),disassembler-init-styled) | ||
$(call feature_print_status,$(feature-libelf-zstd),libelf-zstd) | ||
Comment on lines
+192
to
+200
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This prints all values unconditionally. Did you check the output from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I apologise for this mistake, I'll make the required changes in the new commit. |
||
|
||
CFLAGS := $(CFLAGS_BACKUP) | ||
undefine LOG LOG_RES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this change required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The make was failing by throwing an error saying the number of arguments do not match. Hence, I had to change this locally to make it work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is precisely what this probe is checking: whether the number of arguments match, or not, depending on libbfd's version, so that we know how many of them to use in bpftool's code (in
src/jit_disasm.c
).