Hi!
I usually cross compile an app from Tumbleweed and for some reason in the last month or two months the compiler started to fail. It seems that it’s trying to use the C++ headers from the native system. I’m getting a header not found error when trying to use anything from the C++ standard library:
x86_64-w64-mingw32-g++ -O2 -g -pipe -Wall -fexceptions --param=ssp-buffer-size=4 -mms-bitfields -MD -MP -DDEBUG -DEE_DEBUG -DEE_MEMORY_MANAGER -m64 -g -B /usr/bin/x86_64-w64-mingw32- -Wall -o "../../obj/windows/x86_64/debug/pugixml-static/pugixml.o" -MF "../../obj/windows/x86_64/debug/pugixml-static/pugixml.d" -c "../../src/thirdparty/pugixml/pugixml.cpp"
In file included from /usr/include/c++/12/exception:37,
from ../../src/thirdparty/pugixml/pugixml.hpp:31,
from ../../src/thirdparty/pugixml/pugixml.cpp:17:
/usr/include/c++/12/x86_64-suse-linux/bits/c++config.h:3:10: fatal error: bits/wordsize.h: No such file or directory
3 | #include <bits/wordsize.h>
| ^~~~~~~~~~~~~~~~~
But if I check the include paths used by the compiler they seem fine:
echo | x86_64-w64-mingw32-g++ -E -Wp,-v - 15:41:50
ignoring nonexistent directory "/usr/x86_64-w64-mingw32/sys-root/usr/local/include"
ignoring nonexistent directory "/usr/lib64/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib64/gcc/x86_64-w64-mingw32/12.2.0/include
/usr/lib64/gcc/x86_64-w64-mingw32/12.2.0/include-fixed
/usr/x86_64-w64-mingw32/sys-root/mingw/include
End of search list.
# 0 "<stdin>"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "<stdin>"
I’m unable to find what’s going on, but this exact build was working perfectly fine before.
Any help will be appreciated.
Thanks
I just realized that I checked incorrectly the include paths, mingw32 and mingw64 are reporting incorrects include paths for C++:
prognoz@makyo /h/p/e/m/windows> echo|x86_64-w64-mingw32-g++-xc++-E-v-
Using built-in specs.
COLLECT_GCC=x86_64-w64-mingw32-g++
Target: x86_64-w64-mingw32
Configured with: ../configure --prefix=/usr --bindir=/usr/bin --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib64 --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --build=x86_64-suse-linux-gnu --host=x86_64-suse-
linux-gnu --target=x86_64-w64-mingw32 --with-gnu-as --with-gnu-ld --verbose --without-newlib --disable-multilib --enable-shared --disable-plugin --with-system-zlib --disable-nls --without-included-gettext --disable-win32-registry --enable-threads=posix
--enable-version-specific-runtime-libs --with-sysroot=/usr/x86_64-w64-mingw32/sys-root --enable-languages=c,c++,fortran,objc,obj-c++ --without-x --enable-hash-synchronization --enable-fully-dynamic-string --enable-libgomp --enable-linker-build-id --di
sable-vtable-verify --with-pkgversion='SUSE Linux'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.2.0 (SUSE Linux)
COLLECT_GCC_OPTIONS='-E' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/lib64/gcc/x86_64-w64-mingw32/12.2.0/cc1plus -E -quiet -v -D_REENTRANT - -mtune=generic -march=x86-64 -dumpbase -
ignoring nonexistent directory "/usr/x86_64-w64-mingw32/sys-root/usr/local/include"
ignoring nonexistent directory "/usr/lib64/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/12/
/usr/include/c++/12/x86_64-suse-linux/
/usr/lib64/gcc/x86_64-w64-mingw32/12.2.0/include/c++
/usr/lib64/gcc/x86_64-w64-mingw32/12.2.0/include/c++/x86_64-w64-mingw32
/usr/lib64/gcc/x86_64-w64-mingw32/12.2.0/include/c++/backward
/usr/lib64/gcc/x86_64-w64-mingw32/12.2.0/include
/usr/lib64/gcc/x86_64-w64-mingw32/12.2.0/include-fixed
/usr/x86_64-w64-mingw32/sys-root/mingw/include
End of search list.
# 0 "<stdin>"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "<stdin>"
COMPILER_PATH=/usr/lib64/gcc/x86_64-w64-mingw32/12.2.0/:/usr/lib64/gcc/x86_64-w64-mingw32/12.2.0/:/usr/lib64/gcc/x86_64-w64-mingw32/:/usr/lib64/gcc/x86_64-w64-mingw32/12.2.0/:/usr/lib64/gcc/x86_64-w64-mingw32/
LIBRARY_PATH=/usr/lib64/gcc/x86_64-w64-mingw32/12.2.0/:/usr/x86_64-w64-mingw32/sys-root/mingw/lib/../lib/:/usr/x86_64-w64-mingw32/sys-root/mingw/lib/
COLLECT_GCC_OPTIONS='-E' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
prognoz@makyo /h/p/e/m/windows> echo|i686-w64-mingw32-g++-xc++-E-v-
Using built-in specs.
COLLECT_GCC=i686-w64-mingw32-g++
Target: i686-w64-mingw32
Configured with: ../configure --prefix=/usr --bindir=/usr/bin --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib64 --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --build=x86_64-suse-linux-gnu --host=x86_64-suse-
linux-gnu --target=i686-w64-mingw32 --with-gnu-as --with-gnu-ld --verbose --without-newlib --disable-multilib --enable-shared --disable-plugin --with-system-zlib --disable-nls --without-included-gettext --disable-win32-registry --enable-threads=posix -
-enable-version-specific-runtime-libs --with-sysroot=/usr/i686-w64-mingw32/sys-root --enable-languages=c,c++,fortran,objc,obj-c++ --without-x --enable-hash-synchronization --enable-fully-dynamic-string --enable-libgomp --enable-linker-build-id --disabl
e-vtable-verify --with-pkgversion='SUSE Linux'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.2.0 (SUSE Linux)
COLLECT_GCC_OPTIONS='-E' '-v' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
/usr/lib64/gcc/i686-w64-mingw32/12.2.0/cc1plus -E -quiet -v -D_REENTRANT - -mtune=generic -march=pentiumpro -dumpbase -
ignoring nonexistent directory "/usr/i686-w64-mingw32/sys-root/usr/local/include"
ignoring nonexistent directory "/usr/lib64/gcc/i686-w64-mingw32/12.2.0/../../../../i686-w64-mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/12/
/usr/include/c++/12/x86_64-suse-linux/
/usr/lib64/gcc/i686-w64-mingw32/12.2.0/include/c++
/usr/lib64/gcc/i686-w64-mingw32/12.2.0/include/c++/i686-w64-mingw32
/usr/lib64/gcc/i686-w64-mingw32/12.2.0/include/c++/backward
/usr/lib64/gcc/i686-w64-mingw32/12.2.0/include
/usr/lib64/gcc/i686-w64-mingw32/12.2.0/include-fixed
/usr/i686-w64-mingw32/sys-root/mingw/include
End of search list.
# 0 "<stdin>"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "<stdin>"
COMPILER_PATH=/usr/lib64/gcc/i686-w64-mingw32/12.2.0/:/usr/lib64/gcc/i686-w64-mingw32/12.2.0/:/usr/lib64/gcc/i686-w64-mingw32/:/usr/lib64/gcc/i686-w64-mingw32/12.2.0/:/usr/lib64/gcc/i686-w64-mingw32/
LIBRARY_PATH=/usr/lib64/gcc/i686-w64-mingw32/12.2.0/:/usr/i686-w64-mingw32/sys-root/mingw/lib/../lib/:/usr/i686-w64-mingw32/sys-root/mingw/lib/
COLLECT_GCC_OPTIONS='-E' '-v' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
This seems to be a bug in the corresponding packages since /usr/include/c++/12/
and /usr/include/c++/12/x86_64-suse-linux/ shouldn’t be there.