drm/amd/display: Do not add '-mhard-float' to dml_ccflags for clang
authorNathan Chancellor <nathan@kernel.org>
Thu, 12 Jan 2023 03:05:09 +0000 (20:05 -0700)
committerMasahiro Yamada <masahiroy@kernel.org>
Thu, 26 Jan 2023 03:43:11 +0000 (12:43 +0900)
When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it
warns:

  clang-16: error: argument unused during compilation: '-mhard-float' [-Werror,-Wunused-command-line-argument]

Similar to commit 84edc2eff827 ("selftest/fpu: avoid clang warning"),
just add this flag to GCC builds. Commit 0f0727d971f6 ("drm/amd/display:
readd -msse2 to prevent Clang from emitting libcalls to undefined SW FP
routines") added '-msse2' to prevent clang from emitting software
floating point routines.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Tested-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
drivers/gpu/drm/amd/display/dc/dml/Makefile

index 0ecea87cf48f2397fd4703d595e63ee2e79ffb65..9d0f79dff2e30583f2db38454ab07b191a9045b0 100644 (file)
@@ -26,7 +26,8 @@
 # subcomponents.
 
 ifdef CONFIG_X86
-dml_ccflags := -mhard-float -msse
+dml_ccflags-$(CONFIG_CC_IS_GCC) := -mhard-float
+dml_ccflags := $(dml_ccflags-y) -msse
 endif
 
 ifdef CONFIG_PPC64