Skip to contentSkip to conversation

package/haproxy: fix runtime 'FATAL ERROR: invalid code detected -- cannot go further

PATCH Superseded Aleksandr Makarov 3 participants 4 messages Feb 4, 2024 – Feb 29, 2024

lore
Share & tools
lore
#0 lore raw

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

This is a re-spin of v1 that was modifying haproxy's Makefile and was rejected by upstream [1].

I made a v2 that makes changes to haproxy.mk recipe instead and dropped the .patch to program source.

[1] https://www.mail-archive.com/[email protected]/msg44499.html

Aleksandr Makarov (1):
package/haproxy: fix runtime 'FATAL ERROR: invalid code detected --
cannot go further'

 package/haproxy/haproxy.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

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

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

Among those omitted CFLAGS is -fwrapv. Compiling haproxy without it and and then running the program results in runtime error:

$ haproxy
FATAL ERROR: invalid code detected -- cannot go further, please recompile!
...

To address this issue, include HAPROXY_CFLAGS in the DEFINE variable instead of CFLAGS in haproxy.mk.

---
Changes v1 -> v2
- Drop patch for haproxy program Makefile, make changes to haproxy.mk instead

---
 package/haproxy/haproxy.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/haproxy/haproxy.mk +1 -1
index 63a92090f3..61a9ebebe4 100644
@@ -82,7 +82,7 @@ endif
 
 define HAPROXY_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
-		$(HAPROXY_MAKE_OPTS) CFLAGS="$(HAPROXY_CFLAGS)" -C $(@D)
+		$(HAPROXY_MAKE_OPTS) DEFINE="$(HAPROXY_CFLAGS)" -C $(@D)
 endef
 
 define HAPROXY_INSTALL_TARGET_CMDS
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

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

Aleksandr, All,

On 2024-02-04 22:16 +0200, Aleksandr Makarov spake thusly:

Quoted 6 lines

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

Among those omitted CFLAGS is -fwrapv. Compiling haproxy without it and and then running the program results in runtime error:

Quoted 6 lines
$ haproxy
FATAL ERROR: invalid code detected -- cannot go further, please recompile!
...

To address this issue, include HAPROXY_CFLAGS in the DEFINE variable instead of CFLAGS in haproxy.mk.

You forgot to add your Signed-off-by line here, but I messed up and applied and pushed.

/me goes fumble with his git hooks to understand why that was not caught...

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 27 lines

---
Changes v1 -> v2
- Drop patch for haproxy program Makefile, make changes to haproxy.mk instead

---
 package/haproxy/haproxy.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/haproxy/haproxy.mk +1 -1
index 63a92090f3..61a9ebebe4 100644
@@ -82,7 +82,7 @@ endif
 
 define HAPROXY_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
-		$(HAPROXY_MAKE_OPTS) CFLAGS="$(HAPROXY_CFLAGS)" -C $(@D)
+		$(HAPROXY_MAKE_OPTS) DEFINE="$(HAPROXY_CFLAGS)" -C $(@D)
 endef
 
 define HAPROXY_INSTALL_TARGET_CMDS
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

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

In reply to Aleksandr Makarov
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Aleksandr" == Aleksandr Makarov <[email protected]> writes:

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

Among those omitted CFLAGS is -fwrapv. Compiling haproxy without it and and then running the program results in runtime error:

$ haproxy
FATAL ERROR: invalid code detected -- cannot go further, please recompile!
...
Quoted 6 lines

To address this issue, include HAPROXY_CFLAGS in the DEFINE variable instead of CFLAGS in haproxy.mk.

---
Changes v1 -> v2
- Drop patch for haproxy program Makefile, make changes to haproxy.mk instead

Committed to 2023.02.x and 2023.11.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot