Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp512918lqb; Wed, 29 May 2024 02:33:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXTK9Yy2gYdAS7DG4stzYYiY27K/ULFS4c/wVUvfF3Z/Wbv8EglLuzXBEVQXY7om30GTGvHd2+vuaFVBAcpuXl6dMYmlCTyRu8kLTQNKw== X-Google-Smtp-Source: AGHT+IE4/vV0qecAf8DT+v8+xnSDWmvLFkigDeBHUb2kqqSQsdmJxLFrGeO6TE1FnmqClnCx28Sb X-Received: by 2002:a05:6a00:1c83:b0:6ea:f392:bce9 with SMTP id d2e1a72fcca58-6f8f3185033mr15648966b3a.15.1716975230268; Wed, 29 May 2024 02:33:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716975230; cv=pass; d=google.com; s=arc-20160816; b=NGc9Wv03frcyT0kaSho4bZXnDpN23ZnSW5r27CXJlMAb3uLungTv5Dd07STibAnDau AqzfKogITJ2wXMeFqrriUh27BdVRtZ5fPY/ADRNNfXeLKM+bkEqvQkLmVFSSKsCmxjxh 4qPjRI/Rfot+NdxUrjHeCqrS/ymLSox3wunF6Cdb6NSTerY9if+XoZyfpuD2yHO15CMf i+TaH2IkLTzNK/5qpFkOhrhNxI5xEqjmDloHWjHhuwwuOWC0zIbYPwW7O5EN3qtTcf1a MYH+/QhPOaaJy2X+AAE99Sl/01qJ1VdnKSp3TyTzFF7WOYKNpSXPh3fEjjWz84vVu9CM 3YNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=A7jFrnYLPr4qszl6iKNvj0kihvPlgpEbfCiq9QGfEb4=; fh=/AXPP0EPXLMO6s9dwArQfpq5eNs0oFQH/hKm+0NLjY8=; b=OT6gcYN+wO0flCwj3d2jbC5HNfsSHyPje4dFMuh+YsBVHYhhdQN9ZHf1xKKPf22Fs6 Wg9vw4EqkynLDsSRxN14Ui71rhVedIW57vP6BOJMtz/rirwrFbr0GMZ/EkpBInWrWxti MqavVYd3KeS2iBHDfGQAwU7Xciw31F7yPMDukITruOBe+el1tIQegbTcVkfJez7h6aEn +Sl0RYmxhQQdPg/z/L0nxf3Goc6heQSlNc2w4DrRYBFT1frTDW2pPQErWl0w/qV8STFx TtAMLQMHWBLF+b13Tv22jVNB4R+RfDLvL2ikgr693IaD2bZf+6w5vCFT+t2c2D0jynEq Y55w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="MTXWrx/T"; arc=pass (i=1 spf=pass spfdomain=flex--davidgow.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-193850-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193850-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6822779bc55si9879280a12.346.2024.05.29.02.33.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 02:33:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193850-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="MTXWrx/T"; arc=pass (i=1 spf=pass spfdomain=flex--davidgow.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-193850-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193850-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C07162876AA for ; Wed, 29 May 2024 09:33:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 51C26169AF3; Wed, 29 May 2024 09:33:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="MTXWrx/T" 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 1F94B15AAB8 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=1716975224; cv=none; b=u4OQ9N/e0g5fPNeb/IwbBhdvs8s1EFaQCWQenhQcnw52bNpYZsnauU/v56kD/opkRYwvnoH8ymsZDyZWtO3s2lTSgFQ4JoOuA0DkdSFd4VG1CDI/Y3XOoRxsCDJeQkE+8RwRaAnjpgJi3lcpKMB1gbAMjSYW/R4eqH5PI6vCoyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716975224; c=relaxed/simple; bh=oy2sM9E9I28X4sqiqOUHF7G+ZKdVaxkvEWZkR6GjuF0=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=qFm2H8WX38G2gn64PwW3zlOiaIorBm50zfo9/AlP/g70oUA381PcJtlrPvm+OlwL9xwDos9qEm8o/TtkHPemR+oc7+DN89rvTcZNKsXXCThZYsbMJLMGw4gaxicQCdwFda6z+jXwUMnBhUjJldfpNswXMSyIqrfTLtUQOT/WwuM= 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 Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-62a3dec382eso7726667b3.1 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=bx49m4ZGREwgwAPTjc1R7ophnzVfvK76dObrusvxsrxFwNScvWyxIp92/2ew7U/r76 FAR9HG60OERGmU+uE+x2vmOMmDPdaOEt1M2CreCA5wSu6KmnYLVW9QLudPbXN979KmJU gb9oW29pLx/9L7AdBeMTJDPHk5UAZJDRPD/MN7EN6konX+OF0hhp/zecIu8piwHPZ7wM k/c7x1ZT6h/E8I6FSsqAPshWOp1IRfYBZib9wqirGEdfgEUTYRTzRbEwmF+28dC0CGLL aDKJ4WReMF92n+qx+ve2Nm8J2GkI93AWi4kksif/01TxXESON9KCMfkPDNqrHWzXODbi 5zKA== X-Forwarded-Encrypted: i=1; AJvYcCUJigQ3LdSMyFS44Hi67aGtGiZ2nNmHS6p6Mz9jyEl9kjR94xLyAEfizmlw9ltIC9r/CO4CfTsXddjlDnxE0M+qdo++Rkcx7SInPpVZ X-Gm-Message-State: AOJu0YzS8W1CZhbW3SOCKnbdcNl1BGOp2miYS0f7K6POZRhbE3MD1Mft XXivYEdAvJN2tT2L8X2gtwbTbSTrCPIDwIOBpg8pe+7K4WTx0btCvHddD0dYay0CdsDdLD7xZWw F8D83UpcIww== 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: linux-kernel@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