forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
Needs BackportShould be backported to either linux-stable tree or latest llvm release branch.Should be backported to either linux-stable tree or latest llvm release branch.[BUG] linux-stableA bug that is present in linux-stable and not mainline.A bug that is present in linux-stable and not mainline.
Description
-mhard-float is not a valid Clang flag for x86_64 targets, but it's used in the AMD display driver code occasionally. We believe before LLVM commit a4b2f4a72aa9b4655ecc723838830e0a7f29c9ca, this flag was simply ignored when paired with -Qunused-arguments,
and did nothing. However, since a4b2f4a72aa9b4655ecc723838830e0a7f29c9ca, this is now treated as an
error:
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:286: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o] Error 1
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_rq_dlg_helpers.o
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:286: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_rq_dlg_helpers.o] Error 1
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dml1_display_rq_dlg_calc.o
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn20/dcn20_fpu.o
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_vba.o
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:286: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dml1_display_rq_dlg_calc.o] Error 1
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn20/display_rq_dlg_calc_20.o
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn20/display_mode_vba_20.o
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:286: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn20/dcn20_fpu.o] Error 1
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn20/display_rq_dlg_calc_20v2.o
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn20/display_mode_vba_20v2.o
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:286: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn20/display_mode_vba_20.o] Error 1
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:286: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_vba.o] Error 1
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn21/display_rq_dlg_calc_21.o
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn21/display_mode_vba_21.o
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:286: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn20/display_rq_dlg_calc_20.o] Error 1
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn30/display_mode_vba_30.o
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:286: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn20/display_rq_dlg_calc_20v2.o] Error 1
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn30/display_rq_dlg_calc_30.o
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:287: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn21/display_rq_dlg_calc_21.o] Error 1
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:286: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn21/display_mode_vba_21.o] Error 1
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn31/display_mode_vba_31.o
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn31/display_rq_dlg_calc_31.o
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:286: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn20/display_mode_vba_20v2.o] Error 1
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dsc/rc_calc_fpu.o
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_init.o
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hubp.o
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hubbub.o
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:286: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn30/display_rq_dlg_calc_30.o] Error 1
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:286: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn31/display_mode_vba_31.o] Error 1
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:286: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn30/display_mode_vba_30.o] Error 1
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_resource.o
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:286: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn31/display_rq_dlg_calc_31.o] Error 1
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hwseq.o
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_link_encoder.o
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_dccg.o
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:286: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dsc/rc_calc_fpu.o] Error 1
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_init.o
CC drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_hubbub.o
clang: error: unsupported option '-mhard-float' for target 'x86_64-cros-linux-gnu'
make[5]: *** [/mnt/host/source/src/third_party/kernel/v5.10/scripts/Makefile.build:287: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_resource.o] Error 1
Clang 20.1.0 Example (works)
Clang 21.1.0 Example (fails)
This is already fixed in newer Kernels, specifically v5.15 at d081467 already:
commit d08146795689a0b2563b1eec8e4b6f4d050b2453
Author: Nathan Chancellor <[email protected]>
Date: Wed Jan 11 20:05:09 2023 -0700
drm/amd/display: Do not add '-mhard-float' to dml_ccflags for clang
commit 7db038d9790eda558dd6c1dde4cdd58b64789c47 upstream.
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 <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Tested-by: Linux Kernel Functional Testing <[email protected]>
Tested-by: Anders Roxell <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Nathan Chancellor <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
index 96e70832c742..36cac3839b50 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_PPC6
Public ChromeOS Bug: https://issuetracker.google.com/491530865
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs BackportShould be backported to either linux-stable tree or latest llvm release branch.Should be backported to either linux-stable tree or latest llvm release branch.[BUG] linux-stableA bug that is present in linux-stable and not mainline.A bug that is present in linux-stable and not mainline.