[Buildroot] [PATCH] package/zeromq: fix build failure due to binutils bug 21464
giulio.benetti at benettiengineering.com
Mon Mar 22 13:15:08 UTC 2021
On 3/17/21 4:49 PM, Giulio Benetti wrote:
> Hi Thomas,
> On 3/17/21 4:45 PM, Giulio Benetti wrote:
>> The zeromq package exhibits binutils bug 21464 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_BINUTILS_BUG_21464=y.
>> Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>
>> package/zeromq/zeromq.mk | 10 +++++++++-
>> 1 file changed, 9 insertions(+), 1 deletion(-)
>> diff --git a/package/zeromq/zeromq.mk b/package/zeromq/zeromq.mk
>> index 182699403c..135b07b6c6 100644
>> --- a/package/zeromq/zeromq.mk
>> +++ b/package/zeromq/zeromq.mk
>> @@ -23,12 +23,20 @@ ZEROMQ_CONF_ENV = libzmq_cv_sock_cloexec=yes \
>> libzmq_cv_tcp_keepidle=yes \
>> +ZEROMQ_CXXFLAGS = $(TARGET_CXXFLAGS)
>> # Internal error, aborting at dwarf2cfi.c:2752 in connect_traces
>> # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58864
>> ifeq ($(BR2_m68k_cf),y)
>> -ZEROMQ_CONF_OPTS += CXXFLAGS="$(TARGET_CXXFLAGS) -fno-defer-pop"
>> +ZEROMQ_CXXFLAGS += -fno-defer-pop
>> +ifeq ($(BR2_TOOLCHAIN_HAS_BINUTILS_BUG_21464),y)
>> +ZEROMQ_CXXFLAGS += -O0
>> +ZEROMQ_CONF_OPTS += CXXFLAGS="$(ZEROMQ_CXXFLAGS)"
>> # Only tools/curve_keygen.c needs this, but it doesn't hurt to pass it
>> # for the rest of the build as well (which automatically includes stdc++).
>> ifeq ($(BR2_STATIC_LIBS),y)
> this patch works around binutils bug 21464 for this package.
> The other packages affected by binutils bug 21464 seem affected by
> another bug instead and at the moment can't be worked around, I'll try
> to find a possible work around.
OpenRisc binutils 21464 bug has a fix:
I've tested it with binutils:
and works good while building:
zeromq is the only package that could be worked around with -O0.
I would add patches that add patches to all binutils versions, so this
way buildroot toolchain built by buildroot are safe, but I should tag
as buggy all the external openrisc toolchains, basically the one
provided by Bootlin. This implies adding patches to disable building
libtheora with all its dependencies and I can do it, or otherwise we can
wait for Bootlin to release a new fixed openrisc toolchain, what about that?
Also, zeromq is worked around using -O0 by this:
protobuf has already been disabled by this:
libtheora needs a new patch taking care of dependencies.
In the meanwhile I've provided patch with the fix for binutils:
Benetti Engineering sas
More information about the buildroot