Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/libpcap: fix m68k-cf compile issue
@ 2024-08-14 13:09 Waldemar Brodkorb
  2024-08-14 17:57 ` Thomas Petazzoni via buildroot
  2024-09-16  9:26 ` Peter Korsgaard
  0 siblings, 2 replies; 7+ messages in thread
From: Waldemar Brodkorb @ 2024-08-14 13:09 UTC (permalink / raw)
  To: buildroot

Compilation with -Os triggers this assembler problem.

Fixes:
 - http://autobuild.buildroot.net/results/db5/db58215fb3c7f30b6c0f0764a84271010346edfb

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
 package/libpcap/libpcap.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/libpcap/libpcap.mk b/package/libpcap/libpcap.mk
index a4523f2218..257ec77e08 100644
--- a/package/libpcap/libpcap.mk
+++ b/package/libpcap/libpcap.mk
@@ -57,5 +57,11 @@ ifeq ($(BR2_microblaze)$(BR2_sparc)$(BR2_sparc64),y)
 LIBPCAP_CFLAGS += -fPIC
 endif
 
+# Enable default optimizations to not run into "Error: value -602 out of range"
+# assembler issues. -Os triggers the issue.
+ifeq ($(BR2_m68k_cf),y)
+LIBPCAP_CFLAGS += -O2
+endif
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
-- 
2.39.2

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Buildroot] [PATCH] package/libpcap: fix m68k-cf compile issue
  2024-08-14 13:09 Waldemar Brodkorb
@ 2024-08-14 17:57 ` Thomas Petazzoni via buildroot
  2024-08-14 18:00   ` Waldemar Brodkorb
  2024-09-16  9:26 ` Peter Korsgaard
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-14 17:57 UTC (permalink / raw)
  To: Waldemar Brodkorb; +Cc: Giulio Benetti, buildroot

Hello Waldemar,

On Wed, 14 Aug 2024 15:09:20 +0200
Waldemar Brodkorb <wbx@openadk.org> wrote:

> Compilation with -Os triggers this assembler problem.
> 
> Fixes:
>  - http://autobuild.buildroot.net/results/db5/db58215fb3c7f30b6c0f0764a84271010346edfb
> 
> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>

[...]

> diff --git a/package/libpcap/libpcap.mk b/package/libpcap/libpcap.mk
> index a4523f2218..257ec77e08 100644
> --- a/package/libpcap/libpcap.mk
> +++ b/package/libpcap/libpcap.mk
> @@ -57,5 +57,11 @@ ifeq ($(BR2_microblaze)$(BR2_sparc)$(BR2_sparc64),y)
>  LIBPCAP_CFLAGS += -fPIC
>  endif
>  
> +# Enable default optimizations to not run into "Error: value -602 out of range"
> +# assembler issues. -Os triggers the issue.
> +ifeq ($(BR2_m68k_cf),y)
> +LIBPCAP_CFLAGS += -O2
> +endif

Thanks for the patch, but this is not how we handle gcc or binutils
bugs. Instead, we report the bug upstream, and once the bug is
reported, we add a BR2_TOOLCHAIN_HAS_GCC_BUG_12345 or
BR2_TOOLCHAIN_HAS_BINUTILS_BUG_12345 (depending on which component is
affected), this option is enabled on a per-architecture basis, and
sometimes per-gcc version basis, and then the workaround in the package
is made conditional on this option. This allows us to track to which
GCC/binutils bug a workaround is related, and from to time check if the
issue has been fixed in newer versions of gcc/binutils.

See toolchain/Config.in for a lot of examples. Giulio in Cc can also
help with this, he is our resident expert in BR2_TOOLCHAIN_HAS_xyz_BUG
workarounds :-)

Your bug seems somewhat similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104028,
for which we already have BR2_TOOLCHAIN_HAS_GCC_BUG_104028 in
Buildroot. Not sure it is exactly the same bug.

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Buildroot] [PATCH] package/libpcap: fix m68k-cf compile issue
  2024-08-14 17:57 ` Thomas Petazzoni via buildroot
@ 2024-08-14 18:00   ` Waldemar Brodkorb
  2024-08-14 19:13     ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 7+ messages in thread
From: Waldemar Brodkorb @ 2024-08-14 18:00 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Giulio Benetti, buildroot

Hi Thomas,
Thomas Petazzoni wrote,

> Hello Waldemar,
> 
> On Wed, 14 Aug 2024 15:09:20 +0200
> Waldemar Brodkorb <wbx@openadk.org> wrote:
> 
> > Compilation with -Os triggers this assembler problem.
> > 
> > Fixes:
> >  - http://autobuild.buildroot.net/results/db5/db58215fb3c7f30b6c0f0764a84271010346edfb
> > 
> > Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> 
> [...]
> 
> > diff --git a/package/libpcap/libpcap.mk b/package/libpcap/libpcap.mk
> > index a4523f2218..257ec77e08 100644
> > --- a/package/libpcap/libpcap.mk
> > +++ b/package/libpcap/libpcap.mk
> > @@ -57,5 +57,11 @@ ifeq ($(BR2_microblaze)$(BR2_sparc)$(BR2_sparc64),y)
> >  LIBPCAP_CFLAGS += -fPIC
> >  endif
> >  
> > +# Enable default optimizations to not run into "Error: value -602 out of range"
> > +# assembler issues. -Os triggers the issue.
> > +ifeq ($(BR2_m68k_cf),y)
> > +LIBPCAP_CFLAGS += -O2
> > +endif
> 
> Thanks for the patch, but this is not how we handle gcc or binutils
> bugs. Instead, we report the bug upstream, and once the bug is
> reported, we add a BR2_TOOLCHAIN_HAS_GCC_BUG_12345 or
> BR2_TOOLCHAIN_HAS_BINUTILS_BUG_12345 (depending on which component is
> affected), this option is enabled on a per-architecture basis, and
> sometimes per-gcc version basis, and then the workaround in the package
> is made conditional on this option. This allows us to track to which
> GCC/binutils bug a workaround is related, and from to time check if the
> issue has been fixed in newer versions of gcc/binutils.
> 
> See toolchain/Config.in for a lot of examples. Giulio in Cc can also
> help with this, he is our resident expert in BR2_TOOLCHAIN_HAS_xyz_BUG
> workarounds :-)
> 
> Your bug seems somewhat similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104028,
> for which we already have BR2_TOOLCHAIN_HAS_GCC_BUG_104028 in
> Buildroot. Not sure it is exactly the same bug.

Okay, sorry. I was just taking the example from
package/assimp/assimp.mk, which use a similar workaround for m68k.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Buildroot] [PATCH] package/libpcap: fix m68k-cf compile issue
  2024-08-14 18:00   ` Waldemar Brodkorb
