From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F8FE175B1 for ; Wed, 29 May 2024 09:33:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716975225; cv=none; b=VrVDEMpTOewQDk/CBwOY4VjXs4Wsa8TywIu0aRgOdkLrTAILYe0Tv8w1FZidLjzOBXvueQU8rkCgrdp31vxAnBoX+PvFrXdLdpeIreKxkgRD9tsaM1yBh9JxkAg9IlaMNIhb6HUWyb23fRzIeYyEQW0ZqVcEt0egEzZEqAcUtWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716975225; c=relaxed/simple; bh=oy2sM9E9I28X4sqiqOUHF7G+ZKdVaxkvEWZkR6GjuF0=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=ly5NEJbjla1C6m7IKU3OJSP8/Tz1zQrxADLXPUlrTO5uYXZx6WyZktOVHk0/oQGpvjxakENJQCKTlcuRxbstFGTJzmwy/WBF7ch2YBuFv8iQotE1RCwX2U3dXt+36ltaOh2bdHJxlvS4YWoeaiIC4a1UROKUHAC6kA+owNVJLek= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--davidgow.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=MTXWrx/T; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--davidgow.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="MTXWrx/T" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-62a1e9807c0so8739567b3.0 for ; Wed, 29 May 2024 02:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1716975222; x=1717580022; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=A7jFrnYLPr4qszl6iKNvj0kihvPlgpEbfCiq9QGfEb4=; b=MTXWrx/TTOh848PoKDFOKcbzSm4J7/r3PgJgTCHMO39eD3Y3rPafClGBFLxNwLIKIl ZVoKygkl5y3QGNEUXnSehKMDWhimYfp0BXOq5F5srZhNKrWQoz55dc/6LAB58sYviqe7 biI6qejfRn1ZZ/6aOQWl818S4FXbOu1Lb/wAy9t09iMJCvJA3pIZbs8TY0mHWYa7AeSK QwcDnRGkxX0EJe11Oz2bv5izfdC0x14jTr3EvqwBu7bL2GuGlqLdzVCwQck2bH74K5ir qKHiAHnwm+C1q2FtaNvrZsZfEEP5DO61tTFDhnhbhpWuD9P609zb0RaKvgHNpHy7u0Il ayvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716975222; x=1717580022; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=A7jFrnYLPr4qszl6iKNvj0kihvPlgpEbfCiq9QGfEb4=; b=kvY4+v+T1vWiNRfP0OH/GkCjwNyAtiwM2tSTbhU9he4Ze1TLy49ypLUfIKVtjrI1jP 21mSRBJEgmw4NO/zTAFx/r5I7Dy90+uLiu64Vl/kSVkIiNoyHafqVs7nolxiqApc9da/ LhI7O717KIHiFgOcg+WBq3bZ5qmQDpRESJxDBm5zVgHetlj5gmKu7p+WnJWvQjDzZEKH VelhWft1lZmSEnBNw7FiFxdNeYdwN5CrsFaQ8XkT29BFOiJtIdawLSGv6EpuUGfV9/wD YgBXggt10Ryw8AbzjLp7yNYgZzGWr/tO5L7RL56+WKKy+DVEHUj4/+pA9kgrMMfZAMey sDBA== X-Forwarded-Encrypted: i=1; AJvYcCWKIIjzCkt1DwhoZ5ecdAS+cqvcYJKkbusBhrwGlK5bk1Tgcf1It9lhC+1e9vt9MHzBlGQ9gK+7ruMg4rMr6Br2co588fyRFC6FIYT+uS0= X-Gm-Message-State: AOJu0Yz5ve5EdyjfRltXPpYq3h+vPmacG9iA97EWcexloWw603EtH5BV vBUfDIbCmyTYw3jWn6xMYQK8vMlJGY/Ub+YGYHXrwtlk2+Nt491kpBix3oVzRjR5cX0sFk5zeuz W/T47ffZJFQ== X-Google-Smtp-Source: AGHT+IHxdg2ya01s660665HE7gx0TzIhtq+AMegN495R/PRhtdyxXJThsqXUppWR5I/ihiLisAVQ7G09XOsdQg== X-Received: from slicestar.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:20a1]) (user=davidgow job=sendgmr) by 2002:a81:924c:0:b0:627:edcb:cbe2 with SMTP id 00721157ae682-62c5d5d451bmr2897097b3.5.1716975222191; Wed, 29 May 2024 02:33:42 -0700 (PDT) Date: Wed, 29 May 2024 17:33:35 +0800 Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.45.1.288.g0e0cd299f1-goog Message-ID: <20240529093336.4075206-1-davidgow@google.com> Subject: [PATCH] arch: um: rust: Use the generated target.json again From: David Gow To: Rae Moar , Thomas Gleixner , Ingo Molnar , Miguel Ojeda , "H . Peter Anvin" , Masahiro Yamada , Jamie Cunliffe , Catalin Marinas , Richard Weinberger , Anton Ivanov , Johannes Berg Cc: David Gow , kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-um@lists.infradead.org, rust-for-linux@vger.kernel.org, x86@kernel.org, Wedson Almeida Filho , Borislav Petkov , Dave Hansen , Alex Gaynor , Boqun Feng , Gary Guo , "=?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?=" , Benno Lossin , Andreas Hindborg , Alice Ryhl Content-Type: text/plain; charset="UTF-8" The Rust compiler can take a target config from 'target.json', which is generated by scripts/generate_rust_target.rs. It used to be that all Linux architectures used this to generate a target.json, but now architectures must opt-in to this, or they will default to the Rust compiler's built-in target definition. This is mostly okay for (64-bit) x86 and UML, except that it can generate SSE instructions, which we can't use in the kernel. So re-instate the custom target.json, which disables SSE (and generally enables the 'soft-float' feature). This fixes the following compile error: error: :0:0: in function _RNvMNtCs5QSdWC790r4_4core3f32f7next_up float (float): SSE register return with SSE disabled Fixes: f82811e22b48 ("rust: Refactor the build target to allow the use of builtin targets") Signed-off-by: David Gow --- arch/x86/Makefile.um | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um index 2106a2bd152b..a46b1397ad01 100644 --- a/arch/x86/Makefile.um +++ b/arch/x86/Makefile.um @@ -9,6 +9,7 @@ core-y += arch/x86/crypto/ # ifeq ($(CONFIG_CC_IS_CLANG),y) KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx +KBUILD_RUSTFLAGS += --target=$(objtree)/scripts/target.json KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2 endif -- 2.45.1.288.g0e0cd299f1-goog