I built GCC #1 (x86_64->sh3) Now I'm trying to build GCC #2 (sh3->sh3) using GCC #1 during the build process, libtool: compile: shle--netbsdelf-c++ --sysroot=/home/fly/sh3/destdir.evbsh3/ -I/current/gcc/libstdc++-v3/../libgcc -I/tmp/build/shle--netbsdelf/libstdc++-v3/include/shle--netbsdelf -I/tmp/build/shle--netbsdelf/libstdc++-v3/include -I/current/gcc/libstdc++-v3/libsupc++ -std=gnu++98 -D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=c++locale.lo -g -O2 -fimplicit-templates -c c++locale.cc -fPIC -DPIC -D_GLIBCXX_SHARED -o c++locale.o mv -f .deps/list_read.Tpo .deps/list_read.Plo In file included from /home/fly/sh3/destdir.evbsh3/usr/include/evbsh3/ieeefp.h:3, from /home/fly/sh3/destdir.evbsh3/usr/include/ieeefp.h:12, from c++locale.cc:40: /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h: In function 'fp_except __FPE(int)': /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:62:13: error: 'FE_DIVBYZERO' was not declared in this scope 62 | if (__fe & FE_DIVBYZERO) | ^~~~~~~~~~~~ /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:64:13: error: 'FE_INEXACT' was not declared in this scope 64 | if (__fe & FE_INEXACT) | ^~~~~~~~~~ /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:66:13: error: 'FE_INVALID' was not declared in this scope; did you mean 'EINVAL'? 66 | if (__fe & FE_INVALID) | ^~~~~~~~~~ | EINVAL /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:68:13: error: 'FE_OVERFLOW' was not declared in this scope; did you mean 'EOVERFLOW'? 68 | if (__fe & FE_OVERFLOW) | ^~~~~~~~~~~ | EOVERFLOW /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:70:13: error: 'FE_UNDERFLOW' was not declared in this scope; did you mean 'UNDERFLOW'? 70 | if (__fe & FE_UNDERFLOW) | ^~~~~~~~~~~~ | UNDERFLOW /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h: In function 'int __FEE(fp_except)': /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:81:11: error: 'FE_DIVBYZERO' was not declared in this scope 81 | __fe |= FE_DIVBYZERO; | ^~~~~~~~~~~~ /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:83:11: error: 'FE_INEXACT' was not declared in this scope 83 | __fe |= FE_INEXACT; | ^~~~~~~~~~ /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:85:11: error: 'FE_INVALID' was not declared in this scope; did you mean 'EINVAL'? 85 | __fe |= FE_INVALID; | ^~~~~~~~~~ | EINVAL /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:87:11: error: 'FE_OVERFLOW' was not declared in this scope; did you mean 'EOVERFLOW'? 87 | __fe |= FE_OVERFLOW; | ^~~~~~~~~~~ | EOVERFLOW /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:89:11: error: 'FE_UNDERFLOW' was not declared in this scope; did you mean 'UNDERFLOW'? 89 | __fe |= FE_UNDERFLOW; | ^~~~~~~~~~~~ | UNDERFLOW /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h: In function 'fp_rnd __FPR(int)': /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:98:7: error: 'FE_TONEAREST' was not declared in this scope 98 | case FE_TONEAREST: | ^~~~~~~~~~~~ /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:100:7: error: 'FE_DOWNWARD' was not declared in this scope 100 | case FE_DOWNWARD: | ^~~~~~~~~~~ /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:102:7: error: 'FE_UPWARD' was not declared in this scope 102 | case FE_UPWARD: | ^~~~~~~~~ /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:104:7: error: 'FE_TOWARDZERO' was not declared in this scope 104 | case FE_TOWARDZERO: | ^~~~~~~~~~~~~ /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h: In function 'int __FER(fp_rnd)': /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:117:10: error: 'FE_TONEAREST' was not declared in this scope 117 | return FE_TONEAREST; | ^~~~~~~~~~~~ /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:119:10: error: 'FE_DOWNWARD' was not declared in this scope 119 | return FE_DOWNWARD; | ^~~~~~~~~~~ /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:121:10: error: 'FE_UPWARD' was not declared in this scope 121 | return FE_UPWARD; | ^~~~~~~~~ /home/fly/sh3/destdir.evbsh3/usr/include/sh3/ieeefp.h:123:10: error: 'FE_TOWARDZERO' was not declared in this scope 123 | return FE_TOWARDZERO; | ^~~~~~~~~~~~~ if everything was working well, this would be the chain of includes. ieeefp.h #include fenv.h -> libstdc++ #2 fenv.h #include_next fenv.h -> libstdc++ #1 fenv.h #include_next fenv.h -> system fenv.h But instead, we get: ieeefp.h #include fenv.h -> libstdc++ #2 fenv.h #include_next fenv.h -> libstdc++ #1 fenv.h nothing (because it shares include guards with libstdc++ #2) so system fenv.h is never reached.
suggested change: put #include_next outside of include guards?
What two fenv.h libstdc++ headers you mean (in what paths they are)? While there is include/tr1/fenv.h include/c_compatibility/fenv.h the former should be included only with <tr1/fenv.h>, not <fenv.h>.
include/c_compatibility/fenv.h
That is one header, not two, so why should that fenv.h's #include_next include that same header or some copy of that header in a different path?
(In reply to Jakub Jelinek from comment #4) > That is one header, not two, so why should that fenv.h's #include_next > include that same header or some copy of that header in a different path? I am in the process of building libstdc++. -I/tmp/build/shle--netbsdelf/libstdc++-v3/include there's a libstdc++ fenv.h there
(In reply to coypu from comment #1) > suggested change: put #include_next outside of include guards? We did something similar for PR 69581
Normally after building the cross, I don't rebuild the target libraries as they were already built once before so I don't run into this issue.