Skip to contentSkip to conversation

package/asterisk: fix gcc bug 93847

PATCH New Giulio Benetti 2 participants 7 messages Mar 5, 2021 – Mar 16, 2021

lore
Share & tools
lore
#0 lore raw

cover package/asterisk: fix gcc bug 93847

First patch needs to allow Buildroot to build with its CFLAGS instead of Asterisk hardcoded one, while the second applies the gcc bug work-around.

Giulio Benetti (2):
package/asterisk: remove default -O3 optimization flag package/asterisk: fix build failure due to gcc bug 93847

 package/asterisk/asterisk.mk | 11 +++++++++++
 1 file changed, 11 insertions(+)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/2 package/asterisk: remove default -O3 optimization flag

Actually asterisk package gets built with -O3 cflag since it's defaulted into its sources, but it's not what we want, so let's empty its OPTIMIZE Makefile variable letting Buildroot CFLAGS to take place instead.

---
 package/asterisk/asterisk.mk | 3 +++
 1 file changed, 3 insertions(+)
package/asterisk/asterisk.mk +3 -0
index b220b54189..f6a4f8f787 100644
@@ -280,6 +280,9 @@ ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
 ASTERISK_MAKE_OPTS += ASTLDFLAGS="-latomic"
 endif
 
+# Remove default -O3 optimization flag
+ASTERISK_MAKE_OPTS += OPTIMIZE=""
+
 # We want to install sample configuration files, too.
 ASTERISK_INSTALL_TARGET_OPTS = \
 	$(ASTERISK_DIRS) \
Signature · 1 line
2.25.1
#2 lore raw

PATCH 1/2 package/asterisk: remove default -O3 optimization flag

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Giulio" == Giulio Benetti <[email protected]> writes:

Actually asterisk package gets built with -O3 cflag since it's defaulted into its sources, but it's not what we want, so let's empty its OPTIMIZE Makefile variable letting Buildroot CFLAGS to take place instead.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/2 package/asterisk: remove default -O3 optimization flag

In reply to Giulio Benetti
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Giulio" == Giulio Benetti <[email protected]> writes:

Actually asterisk package gets built with -O3 cflag since it's defaulted into its sources, but it's not what we want, so let's empty its OPTIMIZE Makefile variable letting Buildroot CFLAGS to take place instead.

Committed to 2020.02.x and 2020.11.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 2/2 package/asterisk: fix build failure due to gcc bug 93847

In reply to Giulio Benetti

The asterisk package exhibits gcc bug 93847 when built for the Nios2 architecture with optimization enabled, which causes a build failure.

As done for other packages in Buildroot work around this gcc bug by setting optimization to -O0 if BR2_TOOLCHAIN_HAS_GCC_BUG_93847=y.

Fixes:
http://autobuild.buildroot.net/results/24c0a6ca3b272711a1e6ceaa033925182d0d49c4

---
 package/asterisk/asterisk.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/asterisk/asterisk.mk +8 -0
index f6a4f8f787..67b6da56db 100644
@@ -283,6 +283,14 @@ endif
 # Remove default -O3 optimization flag
 ASTERISK_MAKE_OPTS += OPTIMIZE=""
 
+ASTERISK_CFLAGS = $(TARGET_CFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),y)
+ASTERISK_CFLAGS += -O0
+endif
+
+ASTERISK_CONF_OPTS += CFLAGS="$(ASTERISK_CFLAGS)"
+
 # We want to install sample configuration files, too.
 ASTERISK_INSTALL_TARGET_OPTS = \
 	$(ASTERISK_DIRS) \
Signature · 1 line
2.25.1
#5 lore raw

PATCH 2/2 package/asterisk: fix build failure due to gcc bug 93847

Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Giulio" == Giulio Benetti <[email protected]> writes:

The asterisk package exhibits gcc bug 93847 when built for the Nios2 architecture with optimization enabled, which causes a build failure.

Quoted 7 lines

As done for other packages in Buildroot work around this gcc bug by setting optimization to -O0 if BR2_TOOLCHAIN_HAS_GCC_BUG_93847=y.

Fixes:
http://autobuild.buildroot.net/results/24c0a6ca3b272711a1e6ceaa033925182d0d49c4

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#6 lore raw

PATCH 2/2 package/asterisk: fix build failure due to gcc bug 93847

In reply to Giulio Benetti
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Giulio" == Giulio Benetti <[email protected]> writes:

The asterisk package exhibits gcc bug 93847 when built for the Nios2 architecture with optimization enabled, which causes a build failure.

Quoted 7 lines

As done for other packages in Buildroot work around this gcc bug by setting optimization to -O0 if BR2_TOOLCHAIN_HAS_GCC_BUG_93847=y.

Fixes:
http://autobuild.buildroot.net/results/24c0a6ca3b272711a1e6ceaa033925182d0d49c4

Committed to 2020.02.x and 2020.11.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard