From nobody Tue Apr 7 12:20:09 2026 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (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 7210230CD82 for ; Mon, 6 Apr 2026 20:02:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775505734; cv=none; b=kXtb/+Aaz9HIuqEZB7pnfzPg/dI9DoaFFmaOA8qUgxMbpyvCL59xacC19sAAbKU/clEeHfXFf6+Bw+W5wJWp/2HlJClwjJ7AQjH3258v3enw+0ojwTsNJWoJANDc7ad00AODrso0qxWLwd/0fVHm2cYH8cBcJYAxm+iwEroYmpY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775505734; c=relaxed/simple; bh=aJyqZgEiU7gadN2ONUZgp8589ILXEazRUR3likQHx7Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L8VOoH0zufhdGrnYqbWIWt9kSTNcO3hckLZnbvqAQcStDZpUcRDsWcnNh9K4HDYoad3+CFYH6Rrx42z2nI8Tt4dVB0mmrg4XV6Yqm3sbEMPmxSKpnE0We58HNJehJRzcFnHWWam2sWQpijyrt4CboDkm4vMcGTwpgsPxUXcPtzc= 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=FDqNAnYA; arc=none smtp.client-ip=209.85.215.181 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="FDqNAnYA" Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-c76c067bc51so1467947a12.0 for ; Mon, 06 Apr 2026 13:02:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775505733; x=1776110533; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lPSLhEO/t1n98OrRH4+WlgtQBOSzWDBbT00u5q2kC9Y=; b=FDqNAnYAoWQ443k7yQ20rTxQHfbZAC2SycKr0Xm+b4F9PwqleirZVhX6dgI5rasgAb 9h1kSHdhBtYpstsX08SGZjPgtYiEIrLf31rt5rbv3HGUbRUwr6cmueUZ1lo5HgtNvcai XqsPnB38vo+Mg0qYC2Mj9gItSf7txD1tb3g2gKMDVqCsGAzXHPimJXuoWsX/f0d16vH7 nlVB4AXy5FmZL40Hxu33SY3+lW9NKPIkdPzwL76bz6jhoi5jPeV1lRG2zqgPxCLCXDCG SNn8UyTELDLF6ONwz4G+c+stD96mV59hKr1vDeIwd6Xayea7UAI+i3xqem+/gGz8zUQJ 78bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775505733; x=1776110533; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lPSLhEO/t1n98OrRH4+WlgtQBOSzWDBbT00u5q2kC9Y=; b=png9Dizg1FEnOf5tcRfU/yjViFv28ldpf0hm6uSVBB5MnHvNmQffYeMt/7A9fwbBZs LcopeDb0UqxAYKUumb24MGBTaRm/8s+6uYYkLlq8YbYchZlUce/IebzWRXOVDowzvdPQ 4dhVfOcrG5ufWeCxGlEBLGok+1V+vZuDH9oxyW6VbZeOETVEZiYEaplXdv2eSQq14H2A PezVyfyajoy7Sntj/mdPQ+eGxTWJMJ7K4qVGEUuv8w+1QJSy3mMyiAhrULQewBwhoLex 0MIewWfWYuvtft3iEbx2ol3oKk3qfIR1nNtJQWlH9Er8NJ+VelPLbrFpE8z48R4BQiaV dWtA== X-Forwarded-Encrypted: i=1; AJvYcCXPRHZRZ5mmNrZO+fX8Wf9xO2gdsgNTSk8l1bCYbi0pT1ofl3wcw9CMrtKy5VXCPcgaOj/euzBWDLM3zjk=@vger.kernel.org X-Gm-Message-State: AOJu0YxPoBJoWUz1b8QdzT/0XI7WuhP0muKQaNqZkzJyCV5DIOX7LCmQ eVr+ZNn0KbDpRReq8Islen6rbxPchZdojl3WfS0uzyq9sdkdINWeq5VQxEdCZQ== X-Gm-Gg: AeBDiet00IM21J1S6/PiQHtbTflnz+xhrCMlidtcnngelWHFJkvHzkVlncbVwR/gl8m oF8n6B9A7+d/e3XyHrorjBzZnkpwG37a9jwnTZCcZBFuB7Di3uveUy8qgKNbiaFukucPMx9oG/f 3FpvshVP4RaN5NkVaNxLe5tpFfgLU7n7SjUAXMfOvvjJQF+g2F/W0rizcLNwUX/9SZUtHfCbcVq yHcjXR8COGdlYmHg2cPsb0xIOhNSIVq511PnF/vHM4roWyRptXxUXN3N3bnLX2YpjdZeq4KTxHu LWCjK2gXNX6iTqPr9CBtqHLxZUoPsLDEF1IFCHHa7L935jIvQ9kTvzwkXfzxdcnJDdr9uVnCy9z LPRyLMZCYWCSuWCV0EtNVwzUhikT7qFY3ucEEpIHEtjxN+kV4aW7/KjSusRaK5qs5nwvz1Uz+xu di5TNhx+xZE8npWan9N1m8rJJqB6oU6hpBPX/EoWDi//gk/nf3GfCAKa+Cn7Kdm6JUXkDudh4e0 Lc= X-Received: by 2002:a17:903:3b8f:b0:2ae:cb0e:fd59 with SMTP id d9443c01a7336-2b28164cfebmr148221295ad.8.1775505732659; Mon, 06 Apr 2026 13:02:12 -0700 (PDT) Received: from li-1a3e774c-28e4-11b2-a85c-acc9f2883e29.ibm.com.com ([106.51.160.44]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b27497af26sm151098205ad.49.2026.04.06.13.02.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2026 13:02:12 -0700 (PDT) From: "Mukesh Kumar Chaurasiya (IBM)" To: maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, peterz@infradead.org, jpoimboe@kernel.org, jbaron@akamai.com, aliceryhl@google.com, rostedt@goodmis.org, ardb@kernel.org, ojeda@kernel.org, boqun@kernel.org, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, tmgross@umich.edu, dakr@kernel.org, nathan@kernel.org, nick.desaulniers+lkml@gmail.com, morbo@google.com, justinstitt@google.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, llvm@lists.linux.dev Cc: "Mukesh Kumar Chaurasiya (IBM)" Subject: [PATCH V10 1/4] rust: Separate host libraries to fix rmeta dependency conflict Date: Tue, 7 Apr 2026 01:31:46 +0530 Message-ID: <20260406200149.3727922-2-mkchauras@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260406200149.3727922-1-mkchauras@gmail.com> References: <20260406200149.3727922-1-mkchauras@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When building Rust code for powerpc64le with LLVM=3D1 and -j1, rustc encounters an error: "multiple candidates for `rmeta` dependency `core` found", with two candidates: 1. The host's standard library from the rustup toolchain 2. The kernel's custom libcore.rmeta in the rust/ directory This occurs because the build system uses `-L$(objtree)/rust` for host library builds (proc_macro2, quote, syn), which causes rustc to search the rust/ directory. During this search, rustc finds both the kernel's custom libcore.rmeta and gains access to the host's standard library, creating a conflict. Separate all host-side build artifacts (host libraries and proc macros) into a dedicated rust/host/ subdirectory and use `-L$(objtree)/rust/host` for host builds. This ensures host builds only search rust/host/ and never encounter the kernel's libcore.rmeta. The `--out-dir` flag is removed from cmd_rustc_procmacrolibrary because the output directory is now created explicitly with `mkdir -p $(dir $@)` and the output file path is specified directly with `--emit=3Dlink=3D$@`, making `--out-dir` redundant. Moving the proc macros (libmacros and libpin_init_internal) to rust/host/ eliminates the need for special handling in rustdoc-pin_init, which can now use the pin_init-flags variable directly instead of duplicating the flags with absolute paths. The rust/host/ directory is added to clean-files to ensure it's removed during `make clean`. Link: https://github.com/Rust-for-Linux/linux/issues/105 Link: https://github.com/linuxppc/issues/issues/451 Signed-off-by: Mukesh Kumar Chaurasiya (IBM) --- rust/Makefile | 56 +++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/rust/Makefile b/rust/Makefile index 9801af2e1e02..d8f34c4858b8 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -3,6 +3,9 @@ # Where to place rustdoc generated documentation rustdoc_output :=3D $(objtree)/Documentation/output/rust/rustdoc =20 +# Clean generated host directory +clean-files :=3D host/ + obj-$(CONFIG_RUST) +=3D core.o compiler_builtins.o ffi.o always-$(CONFIG_RUST) +=3D exports_core_generated.h =20 @@ -27,7 +30,7 @@ endif =20 obj-$(CONFIG_RUST) +=3D exports.o =20 -always-$(CONFIG_RUST) +=3D libproc_macro2.rlib libquote.rlib libsyn.rlib +always-$(CONFIG_RUST) +=3D host/libproc_macro2.rlib host/libquote.rlib hos= t/libsyn.rlib =20 always-$(CONFIG_RUST_KERNEL_DOCTESTS) +=3D doctests_kernel_generated.rs always-$(CONFIG_RUST_KERNEL_DOCTESTS) +=3D doctests_kernel_generated_kunit= .c @@ -49,7 +52,7 @@ libmacros_extension :=3D $(patsubst libmacros.%,%,$(libma= cros_name)) libpin_init_internal_name :=3D $(shell MAKEFLAGS=3D $(RUSTC) --print file-= names --crate-name pin_init_internal --crate-type proc-macro - ; Mon, 6 Apr 2026 20:02:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775505743; cv=none; b=RkXwxVxpo5imAcSIF2QsVbZ+//Mw+LFYynxlPpFa5rFAWJ1q36xCVZSHUMLT7t/B5VLq+Ewz+uTjgmvP2A3bQzK8iOEvqh0TDCcByl/zu9H4FkarzK1cxDjDmfxHa04qf776IWoGCWfM0zvPX4JMDwu3uqdpZNCLML1AeUb3T9k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775505743; c=relaxed/simple; bh=8WQ7jEq8bJBsdnlHGUXrbWXnXrrr5Xxc2+zvN+1cF+Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t2OWSYOLnP6OgH02Jjqa8+Mg5oyUu7qZagSJ69TvQpTWFe0PsabsQpeiesB0i5AjgdGDX/53sp7xX6C5UIQ6SeXgGK1O4atCKlxX3AlEuebc491MVELOYKlNOuGYlcEu9vm4Ssxea7xY7s4w8pmEkquyHirm7hVtKVymzRBqSgE= 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=D4mlnCRx; arc=none smtp.client-ip=209.85.214.180 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="D4mlnCRx" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2a8fba3f769so16614075ad.2 for ; Mon, 06 Apr 2026 13:02:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775505742; x=1776110542; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SIf376OZyXcpY0mdrIrP1nTWV/VE0v5g8114Fjjgl84=; b=D4mlnCRxK/ADlobN0yK0+v8R4+Tw75UB82yOwkLE4f+tNFUxMn9En6rLrLyr4CZv3Y RaCA9F60SA5MBqAx515PgouqFo9lPTUN0LzUVfztyGmTqTBcRC8BSnRvIVK8G2m1NbUW mgMdrjSvVmA9wx9gwAI1FT4usdrwBOxhN+LP+jXrPS9zjZ2Rb4sXtJTbnQsgO2WwTnzn cPFlnqbDk9BAHIQNOL3Ef1XrOPTPTmfL4zzhzW4v1kHHNik+WgRmITtJEn8LjkMAM7Bf hd0FgjPe7+Bnxte09f5HKpmBQyIdebzEE40EbbbZrKvJfw0mJqSKszrNkaGt7U2AWVds ScBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775505742; x=1776110542; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=SIf376OZyXcpY0mdrIrP1nTWV/VE0v5g8114Fjjgl84=; b=EwmGdOQ7KMcwuypZd3+sO77nZsDSl3+3lHMUn/vHJpbukLI/CDFAogKNNamuYdE2Ul PePEGscV3PduzAxQGt4Fo/8KoPBs1/1iBl4fkZyWispEAPIILQc18N2BqGd9JXIkBj+g vsBVs0QIgv85R/LpB+enHa+P0u8VFMYn38nUt3ZSBsQ8abhXiDWG4RZqAo1c8Ilg3XNZ a7gaSkoKtdH5GmmrvW2LelmS3r/r42XhPqXOCWtc/mYkGD1TJ2/pk/4EmyWolhxqmcNq Bwl1+Iol57RUZdq/o4kOWtMDGCi1HJHQjbUkICVM+CoXGJW/bcN+csPKIczrRDUGWqSC 2gLg== X-Forwarded-Encrypted: i=1; AJvYcCXp00Zs1dEe8W2AaMx0G7g1Jtun+bEDuj6nWGJCBfgk2DqYyXWdB7KGk1gPK7yaYj1EmQ9ESluOGjxW8Cg=@vger.kernel.org X-Gm-Message-State: AOJu0YxDyQw+8OZs+78vycG+3DwrMWWJLzyNR91dolJpFmoZ4Yk/EPfM Jmf8zzsGmRlRQ2HHk391zDtLB1gKxSDaSjzlieLuYL8y1EsoBZ77Bc8B X-Gm-Gg: AeBDievQFVHWTApEpSZ3VUIj3eSjamuyLS7h1fkqPzX7ti9flyVO5wN6xuRRJZ+XwUZ HTE8stQOs/8ywxF+l1NmtOox1CvAeSZeKMltNd9/nSEi16hPUZlbMp8ZU0tvfP8Slzdgfxhoi0y Wup5wy4suJZcqX+fpOzJRfyRt+X267oxQPTmV74kBSWD6s1HwtIScv1MsBJpRZv2rwuBHggI3Ja ZdKEVwSk5X+OPETiEg9zF5UQ8TZ8PDD+LU8xTJ16ec6/Sodx3qVbe/7AcEWWYFRNNPL8X8CmZ8I slZfL2d06Y7dGXWIAGn7ffk5c3PyFntZSq+xfV8/GvwUAmc47aJyCLNEgdtj6CwR1LLq5ixKRXf ePb6h9saRMX/JoU1iqjE0N2c5nkv2Hb2q0SqxZWYCXfLdyeQZ7jy9yksX4/6IVeL/ycIsGnw9rq p+9z41P0FrdtulLV3rpujRqHlryXw2xNdUSKymexBO3uakc9VesXJT9R7rfXL0Jx/dKTfPMqM3H q2JOcW+KjJ9UQ== X-Received: by 2002:a17:902:f54f:b0:2ae:5eab:132e with SMTP id d9443c01a7336-2b28173fa9dmr143439795ad.12.1775505741829; Mon, 06 Apr 2026 13:02:21 -0700 (PDT) Received: from li-1a3e774c-28e4-11b2-a85c-acc9f2883e29.ibm.com.com ([106.51.160.44]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b27497af26sm151098205ad.49.2026.04.06.13.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2026 13:02:21 -0700 (PDT) From: "Mukesh Kumar Chaurasiya (IBM)" To: maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, peterz@infradead.org, jpoimboe@kernel.org, jbaron@akamai.com, aliceryhl@google.com, rostedt@goodmis.org, ardb@kernel.org, ojeda@kernel.org, boqun@kernel.org, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, tmgross@umich.edu, dakr@kernel.org, nathan@kernel.org, nick.desaulniers+lkml@gmail.com, morbo@google.com, justinstitt@google.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, llvm@lists.linux.dev Cc: "Mukesh Kumar Chaurasiya (IBM)" Subject: [PATCH V10 2/4] powerpc/jump_label: adjust inline asm to be consistent Date: Tue, 7 Apr 2026 01:31:47 +0530 Message-ID: <20260406200149.3727922-3-mkchauras@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260406200149.3727922-1-mkchauras@gmail.com> References: <20260406200149.3727922-1-mkchauras@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Added support for a new macro ARCH_STATIC_BRANCH_ASM in powerpc to avoid duplication of inline asm between C and Rust. This is inline with 'commit aecaf181651c ("jump_label: adjust inline asm to be cons= istent")' Co-developed-by: Madhavan Srinivasan Signed-off-by: Madhavan Srinivasan Reviewed-by: Alice Ryhl Reviewed-by: Christophe Leroy (CS GROUP) Reviewed-by: Gary Guo Link: https://github.com/Rust-for-Linux/linux/issues/105 Link: https://github.com/linuxppc/issues/issues/451 Signed-off-by: Mukesh Kumar Chaurasiya (IBM) --- arch/powerpc/include/asm/jump_label.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/include/asm/jump_label.h b/arch/powerpc/include/a= sm/jump_label.h index d4eaba459a0e..3016e9c8d6bc 100644 --- a/arch/powerpc/include/asm/jump_label.h +++ b/arch/powerpc/include/asm/jump_label.h @@ -15,14 +15,20 @@ #define JUMP_ENTRY_TYPE stringify_in_c(FTR_ENTRY_LONG) #define JUMP_LABEL_NOP_SIZE 4 =20 +#define JUMP_TABLE_ENTRY(key, label) \ + ".pushsection __jump_table, \"aw\" \n\t" \ + ".long 1b - ., " label " - . \n\t" \ + JUMP_ENTRY_TYPE key " - . \n\t" \ + ".popsection \n\t" + +#define ARCH_STATIC_BRANCH_ASM(key, label) \ + "1: nop \n\t" \ + JUMP_TABLE_ENTRY(key, label) + static __always_inline bool arch_static_branch(struct static_key *key, boo= l branch) { - asm goto("1:\n\t" - "nop # arch_static_branch\n\t" - ".pushsection __jump_table, \"aw\"\n\t" - ".long 1b - ., %l[l_yes] - .\n\t" - JUMP_ENTRY_TYPE "%c0 - .\n\t" - ".popsection \n\t" + asm goto( + ARCH_STATIC_BRANCH_ASM("%c0", "%l[l_yes]") : : "i" (&((char *)key)[branch]) : : l_yes); =20 return false; @@ -34,10 +40,7 @@ static __always_inline bool arch_static_branch_jump(stru= ct static_key *key, bool { asm goto("1:\n\t" "b %l[l_yes] # arch_static_branch_jump\n\t" - ".pushsection __jump_table, \"aw\"\n\t" - ".long 1b - ., %l[l_yes] - .\n\t" - JUMP_ENTRY_TYPE "%c0 - .\n\t" - ".popsection \n\t" + JUMP_TABLE_ENTRY("%c0", "%l[l_yes]") : : "i" (&((char *)key)[branch]) : : l_yes); =20 return false; --=20 2.53.0 From nobody Tue Apr 7 12:20:09 2026 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (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 2175F39659F for ; Mon, 6 Apr 2026 20:02:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775505753; cv=none; b=SSl5BrLmn+XMo+cE8CNd/PgUwUxCCkphy4g6K8lE0c88VUcJnRR6eVyBUAzAfXel7TBjPxPm8pKLlDDH0LTJ1nIUOkAWwg+4z84x/wjwQz1bJMHLD93vVVyZ7zkH1iJ7BiejSLmDsUhK7PEkgnfyCnSczSYRQIc5OdiUGkv4fiQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775505753; c=relaxed/simple; bh=xtajcHPnDfwbwjYchYSDD1WR29xrrCxSIc9DSK0ZzxA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=In4maXmCZGfxjQP5Fu28Tiqqs3qCjkX1qtqsoRbTNFdFdf+UAXvk7wmNncqxjE4e0hLkgVlhaNITEorLrBI04zXHe0F12ypALKKza6Y+tsVMYnJwKkjD+n69c5lcJgEuCL8PBqNDpKhxGRqnVJoSSwc6eelBeKK+sJNM8z2zU6k= 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=C/0WTSuB; arc=none smtp.client-ip=209.85.215.176 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="C/0WTSuB" Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-c70fb6aa323so1440252a12.3 for ; Mon, 06 Apr 2026 13:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775505751; x=1776110551; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=epCQc4tGVXz1xefMqDUFYXuettxlTI+7sX4tf8abt7g=; b=C/0WTSuB8Hw/RMaSZf8U8kpDMWwagpnTGZu9i+lafwSWkPvdHPnI+nDDOxcB22M+xT WbxIFte8v3ndpvX0YIfY8Yk144OD7fQ5uQf+vi3FqWbYagbhANxiCjUY5Ffry/077l+A qOCd2Wt22Ja35FwlggMaihejJxLABoI5iE1sE5qieNABUMObkqnibL8+CWY+0Pvp31cK 5Qj7ZzcyV7Xupln1/tkbvzfF3vmz7Ijf+ezuxk5W3g4My7gyQhEseLnaaQsRuwI+a1Hu xcL8smoLh7WJhSgrfzb88Cf9TPecGAmAVLyzM52sGi0hg/L3eLe1XE0+cpAXVF7fhC70 SJYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775505751; x=1776110551; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=epCQc4tGVXz1xefMqDUFYXuettxlTI+7sX4tf8abt7g=; b=ghPmjg//f20IhXyAvisSaND9UjIWs57TrsjZo06bc9BaEBt7tmRGzX6WxclxsXsOlz CnG+6z+N2RFmqw538iOBAU0XuMByAhSjXy2cRZxqM+UYXPI9LfgWTpJSRKGUp3uh4T88 S8I30KxgP5CSjjrZu/xjCtM7oOgFR1cq31w0r3q+H4cQPFilQZx8RCPCeRY7tj8FI5MM qbC1XGsJwxRqqPAQG80VHgAonM78odD2xSXL3Hbsn+izSaygjJ0LCFPnUQYSqV2C30+S VDHUfj05dydpLAS/m3pUv7bZ6JxtcLeYOyRU7qDHvlfRyT0lzj6vPqbwQo03P1fMaqSV uXmA== X-Forwarded-Encrypted: i=1; AJvYcCXJ3oYP840uSPDTXXFiqAfNW91UePv8CFPQ8PjOqjMtGXupNJL8N85eG7kCdBbtYQAvwk3i6XRKOoN/uAo=@vger.kernel.org X-Gm-Message-State: AOJu0YyRQywKoxyYYcEk7u9SFouQvvOcT8ECtSqZAgNr9095t1lbUpde xevYFLfdnKF5y7CmSi+H1ldD51u2CdXDsXnL1VaGub1Kmg1cw2QaJevV X-Gm-Gg: AeBDiesd0ykymSL43bPDgmF5rkEOtt9kQNRn0h67ZsVPEzSjVbYXJRX8sb3lrv32qoW KpJqEcNuO1xSYIc9KNcztyX5Zrk3jwEBpR/YiFgm0KXuToG4EGjvzOXpIvdrSEqwMwCBfbQiYkT wCduO093jLJE2NOqqyA5l2RZzmeRokjDTwzRI8OSKjFr/hcNluPA3j8QKmMV1+nKVPc+BKfsSSK SXeJNvvUwU6MnXeLFSSRKkYs/lRi8W97+7jBZ7rFmi8N5cbeFlg3xEl1R2yM1xQlob/wDqeRSvu E/9FPkJmPxeVw9u68v91M4uBgfW/vaaBWESSsR86TMn6uLa3GVK+FoAyWSihvsrMJp5whYPo2FB UP9FR7I/+e1iSPn6mLiX4wsYRDFrpVPaW+p+rgrP050PhbsUOClmAfR8zRmx/AFHf/enWWmlZrL 07Jk/+HFVkrNX+PaUhsXo2Iiq3QEsrCQHOLhNFcvYzaaWtVjFMrsN14HubTv02tdTmGTdvtohaq J4= X-Received: by 2002:a17:903:1968:b0:2b2:4fc1:f657 with SMTP id d9443c01a7336-2b2817d8be9mr145070895ad.6.1775505751253; Mon, 06 Apr 2026 13:02:31 -0700 (PDT) Received: from li-1a3e774c-28e4-11b2-a85c-acc9f2883e29.ibm.com.com ([106.51.160.44]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b27497af26sm151098205ad.49.2026.04.06.13.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2026 13:02:30 -0700 (PDT) From: "Mukesh Kumar Chaurasiya (IBM)" To: maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, peterz@infradead.org, jpoimboe@kernel.org, jbaron@akamai.com, aliceryhl@google.com, rostedt@goodmis.org, ardb@kernel.org, ojeda@kernel.org, boqun@kernel.org, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, tmgross@umich.edu, dakr@kernel.org, nathan@kernel.org, nick.desaulniers+lkml@gmail.com, morbo@google.com, justinstitt@google.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, llvm@lists.linux.dev Cc: Link Mauve , "Mukesh Kumar Chaurasiya (IBM)" Subject: [PATCH V10 3/4] rust: Add PowerPC support Date: Tue, 7 Apr 2026 01:31:48 +0530 Message-ID: <20260406200149.3727922-4-mkchauras@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260406200149.3727922-1-mkchauras@gmail.com> References: <20260406200149.3727922-1-mkchauras@gmail.com> 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 From: Link Mauve For now only Big Endian 32-bit PowerPC is supported, as that is the only hardware I have. This has been tested on the Nintendo Wii so far, but I plan on also using it on the GameCube, Wii U and Apple G4. These changes aren=E2=80=99t the only ones required to get the kernel to co= mpile and link on PowerPC, libcore will also have to be changed to not use integer division to format u64, u128 and core::time::Duration, otherwise __udivdi3() and __umoddi3() will have to be added. I have tested this change by replacing the three implementations with unimplemented!() and it linked just fine. Signed-off-by: Link Mauve Link: https://github.com/Rust-for-Linux/linux/issues/105 Link: https://github.com/linuxppc/issues/issues/451 Signed-off-by: Mukesh Kumar Chaurasiya (IBM) --- arch/powerpc/Kconfig | 1 + arch/powerpc/Makefile | 2 ++ rust/Makefile | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 10240cb80904..1246b3add8ff 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -284,6 +284,7 @@ config PPC select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RELIABLE_STACKTRACE select HAVE_RSEQ + select HAVE_RUST if PPC32 select HAVE_SAMPLE_FTRACE_DIRECT if HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS select HAVE_SAMPLE_FTRACE_DIRECT_MULTI if HAVE_DYNAMIC_FTRACE_WITH_DIRECT= _CALLS select HAVE_SETUP_PER_CPU_AREA if PPC64 diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index a58b1029592c..589613eaa5dc 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -61,6 +61,8 @@ else KBUILD_LDFLAGS_MODULE +=3D $(objtree)/arch/powerpc/lib/crtsavres.o endif =20 +KBUILD_RUSTFLAGS +=3D --target=3Dpowerpc-unknown-linux-gnu + ifdef CONFIG_CPU_LITTLE_ENDIAN KBUILD_CPPFLAGS +=3D -mlittle-endian KBUILD_LDFLAGS +=3D -EL diff --git a/rust/Makefile b/rust/Makefile index d8f34c4858b8..e53cb16c06c1 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -405,13 +405,15 @@ bindgen_skip_c_flags :=3D -mno-fp-ret-in-387 -mprefer= red-stack-boundary=3D% \ -fstrict-flex-arrays=3D% -fmin-function-alignment=3D% \ -fzero-init-padding-bits=3D% -mno-fdpic \ -fdiagnostics-show-context -fdiagnostics-show-context=3D% \ - --param=3D% --param asan-% -fno-isolate-erroneous-paths-dereference + --param=3D% --param asan-% -fno-isolate-erroneous-paths-dereference \ + -ffixed-r2 -mmultiple -mno-readonly-in-sdata =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_powerpc :=3D powerpc-linux-gnu BINDGEN_TARGET_um :=3D $(BINDGEN_TARGET_$(SUBARCH)) BINDGEN_TARGET :=3D $(BINDGEN_TARGET_$(SRCARCH)) =20 --=20 2.53.0 From nobody Tue Apr 7 12:20:09 2026 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 3682C35AC01 for ; Mon, 6 Apr 2026 20:02:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775505764; cv=none; b=Hv6U+ONU3a1owbSNKN7ZcfyJVtblmer9L0EhiWj1RJe2ESVyONCtXKP53+t1zCmKjgqgpeERXHoANIh6crXtQMrSt5YQTlL3QAu3iCUqZkqnI6ye/M9TW54D+exnygxXKkA7TGtkQS4/VJTdorLLDCzZW/M0fqMpTFOtlHMAL+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775505764; c=relaxed/simple; bh=pZYgWqinwCi2XlavtGMuYp6nbKIMJVmgtA/tr2/njSY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sxPz5epPsC0J36zJbQrcVpzVbH+zUjbQ5LEsMahzLBVhCsikfWIJeN8nhJ/DzFtoYoVb9GqwjiJXiJrd1T1egeBX99yzAKElqq4zKHBZ0iS9G4ghglRA5FhuAbR3f6tPYsyiGI6g7RL3XGivwBMmAABO12GXVC3psTJXBTRv+dM= 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=X5nJoJCm; arc=none smtp.client-ip=209.85.214.180 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="X5nJoJCm" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2ad617d5b80so22598765ad.1 for ; Mon, 06 Apr 2026 13:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775505761; x=1776110561; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d2r7y3l0YoAacVN6N8CSzvUk5PKNLzqAsC5O2toHlyY=; b=X5nJoJCmyMlzuvST2f5G/lWWLk5i3P++G9QmjfI5SyPoP2xb5nUSAuqDBHtcOzUZ58 35i0jWy9fIgUMiZgVm6BKPEYowdEK8KFlbyGHW4xm6O73GUveSUJbTRvvRuTVbvzuFUd SnwgIuST8gc08Lj8waMM90ss+XxcIWPf74KUcvt/D3SykrG5JBXuuelIHZ1cpl4UAyuy 2/ZJ5xCgje4knIyQh7a2tJ3/Rp1JXIIyefo9sicN1vB34lkdyr9eUxcjetn+m22IG94L uf5g7MjNcg04rMhjYieljxKlMff+Y4MC45qkzHW6k2Gb1D7RxVRM1SJo8/3RZntMT+1v eXGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775505761; x=1776110561; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=d2r7y3l0YoAacVN6N8CSzvUk5PKNLzqAsC5O2toHlyY=; b=oK/jwjVzTCcj/ZCSGBqzPYA5PH5Z9Ra6BNEkCvpqgfApUjgC6LoRPCYRwDNIm8/Zpw eyAlbNNZmjjzguviDbnUpbR27+PmnDkgcQF1ADOHUfqCcyZtP3C6PeUr8GMX3nfe4FDQ HVWehdVGVgKzrJGmEY6kkUTuLuIK27wJwzIjOFP2JWcGxQCWMOKpVDaOfKwRCR3vR6G7 qFMFaAkg2AM/YYFF41PhSF93UTmPAL/Wio4hzs5wShnr0H3yEETiXoUcTp50qGJPKO1+ C2/sPjigWnx1e7nJymxA5k5BDkrKZQycblMZRGAoIENASsYrsI1Pohy56R4AAg7NmyY4 F7ig== X-Forwarded-Encrypted: i=1; AJvYcCVhgRjdKZDlNvFynVC9ZWv2nAlRIo2i0i8m7Wjjyvly4Mc0KdzL5Gw5i7HvQ24YvMCl2wAdWqBrHaWeElA=@vger.kernel.org X-Gm-Message-State: AOJu0YyzgkpAGHc0XXqOzVp4BTFh67408eCBxXgaw/symEe+tMV0YSW5 5mO0tbvmf4A4/8WDdmM1l6xqhhFlHg5P4F1qtp8q8hRMdgoA2Yl01/vS X-Gm-Gg: AeBDietQRraSrX40NIpAsDfReQxYZniRcbs6blZgbjtWw0Ofx9Zqfm9YnAR/r8SOTA2 qQ/r7yeGCbGTpkfheEPWXMvTtJoDmGY8+OYzW37U3O9xSlSonjfLDb1X4PlTskhQFpoqKZOqiuZ jrknDPwfoqA0o3c57Snnq9M9HsL9SyZCkIEtYE86Q45AMRqhz0uQKU4CXOgU8HGZ39LoB/efsmm bMvDK43AZOjb9RAfbs8Xz/PXDQnU4/TolvsHY/tD+xQDi39a+mf8MCkR8/KxqlqjMY2BLJWAggD CFnKJXFeABVQaHU5rv3XEn/o9wmtIuisHI0XiD0KO9peJ2/RcixUtSQNwB/ZFCl+Oxafyj/2CKr wJAJEpclc/iJCTZUSS9lzwGWx62K54qGBO3ISMyBpwBf1O4UfHfPq5EeHImJBHqn+v9HjtTJK30 cj+d8pTWtrEpchonojGqTdnSw+eC5d6oGp9F+MlNRtqNjzhEoEISE9G6vcdRPGt7Uewj2v2LK5H vk= X-Received: by 2002:a17:903:2ac5:b0:2b2:42da:25cc with SMTP id d9443c01a7336-2b28163ad55mr150030455ad.1.1775505761363; Mon, 06 Apr 2026 13:02:41 -0700 (PDT) Received: from li-1a3e774c-28e4-11b2-a85c-acc9f2883e29.ibm.com.com ([106.51.160.44]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b27497af26sm151098205ad.49.2026.04.06.13.02.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2026 13:02:41 -0700 (PDT) From: "Mukesh Kumar Chaurasiya (IBM)" To: maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, peterz@infradead.org, jpoimboe@kernel.org, jbaron@akamai.com, aliceryhl@google.com, rostedt@goodmis.org, ardb@kernel.org, ojeda@kernel.org, boqun@kernel.org, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, tmgross@umich.edu, dakr@kernel.org, nathan@kernel.org, nick.desaulniers+lkml@gmail.com, morbo@google.com, justinstitt@google.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, llvm@lists.linux.dev Cc: "Mukesh Kumar Chaurasiya (IBM)" , Link Mauve , Venkat Rao Bagalkote Subject: [PATCH V10 4/4] powerpc: Enable Rust for ppc64le Date: Tue, 7 Apr 2026 01:31:49 +0530 Message-ID: <20260406200149.3727922-5-mkchauras@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260406200149.3727922-1-mkchauras@gmail.com> References: <20260406200149.3727922-1-mkchauras@gmail.com> 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 Enabling rust support for ppc64le. Tested on pseries Power11: =E2=95=B0=E2=94=80=E2=9D=AF dmesg | grep rust [ 0.225728] Initialise system trusted keyrings [ 0.270961] rust_minimal: Rust minimal sample (init) [ 0.270968] rust_minimal: Am I built-in? true [ 0.270974] rust_minimal: test_parameter: 1 [ 0.270983] rust_misc_device: Initialising Rust Misc Device Sample [ 0.271012] rust_print: Rust printing macros sample (init) [ 0.271019] rust_print: Emergency message (level 0) without args [ 0.271023] rust_print: Alert message (level 1) without args [ 0.271026] rust_print: Critical message (level 2) without args [ 0.271030] rust_print: Error message (level 3) without args [ 0.271033] rust_print: Warning message (level 4) without args [ 0.271037] rust_print: Notice message (level 5) without args [ 0.271040] rust_print: Info message (level 6) without args [ 0.271043] rust_print: A line that is continued without args [ 0.271054] rust_print: Emergency message (level 0) with args [ 0.271064] rust_print: Alert message (level 1) with args [ 0.271072] rust_print: Critical message (level 2) with args [ 0.271077] rust_print: Error message (level 3) with args [ 0.271083] rust_print: Warning message (level 4) with args [ 0.271091] rust_print: Notice message (level 5) with args [ 0.271097] rust_print: Info message (level 6) with args [ 0.271102] rust_print: A line that is continued with args [ 0.271110] rust_print: 1 [ 0.271113] rust_print: "hello, world" [ 0.271121] rust_print: [samples/rust/rust_print_main.rs:35:5] c =3D "he= llo, world" [ 0.271129] rust_print: Arc says 42 [ 0.271130] rust_print: Arc says hello, world [ 0.271136] rust_print: "hello, world" [ 0.271198] usbcore: registered new interface driver rust_driver_usb [ 0.271207] rust_faux_driver: Initialising Rust Faux Device Sample [ 0.271227] faux_driver rust-faux-sample-device: Hello from faux device! [ 0.271297] rust_configfs: Rust configfs sample (init) Reviewed-by: Link Mauve Tested-by: Link Mauve Reviewed-by: Christophe Leroy (CS GROUP) Tested-by: Venkat Rao Bagalkote Link: https://github.com/Rust-for-Linux/linux/issues/105 Link: https://github.com/linuxppc/issues/issues/451 Signed-off-by: Mukesh Kumar Chaurasiya (IBM) --- arch/powerpc/Kconfig | 1 + arch/powerpc/Makefile | 7 ++++++- rust/Makefile | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 1246b3add8ff..a5f50434daf3 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -285,6 +285,7 @@ config PPC select HAVE_RELIABLE_STACKTRACE select HAVE_RSEQ select HAVE_RUST if PPC32 + select HAVE_RUST if PPC64 && CPU_LITTLE_ENDIAN select HAVE_SAMPLE_FTRACE_DIRECT if HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS select HAVE_SAMPLE_FTRACE_DIRECT_MULTI if HAVE_DYNAMIC_FTRACE_WITH_DIRECT= _CALLS select HAVE_SETUP_PER_CPU_AREA if PPC64 diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 589613eaa5dc..9385db478c59 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -61,7 +61,12 @@ else KBUILD_LDFLAGS_MODULE +=3D $(objtree)/arch/powerpc/lib/crtsavres.o endif =20 -KBUILD_RUSTFLAGS +=3D --target=3Dpowerpc-unknown-linux-gnu +ifdef CONFIG_PPC64 +KBUILD_RUSTFLAGS +=3D --target=3Dpowerpc64le-unknown-linux-gnu +KBUILD_RUSTFLAGS +=3D -Ctarget-feature=3D-mma,-vsx,-hard-float,-altivec +else +KBUILD_RUSTFLAGS +=3D --target=3Dpowerpc-unknown-linux-gnu +endif =20 ifdef CONFIG_CPU_LITTLE_ENDIAN KBUILD_CPPFLAGS +=3D -mlittle-endian diff --git a/rust/Makefile b/rust/Makefile index e53cb16c06c1..e106d6feb8da 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -413,7 +413,13 @@ 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 + +ifdef CONFIG_PPC64 +BINDGEN_TARGET_powerpc :=3D powerpc64le-linux-gnu +else BINDGEN_TARGET_powerpc :=3D powerpc-linux-gnu +endif + BINDGEN_TARGET_um :=3D $(BINDGEN_TARGET_$(SUBARCH)) BINDGEN_TARGET :=3D $(BINDGEN_TARGET_$(SRCARCH)) =20 --=20 2.53.0