* Problem porting gcc 12
@ 2023-04-10 11:33 Kalamatee
2023-04-10 11:33 ` Kalamatee
2023-04-10 12:14 ` Jonathan Wakely
0 siblings, 2 replies; 8+ messages in thread
From: Kalamatee @ 2023-04-10 11:33 UTC (permalink / raw)
To: gcc-help
[-- Attachment #1: Type: text/plain, Size: 3733 bytes --]
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 '<cstdint>'; did you forget to
'#include <cstdint>'?
+++ |+#include <cstdint>
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?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Problem porting gcc 12
2023-04-10 11:33 Problem porting gcc 12 Kalamatee
@ 2023-04-10 11:33 ` Kalamatee
2023-04-10 12:14 ` Jonathan Wakely
1 sibling, 0 replies; 8+ messages in thread
From: Kalamatee @ 2023-04-10 11:33 UTC (permalink / raw)
To: gcc-help
[-- Attachment #1: Type: text/plain, Size: 206 bytes --]
On Mon, 10 Apr 2023 at 12:33, Kalamatee <kalamatee@gmail.com> wrote:
>
> And since the compiler doesn't define __STDC_LIMIT_MACROS on the command
> line, or in the source file - it is resolved.
>
* isn't
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Problem porting gcc 12
2023-04-10 11:33 Problem porting gcc 12 Kalamatee
2023-04-10 11:33 ` Kalamatee
@ 2023-04-10 12:14 ` Jonathan Wakely
2023-04-10 12:34 ` Kalamatee
1 sibling, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2023-04-10 12:14 UTC (permalink / raw)
To: Kalamatee; +Cc: gcc-help
[-- Attachment #1: Type: text/plain, Size: 4708 bytes --]
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 '<cstdint>'; did you forget to
> '#include <cstdint>'?
> +++ |+#include <cstdint>
> 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 <stdint.h> 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.
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Problem porting gcc 12
2023-04-10 12:14 ` Jonathan Wakely
@ 2023-04-10 12:34 ` Kalamatee
2023-04-10 14:15 ` AW: " Stefan Franke
2023-04-11 9:49 ` Jonathan Wakely
0 siblings, 2 replies; 8+ messages in thread
From: Kalamatee @ 2023-04-10 12:34 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: gcc-help
[-- Attachment #1: Type: text/plain, Size: 4940 bytes --]
Thanks, I'll check that out.
On Mon, 10 Apr 2023, 13:15 Jonathan Wakely, <jwakely.gcc@gmail.com> 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 '<cstdint>'; did you forget to
>> '#include <cstdint>'?
>> +++ |+#include <cstdint>
>> 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 <stdint.h> 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.
>
>>
^ permalink raw reply [flat|nested] 8+ messages in thread
* AW: Problem porting gcc 12
2023-04-10 12:34 ` Kalamatee
@ 2023-04-10 14:15 ` Stefan Franke
2023-04-11 9:49 ` Jonathan Wakely
1 sibling, 0 replies; 8+ messages in thread
From: Stefan Franke @ 2023-04-10 14:15 UTC (permalink / raw)
To: 'Kalamatee', 'Jonathan Wakely'; +Cc: 'gcc-help'
> -----Ursprüngliche Nachricht-----
> Von: Gcc-help <gcc-help-bounces+bebbo=bejy.net@gcc.gnu.org> Im
> Auftrag von Kalamatee via Gcc-help
> Gesendet: Montag, 10. April 2023 14:34
> An: Jonathan Wakely <jwakely.gcc@gmail.com>
> Cc: gcc-help <gcc-help@gcc.gnu.org>
> Betreff: Re: Problem porting gcc 12
>
> Thanks, I'll check that out.
>
> On Mon, 10 Apr 2023, 13:15 Jonathan Wakely, <jwakely.gcc@gmail.com>
> 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/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/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/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=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 '<cstdint>'; did you forget
> >> to '#include <cstdint>'?
> >> +++ |+#include <cstdint>
> >> 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
> > <stdint.h> 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.
> >
> >>
This header file is what you need:
https://raw.githubusercontent.com/bebbo/amiga-gcc/master/sys-include/stdint.h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Problem porting gcc 12
2023-04-10 12:34 ` Kalamatee
2023-04-10 14:15 ` AW: " Stefan Franke
@ 2023-04-11 9:49 ` Jonathan Wakely
2023-04-12 20:44 ` Jonathan Wakely
1 sibling, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2023-04-11 9:49 UTC (permalink / raw)
To: Kalamatee; +Cc: gcc-help
On Mon, 10 Apr 2023 at 13:34, Kalamatee <kalamatee@gmail.com> wrote:
>
> Thanks, I'll check that out.
Actually, it looks like the problem might be much simpler:
fast_float.h fails to include <stdint.h>
Libstdc++ provides its own <stdint.h> 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, <jwakely.gcc@gmail.com> 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 '<cstdint>'; did you forget to
>>> '#include <cstdint>'?
>>> +++ |+#include <cstdint>
>>> 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 <stdint.h> 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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Problem porting gcc 12
2023-04-11 9:49 ` Jonathan Wakely
@ 2023-04-12 20:44 ` Jonathan Wakely
2023-04-12 21:23 ` Kalamatee
0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2023-04-12 20:44 UTC (permalink / raw)
To: Kalamatee; +Cc: gcc-help
On Tue, 11 Apr 2023 at 10:49, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>
> On Mon, 10 Apr 2023 at 13:34, Kalamatee <kalamatee@gmail.com> wrote:
> >
> > Thanks, I'll check that out.
>
> Actually, it looks like the problem might be much simpler:
> fast_float.h fails to include <stdint.h>
>
> Libstdc++ provides its own <stdint.h> 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, <jwakely.gcc@gmail.com> 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 '<cstdint>'; did you forget to
> >>> '#include <cstdint>'?
> >>> +++ |+#include <cstdint>
> >>> 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 <stdint.h> 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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Problem porting gcc 12
2023-04-12 20:44 ` Jonathan Wakely
@ 2023-04-12 21:23 ` Kalamatee
0 siblings, 0 replies; 8+ messages in thread
From: Kalamatee @ 2023-04-12 21:23 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: gcc-help
[-- Attachment #1: Type: text/plain, Size: 6015 bytes --]
Awesome, thanks!
On Wed, 12 Apr 2023 at 21:44, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On Tue, 11 Apr 2023 at 10:49, Jonathan Wakely <jwakely.gcc@gmail.com>
> wrote:
> >
> > On Mon, 10 Apr 2023 at 13:34, Kalamatee <kalamatee@gmail.com> wrote:
> > >
> > > Thanks, I'll check that out.
> >
> > Actually, it looks like the problem might be much simpler:
> > fast_float.h fails to include <stdint.h>
> >
> > Libstdc++ provides its own <stdint.h> 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, <jwakely.gcc@gmail.com>
> 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 '<cstdint>'; did you forget
> to
> > >>> '#include <cstdint>'?
> > >>> +++ |+#include <cstdint>
> > >>> 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
> <stdint.h> 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.
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-04-12 21:23 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-10 11:33 Problem porting gcc 12 Kalamatee
2023-04-10 11:33 ` Kalamatee
2023-04-10 12:14 ` Jonathan Wakely
2023-04-10 12:34 ` Kalamatee
2023-04-10 14:15 ` AW: " Stefan Franke
2023-04-11 9:49 ` Jonathan Wakely
2023-04-12 20:44 ` Jonathan Wakely
2023-04-12 21:23 ` Kalamatee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).