{"id":2225671,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2225671/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260421120958.190430-4-mkchauras@gmail.com/","project":{"id":2,"url":"http://patchwork.ozlabs.org/api/1.1/projects/2/?format=json","name":"Linux PPC development","link_name":"linuxppc-dev","list_id":"linuxppc-dev.lists.ozlabs.org","list_email":"linuxppc-dev@lists.ozlabs.org","web_url":"https://github.com/linuxppc/wiki/wiki","scm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git","webscm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/"},"msgid":"<20260421120958.190430-4-mkchauras@gmail.com>","date":"2026-04-21T12:09:57","name":"[V12,3/4] rust: Add PowerPC support","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"c78a8bfb51e87e080c0eb61df63ec62cb047a2a8","submitter":{"id":92575,"url":"http://patchwork.ozlabs.org/api/1.1/people/92575/?format=json","name":"Mukesh Kumar Chaurasiya","email":"mkchauras@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260421120958.190430-4-mkchauras@gmail.com/mbox/","series":[{"id":500787,"url":"http://patchwork.ozlabs.org/api/1.1/series/500787/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=500787","date":"2026-04-21T12:09:54","name":"Rust support for powerpc","version":12,"mbox":"http://patchwork.ozlabs.org/series/500787/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2225671/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2225671/checks/","tags":{},"headers":{"Return-Path":"\n <linuxppc-dev+bounces-19884-incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=ia4rDgIV;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:21b9:f100::1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-19884-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)","lists.ozlabs.org;\n arc=none smtp.remote-ip=\"2607:f8b0:4864:20::52c\"","lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=ia4rDgIV;\n\tdkim-atps=neutral","lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com\n (client-ip=2607:f8b0:4864:20::52c; helo=mail-pg1-x52c.google.com;\n envelope-from=mkchauras@gmail.com; receiver=lists.ozlabs.org)"],"Received":["from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:21b9:f100::1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0Lm01G0Nz1yGs\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 22:10:40 +1000 (AEST)","from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4g0Lm00Fdkz2yvB;\n\tTue, 21 Apr 2026 22:10:40 +1000 (AEST)","from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com\n [IPv6:2607:f8b0:4864:20::52c])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4g0Llz28VGz2ySW\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 21 Apr 2026 22:10:39 +1000 (AEST)","by mail-pg1-x52c.google.com with SMTP id\n 41be03b00d2f7-c79467f124dso1495174a12.2\n        for <linuxppc-dev@lists.ozlabs.org>;\n Tue, 21 Apr 2026 05:10:39 -0700 (PDT)","from li-1a3e774c-28e4-11b2-a85c-acc9f2883e29.bl1-in.ibm.com\n ([129.41.58.4])\n        by smtp.gmail.com with ESMTPSA id\n 41be03b00d2f7-c797701d9bfsm10045274a12.16.2026.04.21.05.10.28\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Tue, 21 Apr 2026 05:10:36 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1776773439;\n\tcv=none;\n b=oZCeK5S5pkmfAhkcR5nakczwnU3hVCrH3gX6adAm93VCaTBSDjPsfnBzM023aXw0486uJ/fPLASYJiuqLyYTliuiSceIu8RZ1cbqmKc9m62utu/RsCtT7XrpoiXwIHizB6roWq2VzTHxqfLvYDU8XHJ3beFiySiHc36nOiyoWwjWSzWz8LpLY/g6TvnpRjvVQWGoYuy44/9JyEPVuUGQ9pObhYvm1k8Pa0H8q80bU9ZkP2XjOw6Hu7auHSvz8J/L1fpspY2CY9oJGNdE6ZkQmAjljYyX0xpYPcBFioRauSGim2W1put73KQKPZophPZjBgK1z9HLQ6YhVLBRfRp7Cw==","ARC-Message-Signature":"i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1776773439; c=relaxed/relaxed;\n\tbh=3BeysMzI6zwGD6joEXhhGssagLKkCvhT6RVRv5CKQ4U=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=ofpipvBtU39zCdclvgZTdcw2QX6VlJzzOPTOdMhskzfR7ZSLsw5QFJoBXLblLHJyDMNi9CZQYTBzuXshO1oTdfMwfNB6rVGX2yu5CL6zI4oPyjbbaQzo7MjGe7YVM4q8U2KWsJDLKoXfgksLqcSCGnmEgDiK5ECrSEzvMJ1BETeZQuhzG1l2kt4vyPJnzn+L1nYjj4NuWE0mN8Ds0itNz87lvtEjmW91MjSZ8HxBErrS5FRkZ5K0wwY4RaJgiSRC0cSEDDSaB9BJ+93kEcdm9zUgNOnhbLsJYfd+nZJ+hmKxsqjaG+kxEWsmXCSDBpWgQ4fgDaFylsQUzTQ1F/OcSQ==","ARC-Authentication-Results":"i=1; lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com; dkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=ia4rDgIV; dkim-atps=neutral;\n spf=pass (client-ip=2607:f8b0:4864:20::52c; helo=mail-pg1-x52c.google.com;\n envelope-from=mkchauras@gmail.com;\n receiver=lists.ozlabs.org) smtp.mailfrom=gmail.com","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1776773437; x=1777378237;\n darn=lists.ozlabs.org;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=3BeysMzI6zwGD6joEXhhGssagLKkCvhT6RVRv5CKQ4U=;\n        b=ia4rDgIVryf5m2oOrdfFBT76QzGVfvptTvSdOGEMqexvfF3Fao6Pah6eQrniBxhLXu\n         WupB4x4PM+J4NGPhoXUg3KXd1xFrLfqF9kIA9kAt0CbvxD+PJnE0cA1cWe0BkKSPlDGo\n         DO/pB6Hrx6O4+1Q+IQw1zIYlBa20YePJZGl+l+29dPIpARvopOEKNTRBvzfiBgP5pFPV\n         K89gaAXmvrzOc9oAfyyQMT6EN8G1kOcvsDl7iBI8RWjYLUnPLlS3OVSTKMM+U0HWvkfs\n         oKKjDFuVd7pSZv3bdXYQsic0/f1DNQV5cEVIUNaIc5xHQHO4K46BiaZezLWN8+G3ZRQK\n         eTQg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1776773437; x=1777378237;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=3BeysMzI6zwGD6joEXhhGssagLKkCvhT6RVRv5CKQ4U=;\n        b=btP6iplsQRLeYYB32B8VB827P3SONje0bxbH0F1q8L2cWzjyr/cSrnxCy0Or502nVF\n         mf78wcNyLCYRz00cE1LGwvU7RmOVfEQ7nub+aI1LN+pxKfxV0Uaru/YCZsdTOAy0B2h3\n         rEAaDODWRPdWw01F5FWpW0RN/OHyQYYOMuEaPxZGxbiNGTjyYLPks39KQ2gP6vRNp8tM\n         d1qdNK56mV5BVV9BieBDNTjsK+O3VbH8bjMaqulYv/z8T4l6c4GgufsTLi8xpaQ7TOxE\n         zGXV663ViAO5Y6KcDXVtyS3IBOIIGr7Ik2t5ddZMk6Ff9uzx8EWKj8TGcx58W5S4X3GP\n         QWTg==","X-Forwarded-Encrypted":"i=1;\n AFNElJ9lSx/Sz6FPHTtWRWw2MuWoBCrrXuD7Lzxae1dYpKnuKnkeIq0rmKEwZF7+ntrL8hW9DhAaCnRvNdDay+c=@lists.ozlabs.org","X-Gm-Message-State":"AOJu0YyJNbFuXxupVwmIQVWopDwSH/IxBfCu2iAhDGB2Fqsjx3tJNQiO\n\taHSd47UXnejY0J3czyU5yHdC8vicTRdRMtKxiE32fl8MjYIBNYC1pRpE","X-Gm-Gg":"AeBDieuCOu4XyZVPDCMLz5DXTMCs8N7aTEc0NGr5oW0aoP+Spaq3Q/OaNTTQtIskhwc\n\tUqx8muKpGz9D0rD7Ni4KrBkPvfYU9bhsOgSj90D5k1B6Qys+Au58g3AvarJHc5y94GQ1RM/p6p1\n\tVONGmMtxxXo/4Lks/orkGbUSjcen++B5Wuy0yjQuRGmoqyjSeSRrJrOf4FxDU3v9JiV36/zQF+p\n\t8Z9QKOCskA58DIxA4suscnLl2uaIBO75Ckghmh4ztj2tbT05tSHDI7NQpcvO9JK1fSnBt6rAFTW\n\tvH2t3WMMPW3+ejb9ZAWQYDz1+ymUZiNKwPBhQ2sC2wc7+KimHcykE4XVouehdWbned7OjjvxYZU\n\tD10V0kSQ9+5LfInBD2F4UtbyryBfEsmYSIZulWD9JvsL5EIxJ3J4aGIEmi0EZSEM/kQS3+RGrkj\n\tFd7NUSEkZ1xfZalkV00mDUJ4kFhXdcAryg01bcpC8dAG+ZVyyX0iya8yT99X6g5FGdSqFkOpO7g\n\tfjNkySMMp+r5ks=","X-Received":"by 2002:a05:6a20:e211:b0:39c:783:e42b with SMTP id\n adf61e73a8af0-3a08d6eee6fmr19057917637.21.1776773436940;\n        Tue, 21 Apr 2026 05:10:36 -0700 (PDT)","From":"\"Mukesh Kumar Chaurasiya (IBM)\" <mkchauras@gmail.com>","To":"maddy@linux.ibm.com,\n\tmpe@ellerman.id.au,\n\tnpiggin@gmail.com,\n\tchleroy@kernel.org,\n\tpeterz@infradead.org,\n\tjpoimboe@kernel.org,\n\tjbaron@akamai.com,\n\taliceryhl@google.com,\n\trostedt@goodmis.org,\n\tardb@kernel.org,\n\tojeda@kernel.org,\n\tboqun@kernel.org,\n\tgary@garyguo.net,\n\tbjorn3_gh@protonmail.com,\n\tlossin@kernel.org,\n\ta.hindborg@kernel.org,\n\ttmgross@umich.edu,\n\tdakr@kernel.org,\n\tnathan@kernel.org,\n\tnick.desaulniers+lkml@gmail.com,\n\tmorbo@google.com,\n\tjustinstitt@google.com,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tlinux-kernel@vger.kernel.org,\n\trust-for-linux@vger.kernel.org,\n\tllvm@lists.linux.dev","Cc":"Link Mauve <linkmauve@linkmauve.fr>,\n\t\"Mukesh Kumar Chaurasiya (IBM)\" <mkchauras@gmail.com>","Subject":"[PATCH V12 3/4] rust: Add PowerPC support","Date":"Tue, 21 Apr 2026 17:39:57 +0530","Message-ID":"<20260421120958.190430-4-mkchauras@gmail.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260421120958.190430-1-mkchauras@gmail.com>","References":"<20260421120958.190430-1-mkchauras@gmail.com>","X-Mailing-List":"linuxppc-dev@lists.ozlabs.org","List-Id":"<linuxppc-dev.lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev+help@lists.ozlabs.org>","List-Owner":"<mailto:linuxppc-dev+owner@lists.ozlabs.org>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Archive":"<https://lore.kernel.org/linuxppc-dev/>,\n  <https://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Subscribe":"<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>","List-Unsubscribe":"<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>","Precedence":"list","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-Spam-Status":"No, score=-0.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,\n\tDKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,\n\tSPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.1 OzLabs 8","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org"},"content":"From: Link Mauve <linkmauve@linkmauve.fr>\n\nFor now only Big Endian 32-bit PowerPC is supported, as that is the only\nhardware I have.  This has been tested on the Nintendo Wii so far, but I\nplan on also using it on the GameCube, Wii U and Apple G4.\n\nThese changes aren’t the only ones required to get the kernel to compile\nand link on PowerPC, libcore will also have to be changed to not use\ninteger division to format u64, u128 and core::time::Duration, otherwise\n__udivdi3() and __umoddi3() will have to be added.  I have tested this\nchange by replacing the three implementations with unimplemented!() and\nit linked just fine.\n\nSigned-off-by: Link Mauve <linkmauve@linkmauve.fr>\nLink: https://github.com/Rust-for-Linux/linux/issues/105\nLink: https://github.com/linuxppc/issues/issues/451\nSigned-off-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>\n---\n arch/powerpc/Kconfig  | 1 +\n arch/powerpc/Makefile | 2 ++\n rust/Makefile         | 4 +++-\n 3 files changed, 6 insertions(+), 1 deletion(-)","diff":"diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig\nindex e93df95b79e7..4ac897b650d4 100644\n--- a/arch/powerpc/Kconfig\n+++ b/arch/powerpc/Kconfig\n@@ -285,6 +285,7 @@ config PPC\n \tselect HAVE_REGS_AND_STACK_ACCESS_API\n \tselect HAVE_RELIABLE_STACKTRACE\n \tselect HAVE_RSEQ\n+\tselect HAVE_RUST\t\t\tif PPC32\n \tselect HAVE_SAMPLE_FTRACE_DIRECT\tif HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS\n \tselect HAVE_SAMPLE_FTRACE_DIRECT_MULTI\tif HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS\n \tselect HAVE_SETUP_PER_CPU_AREA\t\tif PPC64\ndiff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile\nindex a58b1029592c..589613eaa5dc 100644\n--- a/arch/powerpc/Makefile\n+++ b/arch/powerpc/Makefile\n@@ -61,6 +61,8 @@ else\n KBUILD_LDFLAGS_MODULE += $(objtree)/arch/powerpc/lib/crtsavres.o\n endif\n \n+KBUILD_RUSTFLAGS \t+= --target=powerpc-unknown-linux-gnu\n+\n ifdef CONFIG_CPU_LITTLE_ENDIAN\n KBUILD_CPPFLAGS\t+= -mlittle-endian\n KBUILD_LDFLAGS\t+= -EL\ndiff --git a/rust/Makefile b/rust/Makefile\nindex 2a5428a5503d..c90811a2f564 100644\n--- a/rust/Makefile\n+++ b/rust/Makefile\n@@ -400,13 +400,15 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \\\n \t-fstrict-flex-arrays=% -fmin-function-alignment=% \\\n \t-fzero-init-padding-bits=% -mno-fdpic \\\n \t-fdiagnostics-show-context -fdiagnostics-show-context=% \\\n-\t--param=% --param asan-% -fno-isolate-erroneous-paths-dereference\n+\t--param=% --param asan-% -fno-isolate-erroneous-paths-dereference \\\n+\t-ffixed-r2 -mmultiple -mno-readonly-in-sdata\n \n # Derived from `scripts/Makefile.clang`.\n BINDGEN_TARGET_x86\t:= x86_64-linux-gnu\n BINDGEN_TARGET_arm64\t:= aarch64-linux-gnu\n BINDGEN_TARGET_arm\t:= arm-linux-gnueabi\n BINDGEN_TARGET_loongarch\t:= loongarch64-linux-gnusf\n+BINDGEN_TARGET_powerpc\t:= powerpc-linux-gnu\n BINDGEN_TARGET_um\t:= $(BINDGEN_TARGET_$(SUBARCH))\n BINDGEN_TARGET\t\t:= $(BINDGEN_TARGET_$(SRCARCH))\n \n","prefixes":["V12","3/4"]}