[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhV-H5ayw7NxbSbCeAFaxOz+TZ8QeghmhW6-j2B1vTcjYxsJQ@mail.gmail.com>
Date: Tue, 4 Mar 2025 17:12:24 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Xi Ruoyao <xry111@...111.site>
Cc: WANG Rui <wangrui@...ngson.cn>, Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>, Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>, Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org, loongarch@...ts.linux.dev,
loongson-kernel@...ts.loongnix.cn, stable@...r.kernel.org
Subject: Re: [PATCH] rust: Fix enabling Rust and building with GCC for LoongArch
On Tue, Mar 4, 2025 at 3:49 PM Xi Ruoyao <xry111@...111.site> wrote:
>
> On Tue, 2025-03-04 at 15:35 +0800, WANG Rui wrote:
> > This patch fixes a build issue on LoongArch when Rust is enabled and
> > compiled with GCC by explicitly setting the bindgen target and skipping
> > C flags that Clang doesn't support.
> >
> > Cc: stable@...r.kernel.org
> > Signed-off-by: WANG Rui <wangrui@...ngson.cn>
> > ---
> > rust/Makefile | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/rust/Makefile b/rust/Makefile
> > index ea3849eb78f6..2c57c624fe7d 100644
> > --- a/rust/Makefile
> > +++ b/rust/Makefile
> > @@ -232,7 +232,8 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
> > -mfunction-return=thunk-extern -mrecord-mcount -mabi=lp64 \
> > -mindirect-branch-cs-prefix -mstack-protector-guard% -mtraceback=no \
> > -mno-pointers-to-nested-functions -mno-string \
> > - -mno-strict-align -mstrict-align \
> > + -mno-strict-align -mstrict-align -mdirect-extern-access \
> > + -mexplicit-relocs -mno-check-zero-division \
>
> Hmm I'm wondering if we can just drop -mno-check-zero-division from
> cflags-y: for all GCC releases it's the default at either -O2 or -Os,
> and AFAIK we don't support other optimization levels.
Don't rely on default behavior, things may change in future.
Acked-by: Huacai Chen <chenhuacai@...ngson.cn>
>
> --
> Xi Ruoyao <xry111@...111.site>
> School of Aerospace Science and Technology, Xidian University
Powered by blists - more mailing lists