From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id 019223858D39 for ; Tue, 11 Apr 2023 09:49:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 019223858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x62f.google.com with SMTP id f26so12681445ejb.1 for ; Tue, 11 Apr 2023 02:49:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681206591; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=i1pYYVTSg5my8/KtvXs3uUIodsjV6e87iDb/ds0zvmg=; b=Xws/GxGjxLPPhYT5H5e0ljQFZG+h35hwl8caR9L55xyj3ZeyP7iLG2DXL+q6Cqbkwu n1tlnToXmdz5jywtuvQgufQdRNUU+RkPnTgyOT7NYrQI0SIJeMErYzFNKGfpfZt6mK85 rinRniZvxIclSsODjfBM98r2oGpegXOiZoWzK2LUs/Im/28DSXwjymej8C8Mq4MLQlTL 4djXTdaJ5B41KSABBTfhTPwbAIQiSyDx2FrCwnVGWTHV/aKN0Ju2+2OvL+NirgOks7PV oepbM0AH2a6/7Y+IUiZ9tJAgLbSvpwl2i43Hxk8a8vNMoBynKv9SrqRinxozOGMIr5GN HmlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681206591; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i1pYYVTSg5my8/KtvXs3uUIodsjV6e87iDb/ds0zvmg=; b=Ud+pjy5buOne/u5GxBjiiM88xS3xcOfagFfhoJXaSWwJfKDPFtd5QaIGXvbOn9GnXz FtCJFgBvXUCIWVI3BTeUJ1nNg4YyBc9/PkrlYruAGoQYMQFdDHwAmGSzGrnsIATB34rV XLndWa9WniJrLd4mbzJY9gTSD4kNexUdtZ7ypQGTOwmNqr1vrKj7Mbat8/CXCl6RCzu0 9hr5vGga+UG3cf5G5BMAifkOup+xD+R3pcYdfrPxTn1nQgPtRa2lrjQ3UKiUigWu9T7P r76F3NdiOUmNpAv0YpqBXMhYRRoPGA1HcdmGc5crFXP9IpQpyvleKlBfitlH+JpBsszC UPag== X-Gm-Message-State: AAQBX9fA7kGAXOaoszyNiflPY25IeuZ8i35jJTLn2P0aEu7URFTW+ZOe xHePo6lxoigtb+tmGzPSRmTcdMP4Gplk4G38hjE= X-Google-Smtp-Source: AKy350boa0B2jmBiiiHnM3GAl/cLa4oHKnjB5s+CZzBvne33rpvG7Uy5j1vvVPyOaP6+YCIyXhxsuJRKr1OtKg+Ibzk= X-Received: by 2002:a17:906:1759:b0:931:8502:ad02 with SMTP id d25-20020a170906175900b009318502ad02mr5101253eje.13.1681206591550; Tue, 11 Apr 2023 02:49:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Tue, 11 Apr 2023 10:49:44 +0100 Message-ID: Subject: Re: Problem porting gcc 12 To: Kalamatee Cc: gcc-help Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, 10 Apr 2023 at 13:34, Kalamatee wrote: > > Thanks, I'll check that out. Actually, it looks like the problem might be much simpler: fast_float.h fails to include Libstdc++ provides its own header which should solve the __STDC_LIMITS_MACROS issue with non-conforming C libraries. I'll look into it ... > > On Mon, 10 Apr 2023, 13:15 Jonathan Wakely, wrote= : >> >> >> >> On Mon, 10 Apr 2023, 12:34 Kalamatee via Gcc-help, wrote: >>> >>> Hi, >>> >>> When im trying to build gcc12, I get the following error -: >>> >>> /bin/bash ../../libtool --tag CXX --tag disable-shared --mode=3Dcompi= le >>> /home/test/gcc12/./gcc/xgcc -shared-libgcc -B/home/test/gcc12/./gcc >>> -nostdinc++ -L/home/test/gcc12/x86_64-aros/libstdc++-v3/src >>> -L/home/test/gcc12/x86_64-aros/libstdc++-v3/src/.libs >>> -L/home/test/gcc12/x86_64-aros/libstdc++-v3/libsupc++/.libs >>> -B/home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/cross= tools/x86_64-aros/bin/ >>> -B/home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/cross= tools/x86_64-aros/lib/ >>> -isystem >>> /home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/crossto= ols/x86_64-aros/include >>> -isystem >>> /home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/crossto= ols/x86_64-aros/sys-include >>> -I/home/test/gcc12/src/gcc-12.2.0/libstdc++-v3/../libgcc >>> -I/home/test/gcc12/x86_64-aros/libstdc++-v3/include/x86_64-aros >>> -I/home/test/gcc12/x86_64-aros/libstdc++-v3/include >>> -I/home/test/gcc12/src/gcc-12.2.0/libstdc++-v3/libsupc++ -std=3Dgnu++= 17 >>> -nostdinc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings >>> -Wcast-qual -Wabi=3D2 -fdiagnostics-show-location=3Donce -ffunction-= sections >>> -fdata-sections -frandom-seed=3Dfloating_from_chars.lo -fimplicit-tem= plates >>> -g -O2 -c -o floating_from_chars.lo >>> /home/test/gcc12/src/gcc-12.2.0/libstdc++-v3/src/c++17/floating_from_ch= ars.cc >>> libtool: compile: /home/test/gcc12/./gcc/xgcc -shared-libgcc >>> -B/home/test/gcc12/./gcc -nostdinc++ >>> -L/home/test/gcc12/x86_64-aros/libstdc++-v3/src >>> -L/home/test/gcc12/x86_64-aros/libstdc++-v3/src/.libs >>> -L/home/test/gcc12/x86_64-aros/libstdc++-v3/libsupc++/.libs >>> -B/home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/cross= tools/x86_64-aros/bin/ >>> -B/home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/cross= tools/x86_64-aros/lib/ >>> -isystem >>> /home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/crossto= ols/x86_64-aros/include >>> -isystem >>> /home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/crossto= ols/x86_64-aros/sys-include >>> -I/home/test/gcc12/src/gcc-12.2.0/libstdc++-v3/../libgcc >>> -I/home/test/gcc12/x86_64-aros/libstdc++-v3/include/x86_64-aros >>> -I/home/test/gcc12/x86_64-aros/libstdc++-v3/include >>> -I/home/test/gcc12/src/gcc-12.2.0/libstdc++-v3/libsupc++ -std=3Dgnu++17 >>> -nostdinc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings >>> -Wcast-qual -Wabi=3D2 -fdiagnostics-show-location=3Donce -ffunction-sec= tions >>> -fdata-sections -frandom-seed=3Dfloating_from_chars.lo -fimplicit-templ= ates >>> -g -O2 -c >>> /home/test/gcc12/src/gcc-12.2.0/libstdc++-v3/src/c++17/floating_from_ch= ars.cc >>> -o floating_from_chars.o >>> In file included from >>> /home/test/gcc12/src/gcc-12.2.0/libstdc++-v3/src/c++17/floating_from_ch= ars.cc:77: >>> /home/test/gcc12/src/gcc-12.2.0/libstdc++-v3/src/c++17/fast_float/fast_= float.h: >>> In function 'void >>> {anonymous}::fast_float::round_nearest_tie_even(adjusted_mantissa&, >>> int32_t, callback)': >>> /home/test/gcc12/src/gcc-12.2.0/libstdc++-v3/src/c++17/fast_float/fast_= float.h:2500:12: >>> error: 'UINT64_MAX' was not declared in this scope >>> 2500 | mask =3D UINT64_MAX; >>> | ^~~~~~~~~~ >>> /home/test/gcc12/src/gcc-12.2.0/libstdc++-v3/src/c++17/fast_float/fast_= float.h:1:1: >>> note: 'UINT64_MAX' is defined in header ''; did you forget to >>> '#include '? >>> +++ |+#include >>> 1 | // fast_float by Daniel Lemire >>> make[7]: *** [Makefile:585: floating_from_chars.lo] Error 1 >>> >>> I can see from the preprocessor output, the necessary header is include= d - >>> but is protected with >>> #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) >>> #endif >>> >>> And since the compiler doesn't define __STDC_LIMIT_MACROS on the comman= d >>> line, or in the source file - it is resolved. >>> >>> I'm not sure though, where is the correct place to fix this? >> >> >> >> In the C library. The C++ standard is very clear that __STDC_LIMIT_MACRO= S has no meaning whatsoever in C++. The C library's must define = those macros unconditionally for C++. The C99 standard said the macros are = required for C++, so some C libraries follow that rule, but they should fol= low the C++ standard for C++ code, since C99 only defines C and had no busi= ness trying to specify how C++ works. >> >> If you cannot fix the libc headers then you can #define __STDC_LIMIT_MAC= ROS in your target's os_defines.h header in libstdc++ (I think that's the r= ight workaround, but I'm not at my desk to check it ... Search for that mac= ro in the libstdc++ source to see how other targets handle non-conforming l= ibc headers.