From nobody Fri Dec 19 20:32:56 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0892B19AD5C; Fri, 14 Nov 2025 13:44:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763127846; cv=none; b=Vbe81RswvWCPdTPZMkMSWnrvhlxVtQdoNlFfd94OmZqW4wP6S/86ZkwXtG+xCvxy44CQOQaiXwKOJpLWKvuXzgydHXkOcGbG7pSj9B075kWUCL7EcSfsVdGjulgvp5jSl3vEZ0aDKpNQSxKiXNHFeQmQlebkT9SBz6oFwiuUMAs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763127846; c=relaxed/simple; bh=ridHJFhLRQMLTPgJCQ9HyR305XGZNw1pWnOs7cDr3NQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=X+oYKs2oGPN4Ql24gPosRM9x/sdU76NElp3rDggiksZ4vp+bgKtKHUv8hrPTFoVeIEgGBT8jMSmaPUVuQlPrAGqx1S2ge0kBh0jTCrgf6ovmr8jRNgXNkU9nwv6mgE2O5xEwQWGiH3z1NJMWkLQWaXbE2IH44bFWs06mTSwOez4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=o2Ng2v6q; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=z9P48ICb; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="o2Ng2v6q"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="z9P48ICb" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1763127843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9WvY3nQae8dyQgGN5IEubkD3c/BJ6GPPyQv+TucbTOo=; b=o2Ng2v6qL2ax/jgVEPVacAWyqJ8/EEHdjfzSMstVi29mdD/b1Jfg/quaOmprOYZXfSSJjH v3LIe1YdQTPAp78s7142HWZdmkvN+5nWBhR5iJh7dEm91y0YB580BkRtg2zAsLwHu4pkAC oEcU4YL9Y7vnTj5wU/y5549MZklvrkhRysppZ0WCpJtsfFSVHNFbqAmLo/+CUJ+EGFESbN cmg8OOhlyid/IQ+pBo6EiqI8nMfqCH4L3E0dxF8PK4tsCpg5KQd2S6V/nh29x415qjz6nO 5EihTmekuy5+WpDtTaoxf1apvRtvhkq9aEg+14KbVm8ruvSfxoY2nGFLcyul3w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1763127843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9WvY3nQae8dyQgGN5IEubkD3c/BJ6GPPyQv+TucbTOo=; b=z9P48ICbD6N8VFTdyrwYxOE+1CcQfm/sPt5VpSl6O3ztj2Lx9FvWYqmy22CDtsufcoLjkK 01gXBe9Jt0jZmqDA== Date: Fri, 14 Nov 2025 14:43:56 +0100 Subject: [PATCH v3 1/3] kbuild: don't enable CC_CAN_LINK if the dummy program generates warnings 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: <20251114-kbuild-userprogs-bits-v3-1-4dee0d74d439@linutronix.de> References: <20251114-kbuild-userprogs-bits-v3-0-4dee0d74d439@linutronix.de> In-Reply-To: <20251114-kbuild-userprogs-bits-v3-0-4dee0d74d439@linutronix.de> To: Nicolas Schier , Nathan Chancellor , Nicolas Schier Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1763127841; l=1584; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=ridHJFhLRQMLTPgJCQ9HyR305XGZNw1pWnOs7cDr3NQ=; b=fQASWlA8C4eSuXw0skVJNZrPvx4hDybJDOr84s0xBsN1nAFHZ2RaVsRWzkHusa0HaAsDSQi0q 5pGdf81mYT0B8HerMgEu/upDD2RmkZ+S7rszIJaHhn38ibTbnUFSkbF X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= It is possible that the kernel toolchain generates warnings when used together with the system toolchain. This happens for example when the older kernel toolchain does not handle new versions of sframe debug information. While these warnings where ignored during the evaluation of CC_CAN_LINK, together with CONFIG_WERROR the actual userprog build will later fail. Example warning: .../x86_64-linux/13.2.0/../../../../x86_64-linux/bin/ld: error in /lib/../lib64/crt1.o(.sframe); no .sframe will be created collect2: error: ld returned 1 exit status Make sure that the very simple example program does not generate warnings already to avoid breaking the userprog compilations. Fixes: ec4a3992bc0b ("kbuild: respect CONFIG_WERROR for linker and assemble= r") Fixes: 3f0ff4cc6ffb ("kbuild: respect CONFIG_WERROR for userprogs") Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Nicolas Schier Reviewed-by: Nathan Chancellor --- scripts/cc-can-link.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cc-can-link.sh b/scripts/cc-can-link.sh index 6efcead3198989d2ab2ab6772c72d8bb61c89c4e..e67fd8d7b6841e53341045b28dc= 5196cc1327cbe 100755 --- a/scripts/cc-can-link.sh +++ b/scripts/cc-can-link.sh @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 =20 -cat << "END" | $@ -x c - -o /dev/null >/dev/null 2>&1 +cat << "END" | $@ -Werror -Wl,--fatal-warnings -x c - -o /dev/null >/dev/n= ull 2>&1 #include int main(void) { --=20 2.51.0 From nobody Fri Dec 19 20:32:56 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60CC4318149; Fri, 14 Nov 2025 13:44:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763127847; cv=none; b=EjIbBff7BwASnXBKIvSUOvEnb6+pN3nC3E7fH9WtnckMcLIijuTptoEr6D6CT9UAKsh0wqOidocYEBgeZizccEh8xU39WPZNpnfB2fWsTmOTtKwYqQWGP9XVar7/q6BSxti/bSmlW0h/HYVQE72e+dHSK6XOJxO70RY3c4A9SP0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763127847; c=relaxed/simple; bh=F9+bT7WGGhOu7vvM1k3Uh67zlzwYn46SB/5xKsPbNtA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Gj1VGig5wMWHZUScu59XW8iLLPUtIbcC8HLHNkGUsGC0FI/fsqZZ7RVgNjRZc0p4dajl1TH2Eyz9jx4lV1gTHgu15ZvtlGNFaJXNXJttkk4wQSQ9yqkIEHxqfQEFASUA9KJndN/ZbWEyIs+bkwsAEkw6dZfTvSYyjqr3yV1ssI4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Nih1bq1L; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=F8VjkUBJ; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Nih1bq1L"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="F8VjkUBJ" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1763127844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xCUSR2noC5KFG4M2iA9U8Wbo/VK0eLEL0lAZQ5ZJtFc=; b=Nih1bq1LZ5MdTqkaav7UJq/SEYfw9/7kSjLc7hyp5hqP0rb3K89IubjyINizFvKP1mhUKQ z7H1TE4jcdg6YPvVSJqgYgiLNZ48/mw2P/6iGTDhdEhGre6GJlfGXOUDstij7BDTJswuSL 9eF7mCX86sHTZMEKb+KZwLb8tviAzJBRDeNn6PKQdWEzNvwaQXd6N/MhtkodZIOB3uv2HB q/uBJiH4sU4s9pT7rtOIB0hU6lDLH4ZDyD1fWNdnASqhLv6ZW15w/c3DDz13scXY9m7wqe 3SKkSaL38HbvUQs2KwGG+2FWitHin+Zn6BxvAQ5csAxZYpId3gBBRjBEfTOBQA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1763127844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xCUSR2noC5KFG4M2iA9U8Wbo/VK0eLEL0lAZQ5ZJtFc=; b=F8VjkUBJqepH3TR1KNI0JgNdy1fOunHkFLZRfcBdp+MceW6wL2qAu4fv3re38QlQTxrsyL d4/RvHDhXQo/qSAA== Date: Fri, 14 Nov 2025 14:43:57 +0100 Subject: [PATCH v3 2/3] init: deduplicate cc-can-link.sh invocations 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: <20251114-kbuild-userprogs-bits-v3-2-4dee0d74d439@linutronix.de> References: <20251114-kbuild-userprogs-bits-v3-0-4dee0d74d439@linutronix.de> In-Reply-To: <20251114-kbuild-userprogs-bits-v3-0-4dee0d74d439@linutronix.de> To: Nicolas Schier , Nathan Chancellor , Nicolas Schier Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1763127841; l=1918; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=F9+bT7WGGhOu7vvM1k3Uh67zlzwYn46SB/5xKsPbNtA=; b=blM0JHxbLMB+1l7XXODqi0bopk3bmXGtJha1HKFTUSjNl/aYla6NlS1MAcVxhMOnBZLINOtHC gkhIHmpsPOLC6ek67asb04yGbYjJpjnscHsTAxixtdsn0V0pTfra/FW X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The command to invoke scripts/cc-can-link.sh is very long and new usages are about to be added. Add a helper variable to make the code easier to read and maintain. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Nicolas Schier Reviewed-by: Nathan Chancellor --- init/Kconfig | 4 ++-- scripts/Kconfig.include | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index cab3ad28ca49e7ac930207c9cde8d431d55dc7af..7b722e714d5c5a0580467914b22= 6dc0700ec0797 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -84,8 +84,8 @@ config RUSTC_LLVM_VERSION =20 config CC_CAN_LINK bool - default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) = $(USERCFLAGS) $(USERLDFLAGS) $(m64-flag)) if 64BIT - default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) = $(USERCFLAGS) $(USERLDFLAGS) $(m32-flag)) + default $(cc_can_link_user,$(m64-flag)) if 64BIT + default $(cc_can_link_user,$(m32-flag)) =20 # Fixed in GCC 14, 13.3, 12.4 and 11.5 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113921 diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include index 33193ca6e8030e659d6b321acaea1acd42c387a4..d42042b6c9e243b46d1626d892c= 0c986621ce462 100644 --- a/scripts/Kconfig.include +++ b/scripts/Kconfig.include @@ -65,6 +65,9 @@ cc-option-bit =3D $(if-success,$(CC) -Werror $(1) -E -x c= /dev/null -o /dev/null,$ m32-flag :=3D $(cc-option-bit,-m32) m64-flag :=3D $(cc-option-bit,-m64) =20 +# Test whether the compiler can link userspace applications +cc_can_link_user =3D $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(C= LANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(1)) + rustc-version :=3D $(shell,$(srctree)/scripts/rustc-version.sh $(RUSTC)) rustc-llvm-version :=3D $(shell,$(srctree)/scripts/rustc-llvm-version.sh $= (RUSTC)) =20 --=20 2.51.0 From nobody Fri Dec 19 20:32:56 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E50531C56D; Fri, 14 Nov 2025 13:44:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763127850; cv=none; b=EsEf2F26wAy/zUdH6y5w3KwHuU1yEAstor2IQUHs3Fsx+eRcyZfyEFaJK16V4eZFq3mowddDsbkpQr+xJk3Ezq3nQkJ1E/bcsOj8X+0EklL/X422NMI4WFM/TXi/qhX4/c8BZRxot7t3DQzHt03iSURDyLH1BXws/z3ohc0qZgE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763127850; c=relaxed/simple; bh=rcMnsX+Vh0ajIFhxLjMhfH8p4M1MQ2IzwPyJNkmsGaI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=T5atw+QMbiiVaLNvEoCzr9A/1OstXfcGYYdxW+i8GQ47hNwH387105cS8HZ5/IRWFTyJUlYGiZCmaQ9mZ6Oo/t96WGhHNtmDZawiugnBjNMQlh+ULrk3CRX45Y2HwCBz+xpAw/ZblFs/RM2xQnEkWIzd7hHLN4ZNVCpX0yTcfLQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Irm7vNu6; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=EYFv4yzM; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Irm7vNu6"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="EYFv4yzM" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1763127847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vwc56hjtuazj/+GR6nUE0ZFLKGkZMFAF/H+hEEe0//M=; b=Irm7vNu6Whb0e2SZ40WXLxCCBvASPli0FbFV/DMbxznyqGbuYlNRvu2zTH9yCBAVLOfKNY sfv5lHB83OF5LRq2qKxOdTuv0uMQToVHUYxQVIo9dKfwTo9btn8ChyZDQL65yJELMqwG+2 wiFNVj19Va5I+3DeQiB4vtJPolp6RG6/FtYE/4wgmAu7YJzFifNh0EYKeorM/FfxuhfjiZ Tf+PVeTMhkAU8iJmRdPWA0oZdvBIgLyS4grj+tDj9q5Lfm0G7nofK0pc4pj5+5FCah0wgu j3jKdhE3lcv6Umjhkc2V6uQmceUw5cxW/+67R6V6yDECw/BQVHbYid01ZHiKrg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1763127847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vwc56hjtuazj/+GR6nUE0ZFLKGkZMFAF/H+hEEe0//M=; b=EYFv4yzM4KUYMkL0HGGUr9zboXL9nrMewaWyFgRR+kdPx4Xqi27ICWnFqcUQgDuGcwrjgB sMYj0wS1IQ7jl0Cw== Date: Fri, 14 Nov 2025 14:43:58 +0100 Subject: [PATCH v3 3/3] kbuild: allow architectures to override CC_CAN_LINK 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: <20251114-kbuild-userprogs-bits-v3-3-4dee0d74d439@linutronix.de> References: <20251114-kbuild-userprogs-bits-v3-0-4dee0d74d439@linutronix.de> In-Reply-To: <20251114-kbuild-userprogs-bits-v3-0-4dee0d74d439@linutronix.de> To: Nicolas Schier , Nathan Chancellor , Nicolas Schier Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1763127841; l=2338; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=rcMnsX+Vh0ajIFhxLjMhfH8p4M1MQ2IzwPyJNkmsGaI=; b=EtLegc3uyI194hw+XnBdz/rKTZqcEoYt1DqUpPRvM2dqbBs62WV1ZYof0zQoQbhWCXwFnIHS5 sSqIJEYGaqnAibE1cFvjWr9JsaMDPyKbsOsUWDo+TcoGk1bfi8Iaet4 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The generic test for CC_CAN_LINK assumes that all architectures use -m32 and -m64 to switch between 32-bit and 64-bit compilation. This is overly simplistic. Architectures may use other flags (-mabi, -m31, etc.) or may also require byte order handling (-mlittle-endian, -EL). Expressing all of the different possibilities will be very complicated and brittle. Instead allow architectures to supply their own logic which will be easy to understand and evolve. Both the boolean ARCH_HAS_CC_CAN_LINK and the string ARCH_USERFLAGS need to be implemented as kconfig does not allow the reuse of string options. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Nicolas Schier Reviewed-by: Nathan Chancellor --- Makefile | 13 +++++++++++-- init/Kconfig | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 17cfa11ca7163aa3297101ceb3c9e85f4878f12d..36e7154c66cbd4772883a84d576= 76c615e4480a3 100644 --- a/Makefile +++ b/Makefile @@ -1134,8 +1134,17 @@ ifneq ($(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS),) LDFLAGS_vmlinux +=3D --emit-relocs --discard-none endif =20 -# Align the bit size of userspace programs with the kernel -USERFLAGS_FROM_KERNEL :=3D -m32 -m64 --target=3D% +# Align the architecture of userspace programs with the kernel +USERFLAGS_FROM_KERNEL :=3D --target=3D% + +ifdef CONFIG_ARCH_USERFLAGS +KBUILD_USERCFLAGS +=3D $(CONFIG_ARCH_USERFLAGS) +KBUILD_USERLDFLAGS +=3D $(CONFIG_ARCH_USERFLAGS) +else +# If not overridden also inherit the bit size +USERFLAGS_FROM_KERNEL +=3D -m32 -m64 +endif + KBUILD_USERCFLAGS +=3D $(filter $(USERFLAGS_FROM_KERNEL), $(KBUILD_CPPFLA= GS) $(KBUILD_CFLAGS)) KBUILD_USERLDFLAGS +=3D $(filter $(USERFLAGS_FROM_KERNEL), $(KBUILD_CPPFLA= GS) $(KBUILD_CFLAGS)) =20 diff --git a/init/Kconfig b/init/Kconfig index 7b722e714d5c5a0580467914b226dc0700ec0797..4a2ae3cfbf26525a60936d9b29a= 74ef4319ba3a5 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -82,8 +82,12 @@ config RUSTC_LLVM_VERSION int default $(rustc-llvm-version) =20 +config ARCH_HAS_CC_CAN_LINK + bool + config CC_CAN_LINK bool + default ARCH_CC_CAN_LINK if ARCH_HAS_CC_CAN_LINK default $(cc_can_link_user,$(m64-flag)) if 64BIT default $(cc_can_link_user,$(m32-flag)) =20 --=20 2.51.0