[Buildroot] [PATCH 1/1] package/haproxy: fix runtime 'FATAL ERROR: invalid code detected -- cannot go further'

Peter Korsgaard peter at korsgaard.com
Sat Jan 13 21:13:13 UTC 2024


>>>>> "Aleksandr" == Aleksandr Makarov <aleksandr.o.makarov at gmail.com> writes:

 > Forcing HAPROXY_CFLAGS on the haproxy build command line overrides CFLAGS
 > which were internally set by the package Makefile.

 > In such a way, a bunch of flags that were deduced by the package build script
 > in *_CFLAGS variables, specifically in SPEC_CFLAGS, are omitted. Compiling and
 > running haproxy without SPEC_CFLAGS taken into account results in runtime error:

 > $ haproxy
 > FATAL ERROR: invalid code detected -- cannot go further, please recompile!
 > The source code was miscompiled by the compiler, which usually indicates that
 > some of the CFLAGS needed to work around overzealous compiler optimizations
 > were overwritten at build time. Please do not force CFLAGS, and read Makefile
 > and INSTALL files to decide on the best way to pass your local build options.
 > ...

 > This error is produced by haproxy.c [1] source which effectively ensures that INT_MAX+1
 > expression wraps around using twos-complement representation. It is only true when -fwrapv
 > gcc option is set in SPEC_CFLAGS.

 > To address this, append necessary *_CFLAGS variables to the CFLAGS in haproxy Makefile.

 > [1] https://git.haproxy.org/?p=haproxy.git;a=blob;f=src/haproxy.c;h=e1863255422459e806f7e50828e81976bb41c14c;hb=HEAD#l3304

 > Signed-off-by: Aleksandr Makarov <aleksandr.o.makarov at gmail.com>
 > ---
 >  ...fix-runtime-FATAL-ERROR-invalid-code.patch | 50 +++++++++++++++++++
 >  1 file changed, 50 insertions(+)
 >  create mode 100644 package/haproxy/0002-package-haproxy-fix-runtime-FATAL-ERROR-invalid-code.patch

 > diff --git a/package/haproxy/0002-package-haproxy-fix-runtime-FATAL-ERROR-invalid-code.patch b/package/haproxy/0002-package-haproxy-fix-runtime-FATAL-ERROR-invalid-code.patch
 > new file mode 100644
 > index 0000000000..39706048f3
 > --- /dev/null
 > +++ b/package/haproxy/0002-package-haproxy-fix-runtime-FATAL-ERROR-invalid-code.patch
 > @@ -0,0 +1,50 @@
 > +From 9dbf27180c5ae04b11076c46da029bfd1446782a Mon Sep 17 00:00:00 2001
 > +From: Aleksandr Makarov <aleksandr.o.makarov at gmail.com>
 > +Date: Mon, 1 Jan 2024 22:04:15 +0200
 > +Subject: [PATCH 1/1] package/haproxy: fix runtime 'FATAL ERROR: invalid code
 > + detected -- cannot go further'

Has this patch been submitted upstream? If so, what is the status of it?

-- 
Bye, Peter Korsgaard



More information about the buildroot mailing list