From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by sourceware.org (Postfix) with ESMTPS id 53CB73858D33 for ; Wed, 12 Apr 2023 21:23:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 53CB73858D33 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-lf1-x136.google.com with SMTP id t20so16443528lfd.5 for ; Wed, 12 Apr 2023 14:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681334617; x=1683926617; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JyJN3M7XEgrc+rlKeMzehX1hjih8iJBKJleIQ8aN590=; b=WsQeyhgXefkM8HUo04kSrxYQ0vFvFCvEVwvOXYUDGeRhDnTQtiAB2yk0tB8McGu6g6 ZD1eQ+KCDkVhTt3Ss70KTK3PXG3kQT9ICEdZ6krJ4I6TLaLlOpbD93VNAmvtNTENkb87 YG4dFWeJpyCVMkt4/Thkw4ryqu+arf8l+cmckrHfalNNL/f3kk9VHHjyJbzgNp67Uvty 0hYrNeeCTouaIu8becg4cgbImB/QD820I42FoaM/slT4xuBAbmF5BcHET8fRnxwqr+DV KQC17nwpcOCQoHyPTpPo0kDBQu13ir3RxTrDq/k3jkkGhHT+AAKi1iGJT43tOmav8qxy xUmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681334617; x=1683926617; h=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=JyJN3M7XEgrc+rlKeMzehX1hjih8iJBKJleIQ8aN590=; b=UEtCl2tmEka1/42z9W3QLkiUDx1yzQzg/bCoUTQ+F+KxOh2/GtVC9GM5LmP7jFKVVJ ac0qmIyFKV4yCq/Jla3CSBe1F34UG6VNJ/LK22RTrKmYR8UqD/JRIm4y9bP4JBrYqYPn 1mK7gG3eK66jaO9KhJK3X8P2dPTNfGgLWQZ1s3VSS9Zhi+vS4Ll2vzORRJSjuoOZ/Uy7 9O020J0QmlZCGRa+5wYD1AL7DOd3W3wAxpimZkjhUSP2wDzv/AkPsXZbiP6BPjVMrWj1 rxCMow/WRYG+KZzSQReH4s8vmYRVkWdNH1nXXbs8wkPr0ZJGslRMDdt5sXIL9yHLiGKu 3pxw== X-Gm-Message-State: AAQBX9eFZd5qTFQIlryhnhgo+/HYvVfl8r1irKpSPKLb7imW0XdM5hRu XVycLHCmDVtTmkVGyTjv8r/oRvuWwhuquw4c5Ng= X-Google-Smtp-Source: AKy350b8f6o98m6Ig/kmFDxPtTDGMC5srUNyFYit0RYr0I5R5IRtxoZRwn07WuLl3dKafX+L7toQGIKIxKBlCYpBRyk= X-Received: by 2002:a19:7001:0:b0:4db:266c:4337 with SMTP id h1-20020a197001000000b004db266c4337mr108399lfc.1.1681334616455; Wed, 12 Apr 2023 14:23:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kalamatee Date: Wed, 12 Apr 2023 22:23:25 +0100 Message-ID: Subject: Re: Problem porting gcc 12 To: Jonathan Wakely Cc: gcc-help Content-Type: multipart/alternative; boundary="0000000000009000ee05f92a38d7" X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,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: --0000000000009000ee05f92a38d7 Content-Type: text/plain; charset="UTF-8" Awesome, thanks! On Wed, 12 Apr 2023 at 21:44, Jonathan Wakely wrote: > 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, > wrote: > > >> > > >> > > >> > > >> On Mon, 10 Apr 2023, 12:34 Kalamatee via Gcc-help, < > gcc-help@gcc.gnu.org> wrote: > > >>> > > >>> Hi, > > >>> > > >>> When im trying to build gcc12, I get the following error -: > > >>> > > >>> /bin/bash ../../libtool --tag CXX --tag disable-shared > --mode=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/crosstools/x86_64-aros/bin/ > > >>> > -B/home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/crosstools/x86_64-aros/lib/ > > >>> -isystem > > >>> > /home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/crosstools/x86_64-aros/include > > >>> -isystem > > >>> > /home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/crosstools/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=gnu++17 > > >>> -nostdinc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings > > >>> -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once > -ffunction-sections > > >>> -fdata-sections -frandom-seed=floating_from_chars.lo > -fimplicit-templates > > >>> -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/crosstools/x86_64-aros/bin/ > > >>> > -B/home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/crosstools/x86_64-aros/lib/ > > >>> -isystem > > >>> > /home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/crosstools/x86_64-aros/include > > >>> -isystem > > >>> > /home/kalam/builds/pc-x86_64-gcc12-clean/bin/linux-x86_64/tools/crosstools/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=gnu++17 > > >>> -nostdinc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings > > >>> -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once > -ffunction-sections > > >>> -fdata-sections -frandom-seed=floating_from_chars.lo > -fimplicit-templates > > >>> -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/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 = 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 > included - > > >>> but is protected with > > >>> #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) > > >>> #endif > > >>> > > >>> And since the compiler doesn't define __STDC_LIMIT_MACROS on the > command > > >>> 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_MACROS 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 follow the C++ standard for C++ code, since C99 > only defines C and had no business trying to specify how C++ works. > > >> > > >> If you cannot fix the libc headers then you can #define > __STDC_LIMIT_MACROS 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 macro in the libstdc++ source to see how other targets > handle non-conforming libc headers. > --0000000000009000ee05f92a38d7--