From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2FF5E3857C43; Fri, 29 Sep 2023 14:07:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2FF5E3857C43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695996430; bh=q4Q+ScUjyEOwK2GqTdkIRbvj51WQhIkUKcbA6GqU5Ro=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qySprWkdADB8TffVXNFGUglWJpBwAmGAmwNNnytQxKwEBCTxUJaI3ZV/KzEyxzToG GPCqllBwnbXmXpP0uXHlBzZWNpePmZhu6Lkls7yufpydQG0b4pUna7gm2MLLrbmFFZ ksI6sRN1F9CAEAI3b6aDg4HsDUmSQA5PLzd47FIc= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/111639] HAVE_ACOSF etc. are wrong on avr Date: Fri, 29 Sep 2023 14:07:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed blocked cf_reconfirmed_on bug_status Message-ID: In-Reply-To: References: 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=3D111639 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Blocks| |79700 Last reconfirmed| |2023-09-29 Status|UNCONFIRMED |NEW --- Comment #1 from Jonathan Wakely --- This blocks the fix for PR 79700 because of these lying macros. The crossconfig.m4 changes were made in 2016 by g:6649ad7efdd583d84099beb5ee2b03a0ed28b9ee purportedly to fix duplicate definitions in math_stubs_float.cc, e.g. In file included from /home/jwakely/src/gcc/build-avr/gcc-obj/avr/libstdc++-v3/include/cmath:47, from /home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++98/math_stubs_float.cc:25: /home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++98/math_stubs_float.cc:35:3: error: conflicting declaration of C function 'float fabs(float)' 35 | fabsf(float x) | ^~~~~ /usr/avr/include/math.h:146:15: note: previous declaration 'double fabs(double)' 146 | extern double fabs(double __x) __ATTR_CONST__; | ^~~~ But these are caused by the macros in avr , which mean that we end = up defining another fabs instead of the intended fabsf. I think the correct fix is to remove the crossconfig.m4 changes and do this instead: --- a/libstdc++-v3/src/c++98/math_stubs_float.cc +++ b/libstdc++-v3/src/c++98/math_stubs_float.cc @@ -31,6 +31,7 @@ extern "C" { #ifndef _GLIBCXX_HAVE_FABSF +#undef fabsf float fabsf(float x) { And similarly for the other functions in that file. If defining those functions bloats libstdc++ too much for avr, then we can consider defining the float and long double stubs as aliases of each other (since float, double and long double all seem to be the same size on avr). We could even define them inline in headers, instead of in the lib: extern "C" inline float fabs(float __x) { return fabs((double)__x); } But the first priority should be to remove the bogus HAVE_FABSF definitions= in crossconfig.m4 Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D79700 [Bug 79700] std::fabsf and std::fabsl missing from =