@ 2024-08-14 19:13     ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-14 19:13 UTC (permalink / raw)
  To: Waldemar Brodkorb; +Cc: Giulio Benetti, buildroot

On Wed, 14 Aug 2024 20:00:34 +0200
Waldemar Brodkorb <wbx@openadk.org> wrote:


> > Your bug seems somewhat similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104028,
> > for which we already have BR2_TOOLCHAIN_HAS_GCC_BUG_104028 in
> > Buildroot. Not sure it is exactly the same bug.  
> 
> Okay, sorry. I was just taking the example from
> package/assimp/assimp.mk, which use a similar workaround for m68k.

I think the -mxgot is needed when we are building a large binary (but
I'm not 100% sure). On the other hand, disabling optimization is
clearly a workaround for a bug.

Yes, assimp.mk could use some love to better express the different
gcc/binutils bugs.

Maybe even for the mxgot thing we could do something a bit more generic
perhaps.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] package/libpcap: fix m68k-cf compile issue
@ 2024-08-14 23:52 Waldemar Brodkorb
  2024-08-15  7:19 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 7+ messages in thread
From: Waldemar Brodkorb @ 2024-08-14 23:52 UTC (permalink / raw)
  To: buildroot

Compilation with -Os triggers this assembler problem.
The problematic C code contains a long switch statement, so
everything looks like GCC Bug 104028 is triggered.

Fixes:
 - http://autobuild.buildroot.net/results/db5/db58215fb3c7f30b6c0f0764a84271010346edfb

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
v1->v2:
 - use GCC_BUG_XXXXXX instead of arch sepcific stuff, requested by
   Thomas Petazzoni
---
 package/libpcap/libpcap.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/libpcap/libpcap.mk b/package/libpcap/libpcap.mk
index a4523f2218..3d05590da3 100644
--- a/package/libpcap/libpcap.mk
+++ b/package/libpcap/libpcap.mk
@@ -57,5 +57,9 @@ ifeq ($(BR2_microblaze)$(BR2_sparc)$(BR2_sparc64),y)
 LIBPCAP_CFLAGS += -fPIC
 endif
 
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_104028),y)
+LIBPCAP_CFLAGS += -O2
+endif
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
-- 
2.39.2

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Buildroot] [PATCH] package/libpcap: fix m68k-cf compile issue
  2024-08-14 23:52 [Buildroot] [PATCH] package/libpcap: fix m68k-cf compile issue Waldemar Brodkorb
@ 2024-08-15  7:19 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-15  7:19 UTC (permalink / raw)
  To: Waldemar Brodkorb; +Cc: buildroot

On Thu, 15 Aug 2024 01:52:49 +0200
Waldemar Brodkorb <wbx@openadk.org> wrote:

> Compilation with -Os triggers this assembler problem.
> The problematic C code contains a long switch statement, so
> everything looks like GCC Bug 104028 is triggered.
> 
> Fixes:
>  - http://autobuild.buildroot.net/results/db5/db58215fb3c7f30b6c0f0764a84271010346edfb
> 
> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> ---
> v1->v2:
>  - use GCC_BUG_XXXXXX instead of arch sepcific stuff, requested by
>    Thomas Petazzoni
> ---
>  package/libpcap/libpcap.mk | 4 ++++
>  1 file changed, 4 insertions(+)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Buildroot] [PATCH] package/libpcap: fix m68k-cf compile issue
  2024-08-14 13:09 Waldemar Brodkorb
  2024-08-14 17:57 ` Thomas Petazzoni via buildroot
@ 2024-09-16  9:26 ` Peter Korsgaard
  1 sibling, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2024-09-16  9:26 UTC (permalink / raw)
  To: Waldemar Brodkorb; +Cc: buildroot

>>>>> "Waldemar" == Waldemar Brodkorb <wbx@openadk.org> writes:

 > Compilation with -Os triggers this assembler problem.
 > Fixes:
 >  - http://autobuild.buildroot.net/results/db5/db58215fb3c7f30b6c0f0764a84271010346edfb

 > Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>

Committed to 2024.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-09-16  9:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-14 23:52 [Buildroot] [PATCH] package/libpcap: fix m68k-cf compile issue Waldemar Brodkorb
2024-08-15  7:19 ` Thomas Petazzoni via buildroot
  -- strict thread matches above, loose matches on Subject: below --
2024-08-14 13:09 Waldemar Brodkorb
2024-08-14 17:57 ` Thomas Petazzoni via buildroot
2024-08-14 18:00   ` Waldemar Brodkorb
2024-08-14 19:13     ` Thomas Petazzoni via buildroot
2024-09-16  9:26 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox