]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
um: Pass the correct Rust target and options with gcc
authorDavid Gow <davidgow@google.com>
Mon, 10 Feb 2025 10:53:51 +0000 (18:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:25 +0000 (14:39 +0200)
commit2b0328c5f0f972ed3ec485cc2f57993b46e456d2
treeb874690e0bd17321133b2f3d3d559e4431cf2ea3
parent0d8ba0ed03c3ff277fa0d271f0905e60991282fb
um: Pass the correct Rust target and options with gcc

[ Upstream commit 5550187c4c21740942c32a9ae56f9f472a104cb4 ]

In order to work around some issues with disabling SSE on older versions
of gcc (compilation would fail upon seeing a function declaration
containing a float, even if it was never called or defined), the
corresponding CFLAGS and RUSTFLAGS were only set when using clang.

However, this led to two problems:
- Newer gcc versions also wouldn't get the correct flags, despite not
  having the bug.
- The RUSTFLAGS for setting the rust target definition were not set,
  despite being unrelated. This works by chance for x86_64, as the
  built-in default target is close enough, but not for 32-bit x86.

Move the target definition outside the conditional block, and update the
condition to take into account the gcc version.

Fixes: a3046a618a28 ("um: Only disable SSE on clang to work around old GCC bugs")
Signed-off-by: David Gow <davidgow@google.com>
Link: https://patch.msgid.link/20250210105353.2238769-2-davidgow@google.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/Makefile.um