From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 10 Dec 2024 17:12:19 +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 1tL2qQ-006RGe-31 for lore@lore.pengutronix.de; Tue, 10 Dec 2024 17:12:19 +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 1tL2qR-0001t1-58; Tue, 10 Dec 2024 17:12:19 +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 1tL2qC-0001sr-2v for ptxdist@pengutronix.de; Tue, 10 Dec 2024 17:12:04 +0100 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 862F71483E70 for ; Tue, 10 Dec 2024 17:12:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=dkim; t=1733847121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PKghMW31ZflltNwpA7N6JdaVd5RmNe2+zYxAySbGW98=; b=Tkqt6C4fzNYTIwmSgIjgi636xqfUcW+niHJMXvOgTfuZ6F4wiG7mNjBSx4HPIKixWRSrnN kmhrl9HTGJ4ekQMW70eiPqW0F/7t+coEMp8iezoKacTjjbliLm8lWjLmy/a+aOgnfdahtd nd2PaZNUzEcrcF61ymBfrxazwRgeyDlLEJpPfLVkcsTCvLnbWWBHOz1+RJwuxjPA3Pk5hC oveOVOx1Oj+MZXJCJGFDZHIKOJkr14FdFQ7qNYSVSWtEUESOSlZGxKuYHV31cV7o+zfUtk 4duKrZdBfLg4PotNw0hn9/hgAmDeMk8cIUW7i5ctPVRy4WPE/Bsf9gYlrmSqyw== Date: Tue, 10 Dec 2024 17:11:59 +0100 From: Alexander Dahl To: ptxdist@pengutronix.de Message-ID: <20241210-pesticide-garnet-ef57e562fa17@thorsis.com> Mail-Followup-To: ptxdist@pengutronix.de MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/2.2.12 (2023-09-09) 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.2 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] libgmp 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 Hei hei, I'm using nftables and on an armv5te target (microchip at91 sam9x60) the command `nft list ruleset` crashes with 'illegal instruction'. BSP is on ptxdist-2024.05.0 with the latest libgmp 6.3 backported from master. Toolchain is precompiled OSELAS.Toolchain-2023.07.1/arm-v5te-linux-gnueabi from debian.pengutronix.de, so overall nothing special. `ptxdist prepare libgmp` gives this (somewhere in between): using ABI="32" CC="arm-v5te-linux-gnueabi-gcc" CFLAGS="-O2 -pedantic -fomit-frame-pointer -march=armv4 -mfloat-abi=softfp" CPPFLAGS="" MPN_PATH=" arm generic" After staring at configure.ac and configure I guess they try to be smart here, but do not detect the actual arch. Analzing the coredump with cgdb suggests it fails in __gmp_doprnt() shows this: 1│ Dump of assembler code for function __gmp_doprnt: 2│ 0xb6d69840 <+0>: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} 3├──> 0xb6d69844 <+4>: vpush {d8} 4│ 0xb6d69848 <+8>: sub sp, sp, #132 @ 0x84 That instruction seems to be some VFP related ARM floating point thing? I tried adding this to rules/libgmp.make: LIBGMP_CONF_ENV := \ CFLAGS='-O2 -pedantic -g' This gives almost the same output of prepare, but with "my" cflags only, so without -march or -mfloat-abi and then nft does not crash anymore. I could use that as a workaround, but it seems to circumvent libgmp arch detection entirely, and so I'm not sure if that's the correct way here? btw, you can see libgmp autoconf is not so super smart, because this is the output of `ptxdist prepare libgmp` on v7a target: using ABI="32" CC="arm-v7a-linux-gnueabihf-gcc" CFLAGS="-O2 -pedantic -fomit-frame-pointer -march=armv4 -mfloat-abi=hard" CPPFLAGS="" MPN_PATH=" arm generic" So it's still -march=armv4 here. But is that really necessary with the cross compiler at all? Greets Alex