ge45mue
ge45mue

Reputation: 707

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!

Upvotes: 0

Views: 4607

Answers (2)

gary Feng
gary Feng

Reputation: 1

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

Upvotes: -2

Jingguo Yao
Jingguo Yao

Reputation: 8006

-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

Upvotes: 0

Related Questions