-
Notifications
You must be signed in to change notification settings - Fork 75
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
Check zlib feature error #3
Comments
When detecting the features on the machine, clang does not need the flags for telling the linker what libraries to use. As a consequence, it prints a warning to let users know that the flag is unused, and this turns into an error due to the use of -Wall and -Werror: clang: error: -: 'linker' input unused [-Werror,-Wunused-command-line-argument] To address it, we can temporarily add -Wno-unused-command-line-argument to the $(CFLAGS) when we check the features with clang. Fixes: libbpf#3 Reported-by: @aguaiyoung Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Using "echo" in Makefiles, especially when line breaks should be printed, is not portable. In the case of features detection, the C snippets contained in Makefile variables must have a line break after the #include directives, and printing them with "echo" may produce different outputs depending on the environment. Instead of echo, we can use printf, which should be more portable. Fixes: libbpf#3 Reported-by: @aguaiyoung Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Hi, thanks a lot for the report! Both issues are bugs in the feature detection. It looks that I don't directly experience the issue with the If you have a moment, could you please check whether the changes in #5 fix the build on your setup? |
When detecting the features on the machine, clang does not need the flags for telling the linker what libraries to use. As a consequence, it prints a warning to let users know that the flag is unused, and this turns into an error due to the use of -Wall and -Werror: clang: error: -: 'linker' input unused [-Werror,-Wunused-command-line-argument] To address it, we can temporarily add -Wno-unused-command-line-argument to the $(CFLAGS) when we check the features with clang. Fixes: libbpf#3 Fixes: 28b7ccc ("mirror: Reimplement feature detection and reallocarray()") Reported-by: @aguaiyoung Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Using "echo" in Makefiles, especially when line breaks should be printed, is not portable. In the case of features detection, the C snippets contained in Makefile variables must have a line break after the #include directives, and printing them with "echo" may produce different outputs depending on the environment. Instead of echo, we can use printf, which should be more portable. Fixes: libbpf#3 Fixes: 28b7ccc ("mirror: Reimplement feature detection and reallocarray()") Reported-by: @aguaiyoung Signed-off-by: Quentin Monnet <quentin@isovalent.com>
check in my env, it's ok. |
Using "echo" in Makefiles, especially when line breaks should be printed, is not portable. In the case of features detection, the C snippets contained in Makefile variables must have a line break after the #include directives, and printing them with "echo" may produce different outputs depending on the environment. Instead of echo, we can use printf, which should be more portable. Fixes: #3 Fixes: 28b7ccc ("mirror: Reimplement feature detection and reallocarray()") Reported-by: @aguaiyoung Signed-off-by: Quentin Monnet <quentin@isovalent.com>
And thank you for testing :) Merged now. |
Makefile.feature may check requirement lib like as zlib,but if clang's version 11.0.0 it's not work well.
some code need escape character like
\n
you need add like that:or it output error like that:
and other
echo
needecho -e
replaceMakefile.include need add EXTRA_WARNINGS in clang version is 11.0.0
The text was updated successfully, but these errors were encountered: