public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Link Mauve <linkmauve@linkmauve.fr>
To: "Mukesh Kumar Chaurasiya (IBM)" <mkchauras@gmail.com>
Cc: linkmauve@linkmauve.fr, ojeda@kernel.org, boqun.feng@gmail.com,
	gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org,
	a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu,
	dakr@kernel.org, corbet@lwn.net, maddy@linux.ibm.com,
	mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org,
	peterz@infradead.org, jpoimboe@kernel.org, jbaron@akamai.com,
	rostedt@goodmis.org, ardb@kernel.org,
	rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH V2 3/3] powerpc: Enable Rust for ppc64le
Date: Thu, 5 Feb 2026 14:52:12 +0100	[thread overview]
Message-ID: <aYSgjPD5KRcNN0j4@luna> (raw)
In-Reply-To: <20260204210125.613350-4-mkchauras@gmail.com>

On Thu, Feb 05, 2026 at 02:31:25AM +0530, Mukesh Kumar Chaurasiya (IBM) wrote:
[…]
> diff --git a/rust/Makefile b/rust/Makefile
> index ae22f2c5f0b3..c3961fd0d9a4 100644
> --- a/rust/Makefile
> +++ b/rust/Makefile
> @@ -392,10 +392,17 @@ BINDGEN_TARGET_x86	:= x86_64-linux-gnu
>  BINDGEN_TARGET_arm64	:= aarch64-linux-gnu
>  BINDGEN_TARGET_arm	:= arm-linux-gnueabi
>  BINDGEN_TARGET_loongarch	:= loongarch64-linux-gnusf
> -BINDGEN_TARGET_powerpc	:= powerpc-linux-gnu
>  BINDGEN_TARGET_um	:= $(BINDGEN_TARGET_$(SUBARCH))
>  BINDGEN_TARGET		:= $(BINDGEN_TARGET_$(SRCARCH))
>  
> +ifdef CONFIG_PPC64
> +ifdef CONFIG_CPU_LITTLE_ENDIAN
> +BINDGEN_TARGET_powerpc	:= powerpc64le-linux-gnu
> +endif
> +else
> +BINDGEN_TARGET_powerpc	:= powerpc-linux-gnu
> +endif

You define BINDGEN_TARGET_powerpc after BINDGEN_TARGET has been set to
the value of $(BINDGEN_TARGET_$(SRCARCH)), so it is empty and bindgen
then gets passed --target= which makes it fail here, with this error
message:
```
bindgen ../rust/bindings/bindings_helper.h --blocklist-type __kernel_s?size_t --blocklist-type __kernel_ptrdiff_t --opaque-type xregs_state --opaque-type desc_struct --opaque-type arch_lbr_state --opaque-type local_apic --opaque-type alt_instr --opaque-type x86_msi_data --opaque-type x86_msi_addr_lo --opaque-type kunit_try_catch --opaque-type spinlock --no-doc-comments --blocklist-function __list_.*_report --blocklist-item ARCH_SLAB_MINALIGN --blocklist-item ARCH_KMALLOC_MINALIGN --with-derive-custom-struct .*=MaybeZeroable --with-derive-custom-union .*=MaybeZeroable --rust-target 1.68 --use-core --with-derive-default --ctypes-prefix ffi --no-layout-tests --no-debug '.*' --enable-function-attribute-detection -o rust/bindings/bindings_generated.rs -- -Wp,-MMD,rust/bindings/.bindings_generated.rs.d -nostdinc -I../arch/powerpc/include -I./arch/powerpc/include/generated -I../include -I./include -I../arch/powerpc/include/uapi -I./arch/powerpc/include/generated/uapi -I../include/uapi -I./include/generated/uapi -include ../include/linux/compiler-version.h -include ../include/linux/kconfig.h -include ../include/linux/compiler_types.h -D__KERNEL__ -mbig-endian -m32 -I ../arch/powerpc -fmacro-prefix-map=../= -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -msoft-float -mcpu=powerpc -mno-prefixed -mno-pcrel -mno-altivec -mno-vsx -mno-mma -fno-asynchronous-unwind-tables -mbig-endian -fno-delete-null-pointer-checks -Os -fno-stack-protector -fomit-frame-pointer -ftrivial-auto-var-init=zero -fno-strict-overflow -fno-stack-check -fno-builtin-wcslen -Wall -Wextra -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wno-address-of-packed-member -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=1280 -Wno-main -Wno-dangling-pointer -Wvla-larger-than=1 -Wno-pointer-sign -Wcast-function-type -Wno-array-bounds -Wno-stringop-overflow -Wno-alloc-size-larger-than -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wenum-conversion -Wunused -Wno-unused-but-set-variable -Wno-unused-const-variable -Wno-packed-not-aligned -Wno-format-overflow -Wno-format-truncation -Wno-stringop-truncation -Wno-override-init -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -DGCC_PLUGINS -I../rust -Irust -DKBUILD_MODFILE='"rust/bindings_generated"' -DKBUILD_BASENAME='"bindings_generated"' -DKBUILD_MODNAME='"bindings_generated"' -D__KBUILD_MODNAME=kmod_bindings_generated -w --target= -fno-builtin -D__BINDGEN__ -DMODULE  ; sed -Ei 's/pub const RUST_CONST_HELPER_([a-zA-Z0-9_]*)/pub const /g' rust/bindings/bindings_generated.rs
error: unsupported option '-mbig-endian' for target ''
error: unsupported option '-mcpu=' for target ''
error: unsupported option '-mno-prefixed' for target ''
error: unsupported option '-mno-pcrel' for target ''
error: unsupported option '-mno-altivec' for target ''
error: unsupported option '-mno-vsx' for target ''
error: unsupported option '-mno-mma' for target ''
error: unsupported option '-mbig-endian' for target ''
error: unknown target triple 'unknown'
panicked at bindgen/ir/context.rs:562:15:
libclang error; possible causes include:
- Invalid flag syntax
- Unrecognized flags
- Invalid flag arguments
- File I/O errors
- Host vs. target architecture mismatch
If you encounter an error missing from this list, please file an issue or a PR!
```

