From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 17 Dec 2024 09:43:31 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tNTAx-009ANM-0c for lore@lore.pengutronix.de; Tue, 17 Dec 2024 09:43:31 +0100 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1tNTAx-0005sJ-D8; Tue, 17 Dec 2024 09:43:31 +0100 Received: from mail.thorsis.com ([217.92.40.78]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tNTAp-0005s8-JI for ptxdist@pengutronix.de; Tue, 17 Dec 2024 09:43:24 +0100 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E2BD01483E95 for ; Tue, 17 Dec 2024 09:43:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=dkim; t=1734425002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=I1zZb5cBb4CsxOhakYYgYgu4Cuhe4BSqTvpfC60WfrM=; b=tFYukzYqWuTKtSCKm2yiW5z2GBk1kYYDcKruhCAeVWdxs2clE25FrZCWK1f/lM/T5LPxCP CvsdJEFh4t86NezEbfc8ScGIOhdRv/F6xJE+4TVjtERsIJg6+p3TT2PuIsaMBCbv7ubABR tW+kqzKt04B0RWfA/Pltt3n0Y1kcJW79f+kRNanFgRStz9kYc+xxlbcLljBFYCffsu9beR bLahJulLtB5SfLfdwHKzIjCJCX/eCLisWkjOEgAkvC+x6SAKUTM7OJbxdky4aImNADbJGK LzbDb14RaYpObLBE2T1fuefTk06N9tjJ9N6SUgyHT0D8twupDUDaGIcPAHb3+w== From: Alexander Dahl To: ptxdist@pengutronix.de Date: Tue, 17 Dec 2024 09:43:18 +0100 Message-Id: <20241217084318.2038729-1-ada@thorsis.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-3.1 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Subject: [ptxdist] [PATCH] libgmp: Override CFLAGS X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false 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/20241210-pesticide-garnet-ef57e562fa17@thorsis.com/T/#u Signed-off-by: Alexander Dahl --- 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