From nobody Fri Dec 19 20:10:28 2025 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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 8560330F95A for ; Thu, 4 Dec 2025 07:55:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764834926; cv=none; b=r24x4uUp79JzPQr7SlMTV6iz89Drykn5oIWyJDCEjoAgeGA4+gzwbo3DZitzlHFzXEfJ+u2W1mjZ3wap8DOrSkc1Y3o2LfuZdDXd9FPLXDXJKTY95mDFZ/jD2bIOcV1l/MmkaqRrhHhbmscXb5c6/9mrEXa7OE1Vx8SCb7wHmus= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764834926; c=relaxed/simple; bh=djzz99/Nqr+mam54feyNiv1NIFjqDBU6RJYwqgkk4Jc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pb+GkhG5Z3vJKK+xw8D8vHwVnrs0C0TR7/fvnU3Okgib2SQdgNwkTTCoX0TyPEF4oaiOUfGBWIZNx8ypfBav/rF4l50npxUWGAX5sbWtiKF9W6C5tJyDf94Jj/JwpKv/APg9VWh+/6fjTvvlbJGtmzbgyArvOPNsTCXv6do1qv8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gMmZMkhV; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gMmZMkhV" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-597d712c0a7so362385e87.0 for ; Wed, 03 Dec 2025 23:55:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764834920; x=1765439720; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Z9GtPr5taZTAzyn89OMPpDe+uAgwZM83gWeHrAtje3E=; b=gMmZMkhV3vs3n0FzsHdafB2Msqyg9ZJ0fYcxNrh6CCd1JJO0wmLYPlkeHxCrOESGxj gpYHcTzstePF3OyQBeLzh4J8xUrUtRPRBHtgbH3q+h0joO1xUGRu8lUbJ2M22LmvojSL Ma9n2w0UdDeDTbZSbSQkxtsJINRMCa3EVdLaEVLdKQJw0ioTg0iWrTJn/Z7QfTRBqXn0 8v3aZXApN6JlkNOJ7djlKftiv45U44scS6biKtYhhb6XGb78XeUyiRBvaDPbOEFdx6oh RzixmN6xb/NLTtm4EG8XXxjY32pzmbDJixcaHmRQ3Ta6lvJ0vQmmESwlTlIB2hwRGH6f Y0Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764834920; x=1765439720; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Z9GtPr5taZTAzyn89OMPpDe+uAgwZM83gWeHrAtje3E=; b=kl0hW3wAw6DrBwd/mEq19S6RvJMHCkq5PTFvSaHss8r5PdQRtRHHqCxlcRpff4/fbe VqFlUZzwjV6qZPqkR8UPGrUkCacejQ9q+ilQCCCkboBeLFqiZ3T5UEyyCk/MR/Rr4uvd 8DdAJz0RJZk/8SZIUEEDgCkke+dh+NzAhpWm2UMl9SxoOZ+6xBaBhZ09wk4YEXwVGwKO rr4ahs7o5V00i2b2spqPiki1JuQC3eT/VW4VBqjgF6AK3qGJdtJFC5fYGrUVbvGSfuxx 82G+Y0vNWoaDgKCEF9tOhvm4xaZ2oOBgOFNaASMWXbz/aQohIwA8w/lNTd+b2HZdoeAI WjxQ== X-Forwarded-Encrypted: i=1; AJvYcCVteUoieijhb8q/uhI4E8+M2Hqs2hXTME3Vm+S/AFoJLpEZMDzIA2SRHWJ80DFnwgNkz+qIA//n7JtJNno=@vger.kernel.org X-Gm-Message-State: AOJu0YzJ9XExAh522X2eJ0n2bNPe6zdxYX/0l/8lhh+8B5MxrPe6haqO MMrDu8rAWDbBmB5W+rIlQGypBQmiRtW84HIg5Cj5ZLhSKqiN0BMg1pNm X-Gm-Gg: ASbGncszf9onva80tiGdUfJXhHzwPZukIRosJUzLMukDFn2mGThMvyS8rM8bMqP25kB GCPF7NVdvpewhQwPr9O0pagwVvIc5GCfJdwsXPj4FYwIyEA1KE6WKwDHXUPjhzVBOvfWr+wr6WJ hg5KNpo5v8D5WnKWE+zx4vG9CuPRmYeakvP6UyKnfXAX1E6c+6Ktdpkx2kLfe90C7YSYnHFEkUt MScaZZAUBe4qONpnT9GWlks98O8V/jv0toAesv3O0QKhbXEy6cnIl18eDl9HkdHGWoI5tHruI8l sI/qkPSH3C8EXFluUK38gFtoKPqngKUjhe7b1ULX2oeegB3DEay8x/4l2iJqp8438bnf/xTpgjX klDiw7oonRRCCucSgJbs0kkqVYkOMQKk8CyvU78qf54tCeO5O230Hxlc3KUv/KEDRGBdUEQ== X-Google-Smtp-Source: AGHT+IEldMEBa+Y+2+8e9BBmMa+iraf8wmEl/ZT2sdU4A9p2jyG2tZG76w7egCqyyaaevWjMOuPaow== X-Received: by 2002:a05:6512:3c9c:b0:595:9d6b:1175 with SMTP id 2adb3069b0e04-597d3f27914mr1982243e87.14.1764834919940; Wed, 03 Dec 2025 23:55:19 -0800 (PST) Received: from minun.felixc.at ([2a01:4f9:6b:1cc4::2]) by smtp.googlemail.com with ESMTPSA id 2adb3069b0e04-597d7c28019sm239190e87.69.2025.12.03.23.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Dec 2025 23:55:19 -0800 (PST) From: Asuna Yang X-Google-Original-From: Asuna Yang Date: Thu, 04 Dec 2025 08:54:51 +0100 Subject: [PATCH v5 1/4] rust: export BINDGEN_TARGET from a separate Makefile Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251204-gcc-rust-v5-v5-1-2d4f20d86c24@gmail.com> References: <20251204-gcc-rust-v5-v5-0-2d4f20d86c24@gmail.com> In-Reply-To: <20251204-gcc-rust-v5-v5-0-2d4f20d86c24@gmail.com> To: Nathan Chancellor , Nicolas Schier , Miguel Ojeda , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Nick Desaulniers , Bill Wendling , Justin Stitt , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Jonathan Corbet , Jason Montleon , Han Gao , Conor Dooley , Vivian Wang Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, llvm@lists.linux.dev, linux-riscv@lists.infradead.org, linux-doc@vger.kernel.org, Asuna Yang , Asuna Yang X-Mailer: b4 0.14.3 From: Asuna Yang A subsequent commit will add a new function `bindgen-option` to `scripts/Kconfig.include`. The bindgen backend requires the `--target` option for cross compiling, but variable `BINDGEN_TARGET` in `rust/Makefile` cannot be exported to `scripts/Kconfig.include`. Therefore, move this variable to a separate new `Makefile.rust` file and include it from `scripts/Makefile` to make the exported variable available for use in Kconfig. Place the include in the `need-compiler` branch to avoid including it in irrelevant make targets. Since the new file name is `Makefile.rust`, it matches an existing MAINTAINERS rule `scripts/*rust*`, so no modification to the MAINTAINERS file is needed. Signed-off-by: Asuna Yang --- Makefile | 3 ++- rust/Makefile | 8 -------- scripts/Makefile.rust | 9 +++++++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index e61f1300fea0..bdbf2025e68c 100644 --- a/Makefile +++ b/Makefile @@ -718,9 +718,10 @@ ifneq ($(findstring clang,$(CC_VERSION_TEXT)),) include $(srctree)/scripts/Makefile.clang endif =20 +ifdef need-compiler +include $(srctree)/scripts/Makefile.rust # Include this also for config targets because some architectures need # cc-cross-prefix to determine CROSS_COMPILE. -ifdef need-compiler include $(srctree)/scripts/Makefile.compiler endif =20 diff --git a/rust/Makefile b/rust/Makefile index 5d357dce1704..2603b34f9833 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -385,14 +385,6 @@ bindgen_skip_c_flags :=3D -mno-fp-ret-in-387 -mpreferr= ed-stack-boundary=3D% \ -fzero-init-padding-bits=3D% -mno-fdpic \ --param=3D% --param asan-% -fno-isolate-erroneous-paths-dereference =20 -# Derived from `scripts/Makefile.clang`. -BINDGEN_TARGET_x86 :=3D x86_64-linux-gnu -BINDGEN_TARGET_arm64 :=3D aarch64-linux-gnu -BINDGEN_TARGET_arm :=3D arm-linux-gnueabi -BINDGEN_TARGET_loongarch :=3D loongarch64-linux-gnusf -BINDGEN_TARGET_um :=3D $(BINDGEN_TARGET_$(SUBARCH)) -BINDGEN_TARGET :=3D $(BINDGEN_TARGET_$(SRCARCH)) - # All warnings are inhibited since GCC builds are very experimental, # many GCC warnings are not supported by Clang, they may only appear in # some configurations, with new GCC versions, etc. diff --git a/scripts/Makefile.rust b/scripts/Makefile.rust new file mode 100644 index 000000000000..5c12b4b8c8b6 --- /dev/null +++ b/scripts/Makefile.rust @@ -0,0 +1,9 @@ +# Derived from `scripts/Makefile.clang`. +BINDGEN_TARGET_x86 :=3D x86_64-linux-gnu +BINDGEN_TARGET_arm64 :=3D aarch64-linux-gnu +BINDGEN_TARGET_arm :=3D arm-linux-gnueabi +BINDGEN_TARGET_loongarch :=3D loongarch64-linux-gnusf +BINDGEN_TARGET_um :=3D $(BINDGEN_TARGET_$(SUBARCH)) +BINDGEN_TARGET :=3D $(BINDGEN_TARGET_$(SRCARCH)) + +export BINDGEN_TARGET --=20 2.51.1