https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107801

--- Comment #7 from Jan Dubiec <jdx at o2 dot pl> ---
OK, I have applied the patch manually to my 12.2.0 tree and libstdc++ has been
partially build. "Partially" because everything seems to be fine for H8/300H,
H8S and H8SX in "advanced mode" (let's call it "32-bit mode") but compilation
fails (in the same file!) in "normal mode" ("16-bit mode"). Note the -mn
option:

[...]
Making all in c++17
make[9]: Entering directory
'/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src/c++17'
/bin/sh ../../libtool --tag CXX --tag disable-shared   --mode=compile
/d/Works/xcomp/gcc-build/./gcc/xgcc -shared-libgcc
-B/d/Works/xcomp/gcc-build/./gcc -nostdinc++
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src/.libs
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/libsupc++/.libs
-B/usr/local/h8300-elf/bin/ -B/usr/local/h8300-elf/lib/ -isystem
/usr/local/h8300-elf/include -isystem /usr/local/h8300-elf/sys-include  -mn
-I/d/Works/xcomp/gcc-12.2.0/libstdc++-v3/../libgcc
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include/h8300-elf
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include
-I/d/Works/xcomp/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 -isystem
/d/Works/xcomp/sysroot/h8300-elf/include  -mn  -c -o floating_from_chars.lo
../../../../../../gcc-12.2.0/libstdc++-v3/src/c++17/floating_from_chars.cc
libtool: compile:  /d/Works/xcomp/gcc-build/./gcc/xgcc -shared-libgcc
-B/d/Works/xcomp/gcc-build/./gcc -nostdinc++
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src/.libs
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/libsupc++/.libs
-B/usr/local/h8300-elf/bin/ -B/usr/local/h8300-elf/lib/ -isystem
/usr/local/h8300-elf/include -isystem /usr/local/h8300-elf/sys-include -mn
-I/d/Works/xcomp/gcc-12.2.0/libstdc++-v3/../libgcc
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include/h8300-elf
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include
-I/d/Works/xcomp/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 -isystem
/d/Works/xcomp/sysroot/h8300-elf/include -mn -c
../../../../../../gcc-12.2.0/libstdc++-v3/src/c++17/floating_from_chars.cc -o
floating_from_chars.o
/bin/sh ../../libtool --tag CXX --tag disable-shared   --mode=compile
/d/Works/xcomp/gcc-build/./gcc/xgcc -shared-libgcc
-B/d/Works/xcomp/gcc-build/./gcc -nostdinc++
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src/.libs
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/libsupc++/.libs
-B/usr/local/h8300-elf/bin/ -B/usr/local/h8300-elf/lib/ -isystem
/usr/local/h8300-elf/include -isystem /usr/local/h8300-elf/sys-include  -mn
-I/d/Works/xcomp/gcc-12.2.0/libstdc++-v3/../libgcc
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include/h8300-elf
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include
-I/d/Works/xcomp/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_to_chars.lo  -fimplicit-templates -isystem
/d/Works/xcomp/sysroot/h8300-elf/include  -mn  -c -o floating_to_chars.lo
../../../../../../gcc-12.2.0/libstdc++-v3/src/c++17/floating_to_chars.cc
libtool: compile:  /d/Works/xcomp/gcc-build/./gcc/xgcc -shared-libgcc
-B/d/Works/xcomp/gcc-build/./gcc -nostdinc++
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src/.libs
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/libsupc++/.libs
-B/usr/local/h8300-elf/bin/ -B/usr/local/h8300-elf/lib/ -isystem
/usr/local/h8300-elf/include -isystem /usr/local/h8300-elf/sys-include -mn
-I/d/Works/xcomp/gcc-12.2.0/libstdc++-v3/../libgcc
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include/h8300-elf
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include
-I/d/Works/xcomp/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_to_chars.lo -fimplicit-templates -isystem
/d/Works/xcomp/sysroot/h8300-elf/include -mn -c
../../../../../../gcc-12.2.0/libstdc++-v3/src/c++17/floating_to_chars.cc -o
floating_to_chars.o
/bin/sh ../../libtool --tag CXX --tag disable-shared   --mode=compile
/d/Works/xcomp/gcc-build/./gcc/xgcc -shared-libgcc
-B/d/Works/xcomp/gcc-build/./gcc -nostdinc++
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src/.libs
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/libsupc++/.libs
-B/usr/local/h8300-elf/bin/ -B/usr/local/h8300-elf/lib/ -isystem
/usr/local/h8300-elf/include -isystem /usr/local/h8300-elf/sys-include  -mn
-I/d/Works/xcomp/gcc-12.2.0/libstdc++-v3/../libgcc
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include/h8300-elf
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include
-I/d/Works/xcomp/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=fs_dir.lo  -fimplicit-templates -isystem
/d/Works/xcomp/sysroot/h8300-elf/include  -mn  -c -o fs_dir.lo
../../../../../../gcc-12.2.0/libstdc++-v3/src/c++17/fs_dir.cc
libtool: compile:  /d/Works/xcomp/gcc-build/./gcc/xgcc -shared-libgcc
-B/d/Works/xcomp/gcc-build/./gcc -nostdinc++
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src/.libs
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/libsupc++/.libs
-B/usr/local/h8300-elf/bin/ -B/usr/local/h8300-elf/lib/ -isystem
/usr/local/h8300-elf/include -isystem /usr/local/h8300-elf/sys-include -mn
-I/d/Works/xcomp/gcc-12.2.0/libstdc++-v3/../libgcc
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include/h8300-elf
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include
-I/d/Works/xcomp/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=fs_dir.lo -fimplicit-templates -isystem
/d/Works/xcomp/sysroot/h8300-elf/include -mn -c
../../../../../../gcc-12.2.0/libstdc++-v3/src/c++17/fs_dir.cc -o fs_dir.o
In file included from
d:\works\xcomp\gcc-12.2.0\libstdc++-v3\src\c++17\fs_dir.cc:37:
d:\works\xcomp\gcc-12.2.0\libstdc++-v3\src\filesystem\dir-common.h: In static
member function 'static std::filesystem::__gnu_posix::DIR*
std::filesystem::_Dir_base::openat(const _At_path&, bool)':
d:\works\xcomp\gcc-12.2.0\libstdc++-v3\src\filesystem\dir-common.h:210:36:
warning: unused parameter 'nofollow' [-Wunused-parameter]
  210 |   openat(const _At_path& atp, bool nofollow)
      |                               ~~~~~^~~~~~~~
d:\works\xcomp\gcc-12.2.0\libstdc++-v3\src\c++17\fs_dir.cc: In member function
'bool std::filesystem::__cxx11::_Dir::do_unlink(bool, std::error_code&) const':
d:\works\xcomp\gcc-12.2.0\libstdc++-v3\src\c++17\fs_dir.cc:147:18: warning:
unused parameter 'is_directory' [-Wunused-parameter]
  147 |   do_unlink(bool is_directory, error_code& ec) const noexcept
      |             ~~~~~^~~~~~~~~~~~
/bin/sh ../../libtool --tag CXX --tag disable-shared   --mode=compile
/d/Works/xcomp/gcc-build/./gcc/xgcc -shared-libgcc
-B/d/Works/xcomp/gcc-build/./gcc -nostdinc++
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src/.libs
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/libsupc++/.libs
-B/usr/local/h8300-elf/bin/ -B/usr/local/h8300-elf/lib/ -isystem
/usr/local/h8300-elf/include -isystem /usr/local/h8300-elf/sys-include  -mn
-I/d/Works/xcomp/gcc-12.2.0/libstdc++-v3/../libgcc
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include/h8300-elf
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include
-I/d/Works/xcomp/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=fs_ops.lo  -fimplicit-templates -isystem
/d/Works/xcomp/sysroot/h8300-elf/include  -mn  -c -o fs_ops.lo
../../../../../../gcc-12.2.0/libstdc++-v3/src/c++17/fs_ops.cc
libtool: compile:  /d/Works/xcomp/gcc-build/./gcc/xgcc -shared-libgcc
-B/d/Works/xcomp/gcc-build/./gcc -nostdinc++
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src/.libs
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/libsupc++/.libs
-B/usr/local/h8300-elf/bin/ -B/usr/local/h8300-elf/lib/ -isystem
/usr/local/h8300-elf/include -isystem /usr/local/h8300-elf/sys-include -mn
-I/d/Works/xcomp/gcc-12.2.0/libstdc++-v3/../libgcc
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include/h8300-elf
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include
-I/d/Works/xcomp/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=fs_ops.lo -fimplicit-templates -isystem
/d/Works/xcomp/sysroot/h8300-elf/include -mn -c
../../../../../../gcc-12.2.0/libstdc++-v3/src/c++17/fs_ops.cc -o fs_ops.o
/bin/sh ../../libtool --tag CXX --tag disable-shared   --mode=compile
/d/Works/xcomp/gcc-build/./gcc/xgcc -shared-libgcc
-B/d/Works/xcomp/gcc-build/./gcc -nostdinc++
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src/.libs
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/libsupc++/.libs
-B/usr/local/h8300-elf/bin/ -B/usr/local/h8300-elf/lib/ -isystem
/usr/local/h8300-elf/include -isystem /usr/local/h8300-elf/sys-include  -mn
-I/d/Works/xcomp/gcc-12.2.0/libstdc++-v3/../libgcc
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include/h8300-elf
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include
-I/d/Works/xcomp/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=fs_path.lo  -fimplicit-templates -isystem
/d/Works/xcomp/sysroot/h8300-elf/include  -mn  -c -o fs_path.lo
../../../../../../gcc-12.2.0/libstdc++-v3/src/c++17/fs_path.cc
libtool: compile:  /d/Works/xcomp/gcc-build/./gcc/xgcc -shared-libgcc
-B/d/Works/xcomp/gcc-build/./gcc -nostdinc++
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src/.libs
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/libsupc++/.libs
-B/usr/local/h8300-elf/bin/ -B/usr/local/h8300-elf/lib/ -isystem
/usr/local/h8300-elf/include -isystem /usr/local/h8300-elf/sys-include -mn
-I/d/Works/xcomp/gcc-12.2.0/libstdc++-v3/../libgcc
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include/h8300-elf
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include
-I/d/Works/xcomp/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=fs_path.lo -fimplicit-templates -isystem
/d/Works/xcomp/sysroot/h8300-elf/include -mn -c
../../../../../../gcc-12.2.0/libstdc++-v3/src/c++17/fs_path.cc -o fs_path.o
/bin/sh ../../libtool --tag CXX --tag disable-shared   --mode=compile
/d/Works/xcomp/gcc-build/./gcc/xgcc -shared-libgcc
-B/d/Works/xcomp/gcc-build/./gcc -nostdinc++
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src/.libs
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/libsupc++/.libs
-B/usr/local/h8300-elf/bin/ -B/usr/local/h8300-elf/lib/ -isystem
/usr/local/h8300-elf/include -isystem /usr/local/h8300-elf/sys-include  -mn
-I/d/Works/xcomp/gcc-12.2.0/libstdc++-v3/../libgcc
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include/h8300-elf
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include
-I/d/Works/xcomp/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=memory_resource.lo  -fimplicit-templates -isystem
/d/Works/xcomp/sysroot/h8300-elf/include  -mn  -c -o memory_resource.lo
../../../../../../gcc-12.2.0/libstdc++-v3/src/c++17/memory_resource.cc
libtool: compile:  /d/Works/xcomp/gcc-build/./gcc/xgcc -shared-libgcc
-B/d/Works/xcomp/gcc-build/./gcc -nostdinc++
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src/.libs
-L/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/libsupc++/.libs
-B/usr/local/h8300-elf/bin/ -B/usr/local/h8300-elf/lib/ -isystem
/usr/local/h8300-elf/include -isystem /usr/local/h8300-elf/sys-include -mn
-I/d/Works/xcomp/gcc-12.2.0/libstdc++-v3/../libgcc
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include/h8300-elf
-I/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/include
-I/d/Works/xcomp/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=memory_resource.lo -fimplicit-templates -isystem
/d/Works/xcomp/sysroot/h8300-elf/include -mn -c
../../../../../../gcc-12.2.0/libstdc++-v3/src/c++17/memory_resource.cc -o
memory_resource.o
d:\works\xcomp\gcc-12.2.0\libstdc++-v3\src\c++17\memory_resource.cc:583:7:
error: static assertion failed
  582 |   static_assert(sizeof(chunk)
      |                 ~~~~~~~~~~~~~
  583 |       == sizeof(bitset::size_type) + sizeof(uint32_t) + 2 *
sizeof(void*));
      |      
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
d:\works\xcomp\gcc-12.2.0\libstdc++-v3\src\c++17\memory_resource.cc:583:7:
note: the comparison reduces to '(12 == 10)'
make[9]: *** [Makefile:585: memory_resource.lo] Error 1
make[9]: Leaving directory
'/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src/c++17'
make[8]: *** [Makefile:781: all-recursive] Error 1
make[8]: Leaving directory
'/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3/src'
make[7]: *** [Makefile:576: all-recursive] Error 1
make[7]: Leaving directory
'/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3'
make[6]: *** [Makefile:501: all] Error 2
make[6]: Leaving directory
'/d/Works/xcomp/gcc-build/h8300-elf/normal/libstdc++-v3'
make[5]: *** [Makefile:870: multi-do] Error 1
make[5]: Leaving directory '/d/Works/xcomp/gcc-build/h8300-elf/libstdc++-v3'
make[4]: *** [Makefile:840: all-multi] Error 2
make[4]: Leaving directory '/d/Works/xcomp/gcc-build/h8300-elf/libstdc++-v3'
make[3]: *** [Makefile:576: all-recursive] Error 1
make[3]: Leaving directory '/d/Works/xcomp/gcc-build/h8300-elf/libstdc++-v3'
make[2]: *** [Makefile:501: all] Error 2
make[2]: Leaving directory '/d/Works/xcomp/gcc-build/h8300-elf/libstdc++-v3'
make[1]: *** [Makefile:12297: all-target-libstdc++-v3] Error 2
make[1]: Leaving directory '/d/Works/xcomp/gcc-build'
make: *** [Makefile:1043: all] Error 2

BTW. I can see -mn option above but AFAIK it has to be used with -mh or -ms or
-msx. So how the build system passes one of these options to the cross
compiler?

Reply via email to