diff mbox series

[2/2] package/e2fsprogs: fix compile error for SH

Message ID ZNdw/pv2sHnp4tXJ@waldemar-brodkorb.de
State Accepted
Headers show
Series [1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_111001 | expand

Commit Message

Waldemar Brodkorb Aug. 12, 2023, 11:46 a.m. UTC
Compile of e2fsprogs is failing because of gcc bug
111001. Workaround it by forcing the usage of -Os.

Compile fails with:
	CC rw_bitmaps.c
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
during RTL pass: sh_treg_combine2
rw_bitmaps.c: In function 'read_bitmaps_range_start':
rw_bitmaps.c:447:1: internal compiler error: Aborted
  447 | }
      | ^
0x5e7a6f ???
	../sysdeps/aarch64/start.S:81
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <http://bugs.buildroot.net/> for instructions.

No need to backport, because gcc 13.2.0 was introduced recently in
Buildroot commit: 3009095ba8a87a22f55f6b89e42f667487563b94

Fixes:
 - http://autobuild.buildroot.net/results/fb7/fb7e9c8b02b979b3a75185c0afa4ab0ca654f6f6
 - http://autobuild.buildroot.net/results/659/659313b1783db491653bcc85b37da40c7b077225

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
 package/e2fsprogs/e2fsprogs.mk | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/package/e2fsprogs/e2fsprogs.mk b/package/e2fsprogs/e2fsprogs.mk
index 75214be8c7..80090621bf 100644
--- a/package/e2fsprogs/e2fsprogs.mk
+++ b/package/e2fsprogs/e2fsprogs.mk
@@ -70,6 +70,11 @@  ifeq ($(BR2_nios2),y)
 E2FSPROGS_CONF_ENV += ac_cv_func_fallocate=no
 endif
 
+# workaround gcc bug 111001
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_111001),y)
+E2FSPROGS_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -Os"
+endif
+
 E2FSPROGS_CONF_ENV += ac_cv_path_LDCONFIG=true
 
 HOST_E2FSPROGS_CONF_ENV += ac_cv_path_LDCONFIG=true