'How to disable clang warning of 'optimization flag is not supported'
I NEED to compile my sources files with the options
clang++ ... -flto -fno-fat-lto-objects foo.cpp
this generates following output
warning: optimization flag '-fno-fat-lto-objects' is not supported
Does somebody know an additional flag or something like that, which can be passed to the compiler and which suppress this warning?
Thanks!
Solution 1:[1]
-Wno-ignored-optimization-argument option should work. See -Wignored-optimization-argument for details:
This diagnostic is enabled by default.
Diagnostic text:
warning: optimization flag ‘A’ is not supported for target ‘B’ warning: optimization flag ‘A’ is not supported
Solution 2:[2]
Please kindly follow the below patch, try to modify again. Tested kernel 5.15, worked successfully.
--- a/Makefile
+++ b/Makefile
@@ -958,7 +958,7 @@ endif
# We trigger additional mismatches with less inlining
ifdef CONFIG_DEBUG_SECTION_MISMATCH
-KBUILD_CFLAGS += -fno-inline-functions-called-once
+KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
endif
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 |
