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 ED07B3857707 for ; Wed, 12 Apr 2023 20:44:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ED07B3857707 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 z9so5062162ejx.11 for ; Wed, 12 Apr 2023 13:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681332252; 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=tJfpMEXgN7dIvhcc+STfziFtZR50YCTRBbUgkW+FfTQ=; b=RESxXaD2UCudZFn9IcmmOccOgr2zAAR/hI9rtBzvDEEH7EKbxsYtOxumOfU+KgPAJ6 1uMY5Fk7NuJ+lk/lupClHZFzJqKkuPC7TFv3WGqt6zdlBzbHuGep2+BkLKDRt7fawz7w 73BiKdw0UEQ++lUp591Hj2hzNEZ6Njnkwt8p1LUWDmmcueEymWt+cyq9Fr8wCd7gsNGM hvEJ9pVIeHYHWInqcCbw+cUOlWGFGUyCtaCxIL+anNOZHWTpdsbgRCURKQ0dtKwyqpjJ Gzog7ZSoSsllSbiH3KhcQiVVm1Jnv+3hi6wpc4J8PSKxwhOnPtAVkktbySps27O7u9Pm DB9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681332252; 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=tJfpMEXgN7dIvhcc+STfziFtZR50YCTRBbUgkW+FfTQ=; b=VcbYVb/aPoedJyDGOc7GZCG/z8gk3npuKx4LzA1HAweg/xAjmk8NyXs8wsdXdinpwX /NYqF5V0UwJAQrJMQK7mo8gq77dDkTI5WcGpLSkv2xjpcvo5LnqCqzlucQt5bO6EQEQu +SGNR6ZffkpzWKmaKJ8E6O/oaC0clzmapm/PTQ7hXjzp3Y0gGszPUyDI1x5iph9UI6Km e4EuztM2cWwwMnKwv2D6RFW2w1xL03ZQ0oJ9LPjR5KyETdPBGwvSeB8jj8tFQ/7SzhfM X1XVsB9tdIDPzD2dv4Fxvb/nORurlmFnQPFv4EUljqHP3CkNZAwi1MZ15mA3mo9fqJsu vwlA== X-Gm-Message-State: AAQBX9dWzJBNaqDhPl2/XTwCZIIxF9ZIZ8y6MTeLSejNnL4KC3miitxw vzT+kHYbitv3ztli4yKt0H7ARdHk2+WEiVhd6jA= X-Google-Smtp-Source: AKy350ZGMIm6CcNHA6Z+EcViHsyG791jdFQmIr/ncMY7saAvxWwjcos7SD4NMx4/ghvYBwMenSi074dmoLc6IL0bI0M= X-Received: by 2002:a17:906:3091:b0:94a:a6ac:8a2d with SMTP id 17-20020a170906309100b0094aa6ac8a2dmr82083ejv.13.1681332252497; Wed, 12 Apr 2023 13:44:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Wed, 12 Apr 2023 21:44:05 +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,KAM_SHORT,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 Tue, 11 Apr 2023 at 10:49, Jonathan Wakely wrote= : > > 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 ... Now fixed for gcc-12 and trunk: https://gcc.gnu.org/pipermail/gcc-patches/2023-April/615601.html > > > > On Mon, 10 Apr 2023, 13:15 Jonathan Wakely, wro= te: > >> > >> > >> > >> 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=3Dcom= pile > >>> /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/cro= sstools/x86_64-aros/bin/ > >>> -B/home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/cro= sstools/x86_64-aros/lib/ > >>> -isystem > >>> /home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/cross= tools/x86_64-aros/include > >>> -isystem > >>> /home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/cross= tools/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 -ffunctio= n-sections > >>> -fdata-sections -frandom-seed=3Dfloating_from_chars.lo -fimplicit-t= emplates > >>> -g -O2 -c -o floating_from_chars.lo > >>> /home/test/gcc12/src/gcc-12.2.0/libstdc++-v3/src/c++17/floating_from_= chars.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/cro= sstools/x86_64-aros/bin/ > >>> -B/home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/cro= sstools/x86_64-aros/lib/ > >>> -isystem > >>> /home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/cross= tools/x86_64-aros/include > >>> -isystem > >>> /home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/cross= tools/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-s= ections > >>> -fdata-sections -frandom-seed=3Dfloating_from_chars.lo -fimplicit-tem= plates > >>> -g -O2 -c > >>> /home/test/gcc12/src/gcc-12.2.0/libstdc++-v3/src/c++17/floating_from_= chars.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_= chars.cc:77: > >>> /home/test/gcc12/src/gcc-12.2.0/libstdc++-v3/src/c++17/fast_float/fas= t_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/fas= t_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/fas= t_float.h:1:1: > >>> note: 'UINT64_MAX' is defined in header ''; did you forget t= o > >>> '#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 inclu= ded - > >>> but is protected with > >>> #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) > >>> #endif > >>> > >>> And since the compiler doesn't define __STDC_LIMIT_MACROS on the comm= and > >>> 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_MAC= ROS has no meaning whatsoever in C++. The C library's must defin= e those macros unconditionally for C++. The C99 standard said the macros ar= e required for C++, so some C libraries follow that rule, but they should f= ollow the C++ standard for C++ code, since C99 only defines C and had no bu= siness trying to specify how C++ works. > >> > >> If you cannot fix the libc headers then you can #define __STDC_LIMIT_M= ACROS in your target's os_defines.h header in libstdc++ (I think that's the= right workaround, but I'm not at my desk to check it ... Search for that m= acro in the libstdc++ source to see how other targets handle non-conforming= libc headers.