-
Notifications
You must be signed in to change notification settings - Fork 91
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
Makefile: Print all detected features when building source #186
base: main
Are you sure you want to change the base?
Conversation
### 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 | ||
|
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.
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!).
DISASSEMBLER_STYLED_PROBE += ' init_disassemble_info(NULL, 0, NULL, NULL);' | ||
DISASSEMBLER_STYLED_PROBE += ' init_disassemble_info(NULL, 0, NULL);' |
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
).
$(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) |
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 prints all values unconditionally. Did you check the output from make
, without the VF=1
?
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.
I apologise for this mistake, I'll make the required changes in the new commit.
Fixes #181
This PR introduces the functionality of printing all detected features when VF=1 in the repository, similar to the kernel behavior. Currently, the V=1 flag prints detailed information about feature detection, but the output is more concise when VF=1. By adding this functionality, we enhance the debugging experience by providing clear and structured feedback on the detected features during the build process.
The output of the modified
src/Makefile.feature
to display the features is as follows: