From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DAE743858430; Wed, 25 Oct 2023 23:31:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAE743858430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698276702; bh=oJnxxbjYqe/niIqGMragmgoQ+viLQQRCuVaP6vPp9fI=; h=From:To:Subject:Date:From; b=HPL0pmiTquQLckQjt7f8m2ZwgULNBfvE+0pBHGGMfvDHK0FTIvWLHulc6tivtULhr Av9H4ROPUOcP1RoRxQjBzibahsUtr+YN8Aun2nnZz0loLxEjW/AmPnvNcWLEe+Kgd0 ewwNeU2b9WZOYQssNbWHP+3KXGE0cEUCrCc/8OwA= From: "macro at orcam dot me.uk" To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/112091] New: rs6000: redefinition of 'constexpr long double std::abs(long double)', while building libgm2 Date: Wed, 25 Oct 2023 23:31:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: modula2 X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: macro at orcam dot me.uk X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: gaius at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone cf_gcctarget Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112091 Bug ID: 112091 Summary: rs6000: redefinition of 'constexpr long double std::abs(long double)', while building libgm2 Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: build Severity: normal Priority: P3 Component: modula2 Assignee: gaius at gcc dot gnu.org Reporter: macro at orcam dot me.uk Target Milestone: --- Target: powerpc64le-linux-gnu As from commit 81d5ca0b9b84 ("PR 108143/modula2 LONGREAL and powerpc64le-linux") target libgm2 fails building in a native `powerpc64le-linux-gnu' bootstrap with system glibc 2.28: cc1plus: warning: Using IEEE extended precision 'long double' [-Wpsabi] In file included from .../powerpc64le-linux-gnu/libstdc++-v3/include/cstdlib:81, from .../powerpc64le-linux-gnu/libstdc++-v3/include/stdlib.h:36, from .../libgm2/libm2cor/KeyBoardLEDs.cc:43: .../powerpc64le-linux-gnu/libstdc++-v3/include/bits/std_abs.h:137:3: error: redefinition of 'constexpr long double std::abs(long double)' 137 | abs(__float128 __x) | ^~~ .../powerpc64le-linux-gnu/libstdc++-v3/include/bits/std_abs.h:79:3: note: 'constexpr long double std::abs(long double)' previously defined here 79 | abs(long double __x) | ^~~ make[5]: *** [Makefile:818: KeyBoardLEDs.lo] Error 1 This is apparently because with the `-mabi=3Dieeelongdouble' compilation option used in this configuration we assume the redirection of the `long double' data type to `__float128' and it is only supported by glibc as from commit 051be01f6b41 ("powerpc64le: Enable support for IEEE long double") or released version 2.32. It is not clear to me what the correct solution to this issue would be for glibc < 2.32, i.e. whether we ought to bail out gracefully such as by disabling LONGREAL support, or even the frontend entirely, or whether we could use explicit `__float128' data type rather than `long double'. I guess in the latter case there might be ABI consequences, so it would have to be considered carefully. Input from someone more familiar with the intricacies of the 64-bit POWER ABI might be desirable. Relevant glibc mailing list discussion threads: https://sourceware.org/pipermail/libc-alpha/2020-February/111092.html https://sourceware.org/pipermail/libc-alpha/2020-March/112248.html https://sourceware.org/pipermail/libc-alpha/2020-April/112579.html=