Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Waldemar Brodkorb <wbx@openadk.org>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] arch/or1k: fix uClibc issues with fenv enabled
Date: Sun, 30 Aug 2026 19:22:34 +0200	[thread overview]
Message-ID: <apRm2p0SBim7_BtZ@waldemar-brodkorb.de> (raw)
In-Reply-To: <apLDmvqL1lzNhoH5@windsurf>

Hello Thomas,
Thomas Petazzoni wrote,

> Hello Waldemar,
> 
> On Thu, Aug 20, 2026 at 12:15:58AM +0200, Waldemar Brodkorb wrote:
> > OpenRISC architecture can be either soft-float or hard-float, so add the
> > ability to the user to configure it.
> > 
> > GNU libc has hard-float support since 03 May 2024, see here:
> > https://sourceware.org/pipermail/glibc-cvs/2024q2/085211.html
> > There fenv functions f.e. were added to glibc.
> > 
> > uClibc-ng has added fenv functions in commit 8a77b4785acd143d76ccc08142abb39c0100de3d
> > on 27 April 2025.
> > 
> > musl does not have any or1k architecture specific fenv support.
> > 
> > Tested with all 6 combinations of C libraries and float configurations.
> 
> Are you sure? I don't see how your patch solves the soft-float
> configuration.
> 
> > diff --git a/arch/Config.in.or1k b/arch/Config.in.or1k
> > index f42aef9eef..e626907496 100644
> > --- a/arch/Config.in.or1k
> > +++ b/arch/Config.in.or1k
> > @@ -1,3 +1,12 @@
> > +config BR2_OR1K_SOFT_FLOAT
> > +	bool "Use soft-float"
> > +	select BR2_SOFT_FLOAT
> 
> This should be "default y", to preserve existing behavior.
> 
> > +	help
> > +	  If your target CPU does not have a Floating Point Unit (FPU)
> > +	  or a kernel FPU emulator, but you still wish to support
> > +	  floating point functions, then everything will need to be
> > +	  compiled with soft floating point support (-msoft-float).
> > +
> >  config BR2_ARCH
> >  	default "or1k"
> >  
> > diff --git a/package/Makefile.in b/package/Makefile.in
> > index eac28b3a96..69859e8ce4 100644
> > --- a/package/Makefile.in
> > +++ b/package/Makefile.in
> > @@ -106,6 +106,14 @@ TARGET_ABI += -mabi=spe -mfloat-gprs=double -Wa,-me500mc
> >  endif
> >  endif
> >  
> > +# use hard-float option globally for OpenRISC, when not
> > +# soft-float choosen by the user.
> > +ifeq ($(BR2_or1k),y)
> > +ifneq ($(BR2_OR1K_SOFT_FLOAT),y)
> > +TARGET_ABI += -mhard-float
> > +endif
> > +endif
> 
> This needs somehow to go in the toolchain wrapper, so instead of your
> change, you would need something like this:
> 
> diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
> index 180e90856d..16c9e08ba5 100644
> --- a/package/gcc/gcc.mk
> +++ b/package/gcc/gcc.mk
> @@ -212,6 +212,10 @@ ifeq ($(BR2_SOFT_FLOAT),y)
>  ifeq ($(BR2_arm)$(BR2_armeb)$(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el)$(BR2_powerpc)$(BR2_sparc),y)
>  HOST_GCC_COMMON_CONF_OPTS += --with-float=soft
>  endif
> +else
> +ifeq ($(BR2_or1k),y)
> +HOST_GCC_COMMON_CONF_OPTS += --with-float=hard
> +endif
>  endif

The or1k gcc configuration has no --with-float. Only passing
-mhard-float as CFLAGS is possible.

best regards
 Waldemar
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      parent reply	other threads:[~2026-08-30 17:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19 22:15 [Buildroot] [PATCH] arch/or1k: fix uClibc issues with fenv enabled Waldemar Brodkorb
2026-08-29 11:39 ` Thomas Petazzoni via buildroot
2026-08-29 11:42   ` Thomas Petazzoni via buildroot
2026-08-30 17:28     ` Waldemar Brodkorb
2026-08-30 17:22   ` Waldemar Brodkorb [this message]

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=apRm2p0SBim7_BtZ@waldemar-brodkorb.de \
    --to=wbx@openadk.org \
    --cc=buildroot@buildroot.org \
    --cc=thomas.petazzoni@bootlin.com \
    /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