简体   繁体   中英

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!

-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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM