Mainline libgmp autoconfs tries to be smart and uses

    -O2 -pedantic -fomit-frame-pointer -march=armv4 -mfloat-abi=softfp

which leads to `nft list ruleset` crashing, when nft uses some printf
function of libgmp.

The -march=armv4 -mfloat-abi=softfp seems to create arm assembler code
with illegal instructions.  Don't know if these -march and -mfloat-abi
options make sense at all when cross-compiling anyways?

The new options allow for debugging and nft does not crash anymore.

Link: 
https://lore.ptxdist.org/ptxdist/[email protected]/T/#u
Signed-off-by: Alexander Dahl <[email protected]>
---

Notes:
    Not sure about the wording.  Explanations work for me, but could be
    improved maybe?

 rules/libgmp.make | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/rules/libgmp.make b/rules/libgmp.make
index 3ed6faaa3..bf6b88d7c 100644
--- a/rules/libgmp.make
+++ b/rules/libgmp.make
@@ -37,6 +37,11 @@ LIBGMP_LICENSE_FILES := \
 # autoconf
 #
 LIBGMP_CONF_TOOL       := autoconf
+# libgmp autoconf guesses target arch and sets CFLAGS to options leading
+# to crashes on at least armv5te, so override those CFLAGS with working
+# ones, replacing the wrong ones set by libgmp in the first place
+LIBGMP_CONF_ENV     := \
+    CFLAGS='-O2 -pedantic -g'
 LIBGMP_CONF_OPT                := \
        $(CROSS_AUTOCONF_USR) \
        --disable-assert \

base-commit: b922a1e6bf2c7764c3e6032557b259f755464be3
-- 
2.39.5


Reply via email to