diff mbox series

[12/14] drm/amd/display: Do not add '-mhard-float' to dml_ccflags for clang

Message ID 20221228-drop-qunused-arguments-v1-12-658cbc8fc592@kernel.org (mailing list archive)
State New, archived
Headers show
Series Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS | expand

Commit Message

Nathan Chancellor Jan. 4, 2023, 7:54 p.m. UTC
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>
---
Cc: harry.wentland@amd.com
Cc: sunpeng.li@amd.com
Cc: Rodrigo.Siqueira@amd.com
Cc: alexander.deucher@amd.com
Cc: christian.koenig@amd.com
Cc: Xinhui.Pan@amd.com
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/amd/display/dc/dml/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Alex Deucher Jan. 5, 2023, 2:21 p.m. UTC | #1
On Wed, Jan 4, 2023 at 2:55 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> 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>
> ---
> Cc: harry.wentland@amd.com
> Cc: sunpeng.li@amd.com
> Cc: Rodrigo.Siqueira@amd.com
> Cc: alexander.deucher@amd.com
> Cc: christian.koenig@amd.com
> Cc: Xinhui.Pan@amd.com
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Feel free to take this via whatever tree makes sense.

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dml/Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
> index 0ecea87cf48f..9d0f79dff2e3 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
> @@ -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
>
> --
> 2.39.0
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
index 0ecea87cf48f..9d0f79dff2e3 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
@@ -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