diff mbox series

[1/2] package/fwts: Fix build with BR2_OPTIMIZE_0

Message ID 20230709095058.1547133-1-bernd@kuhls.net
State Accepted
Headers show
Series [1/2] package/fwts: Fix build with BR2_OPTIMIZE_0 | expand

Commit Message

Bernd Kuhls July 9, 2023, 9:50 a.m. UTC
Fixes:
http://autobuild.buildroot.net/results/fab/fabd031d38cb618cdb11b4a86cd853b0da61695b/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 package/fwts/fwts.mk | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Thomas Petazzoni July 9, 2023, 4:29 p.m. UTC | #1
On Sun,  9 Jul 2023 11:50:57 +0200
Bernd Kuhls <bernd@kuhls.net> wrote:

> Fixes:
> http://autobuild.buildroot.net/results/fab/fabd031d38cb618cdb11b4a86cd853b0da61695b/
> 
> Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
> ---
>  package/fwts/fwts.mk | 4 ++++
>  1 file changed, 4 insertions(+)

I've applied, but of course it isn't really nice. Has this issue been
reported upstream?

Thanks!

Thomas
Bernd Kuhls July 9, 2023, 4:42 p.m. UTC | #2
Am Sun, 9 Jul 2023 18:29:38 +0200 schrieb Thomas Petazzoni via buildroot:

> I've applied, but of course it isn't really nice. Has this issue been
> reported upstream?

Hi Thomas,

yes, back in 2017: https://bugs.launchpad.net/fwts/+bug/1687049

That bug report was solved by using -O2.

Investigating further I found https://gcc.gnu.org/bugzilla/show_bug.cgi?
id=102502#c4 which, to the best of my limited C knowledge, indicates that 
some assert code will not work with -O0 by design. At this point I 
stopped my research and disabled -O0 ;)

Regards, Bernd
Thomas Petazzoni July 9, 2023, 4:46 p.m. UTC | #3
Hello,

On Sun, 09 Jul 2023 18:42:31 +0200
Bernd Kuhls <bernd@kuhls.net> wrote:

> yes, back in 2017: https://bugs.launchpad.net/fwts/+bug/1687049
> 
> That bug report was solved by using -O2.
> 
> Investigating further I found https://gcc.gnu.org/bugzilla/show_bug.cgi?
> id=102502#c4 which, to the best of my limited C knowledge, indicates that 
> some assert code will not work with -O0 by design. At this point I 
> stopped my research and disabled -O0 ;)

Alright, thanks for the additional details!

Thomas
Peter Korsgaard July 17, 2023, 1:02 p.m. UTC | #4
>>>>> "Bernd" == Bernd Kuhls <bernd@kuhls.net> writes:

 > Fixes:
 > http://autobuild.buildroot.net/results/fab/fabd031d38cb618cdb11b4a86cd853b0da61695b/

 > Signed-off-by: Bernd Kuhls <bernd@kuhls.net>

Committed to 2023.02.x and 2023.05.x, thanks.
diff mbox series

Patch

diff --git a/package/fwts/fwts.mk b/package/fwts/fwts.mk
index f04c7a848f..3af54a1afd 100644
--- a/package/fwts/fwts.mk
+++ b/package/fwts/fwts.mk
@@ -15,6 +15,10 @@  FWTS_DEPENDENCIES = host-bison host-flex host-pkgconf libglib2 libbsd \
 	$(if $(BR2_PACKAGE_BASH_COMPLETION),bash-completion) \
 	$(if $(BR2_PACKAGE_DTC),dtc)
 
+ifeq ($(BR2_OPTIMIZE_0),y)
+FWTS_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -O1"
+endif
+
 ifeq ($(BR2_PACKAGE_FWTS_EFI_RUNTIME_MODULE),y)
 FWTS_MODULE_SUBDIRS = efi_runtime
 $(eval $(kernel-module))