Did this work on PPC64?

> +
>  # 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.
> -- 
> 2.52.0
> 

With this fixed:
Reviewed-by: Link Mauve <linkmauve@linkmauve.fr>
Tested-by: Link Mauve <linkmauve@linkmauve.fr>

-- 
Link Mauve

  parent reply	other threads:[~2026-02-05 13:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04 21:01 [PATCH V2 0/3] Rust support for powerpc Mukesh Kumar Chaurasiya (IBM)
2026-02-04 21:01 ` [PATCH V2 1/3] powerpc/jump_label: adjust inline asm to be consistent Mukesh Kumar Chaurasiya (IBM)
2026-02-05  8:09   ` Christophe Leroy (CS GROUP)
2026-02-05  8:24   ` Alice Ryhl
2026-02-04 21:01 ` [PATCH V2 2/3] rust: Add PowerPC support Mukesh Kumar Chaurasiya (IBM)
2026-02-04 21:01 ` [PATCH V2 3/3] powerpc: Enable Rust for ppc64le Mukesh Kumar Chaurasiya (IBM)
2026-02-05  8:14   ` Christophe Leroy (CS GROUP)
2026-02-05 13:52   ` Link Mauve [this message]
2026-02-05 14:51     ` Venkat Rao Bagalkote
2026-02-05 15:42       ` Mukesh Kumar Chaurasiya
2026-02-05 19:34         ` Miguel Ojeda
2026-02-05 20:02           ` Nathan Chancellor
2026-02-05 20:15             ` Miguel Ojeda
2026-02-11 22:23             ` Miguel Ojeda
2026-02-16 11:23         ` Rust version requirement (was: [PATCH V2 3/3] powerpc: Enable Rust for ppc64le) J. Neuschäfer
2026-02-16 11:29           ` Alice Ryhl
2026-02-05 15:45     ` [PATCH V2 3/3] powerpc: Enable Rust for ppc64le Mukesh Kumar Chaurasiya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aYSgjPD5KRcNN0j4@luna \
    --to=linkmauve@linkmauve.fr \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=ardb@kernel.org \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=chleroy@kernel.org \
    --cc=corbet@lwn.net \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=jbaron@akamai.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lossin@kernel.org \
    --cc=maddy@linux.ibm.com \
    --cc=mkchauras@gmail.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox