From patchwork Tue Jul 7 14:40:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piotr Kubaj X-Patchwork-Id: 138659 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1D6D24BA7984 for ; Tue, 7 Jul 2026 14:42:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D6D24BA7984 X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.anongoth.pl (mail.anongoth.pl [IPv6:2001:470:71:6b::3]) by sourceware.org (Postfix) with ESMTPS id 8333F4BA23C4; Tue, 7 Jul 2026 14:41:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8333F4BA23C4 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=anongoth.pl ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8333F4BA23C4 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2001:470:71:6b::3 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783435293; cv=none; b=foTOcG9EAsfKq617+pMnapPPpslGZvoEXkl86/5lgYbca3XAcTPGCLQKxKNgkDhvlzp0OHvtmHzuxbw+yU+DTlAB2ILTRTA2/rcoJIg6ktZpGVWOG3bGemuOpMnTGFTPY3ZhmuU23lTlOWjKutwdgVI8rNLCvCbbnOJpQ/9ZXoE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783435293; c=relaxed/simple; bh=o3tlSqj0DjlA/mx+s/RRbYG6xTmU9U33VJetRkTDVWM=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=jC1H88F3eNLNC/K6iQsi46Dn1U2nLXc6ufSkltjHwSau5CSSHLTAmxjDFnHpB44geVr+VxVMXBV5IT8KFmOa2DDQAtf9O5nDrcg7SkLNpBcrlJMET038ZA9qtuHviTklZlcUv+OQJcw0BHcnw/SWTU0PTMfY0qcDSK55m/ofNBI= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8333F4BA23C4 Received: by mail.anongoth.pl (Postfix) id 36D1918B16; Tue, 07 Jul 2026 16:41:32 +0200 (CEST) Authentication-Results: mail.anongoth.pl; dmarc=fail (p=none dis=none) header.from=FreeBSD.org From: Piotr Kubaj To: gcc-patches@gcc.gnu.org Cc: fortran@gcc.gnu.org, Segher Boessenkool , "Kewen . Lin" , Peter Bergner , Piotr Kubaj Subject: [PATCH 3/7] libgcc: build the float128 support functions on powerpc*-*-freebsd* Date: Tue, 7 Jul 2026 16:40:05 +0200 Message-ID: <20260707144106.10130-4-pkubaj@FreeBSD.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260707144106.10130-1-pkubaj@FreeBSD.org> References: <20260707144106.10130-1-pkubaj@FreeBSD.org> MIME-Version: 1.0 X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, LOCAL_AUTHENTICATION_FAIL_DMARC, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org The IEEE-128 (__float128 / KFmode) soft-float support functions in libgcc are only built when libgcc_cv_powerpc_float128 is set, and the ISA-2.06 configure check that sets it only runs for powerpc*-*-linux*. On powerpc64le-*-freebsd*, where long double is IEEE binary128, they are needed just as much (libgfortran and any long-double code references e.g. __addkf3, __eqkf2), so run the check there too. Also require __ibm128 in the test, not just VSX: the t-float128 sources the check enables include quad-float128.h, which uses __ibm128. That type is only available when the target has 128-bit long double, so on a target/multilib where long double is 64-bit (e.g. a pre-IEEE FreeBSD release) the VSX-only test would pass but the build would then fail with "unknown type name '__ibm128'". Requiring __ibm128 makes the check reflect what the sources need; it is a no-op on glibc, which always has 128-bit long double on these configurations. libgcc/ChangeLog: * configure.ac (powerpc*-*-freebsd*): Run the PowerPC ISA 2.06 __float128 check. Require __ibm128 in the test. * configure: Regenerate. Signed-off-by: Piotr Kubaj --- libgcc/configure.ac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libgcc/configure.ac b/libgcc/configure.ac --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -432,13 +432,14 @@ # check if we have VSX (ISA 2.06) support to build the software libraries, and # whether the assembler can handle xsaddqp for hardware support. Also check if # a new glibc is being used so that __builtin_cpu_supports can be used. -powerpc*-*-linux*) +powerpc*-*-linux* | powerpc*-*-freebsd*) saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128" AC_CACHE_CHECK([for PowerPC ISA 2.06 to build __float128 libraries], [libgcc_cv_powerpc_float128], [AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([vector double dadd (vector double a, vector double b) { return a + b; }])], + [AC_LANG_SOURCE([vector double dadd (vector double a, vector double b) { return a + b; } +__ibm128 conftest_ibm128;])], [libgcc_cv_powerpc_float128=yes], [libgcc_cv_powerpc_float128=no])])