meta-mingw - how to use the SDK on Windows
A message that is not in the archive (sent off-list or not yet received): [email protected]
What I realize is that on Linux I get a script to execute that then relocates the SDK, rewrites paths etc. The windows SDK is just an archive, there is no installer script. Nevertheless it contains post- relocate-setup.sh - but no Windows batch file.
Do my problems stem from the fact that the SDK is not setup correctly? So I am missing an installation or post-decompress step?
Still struggling, thanks for any hints!
BR
Dave
Am Freitag, dem 09.05.2025 um 08:55 +0000 schrieb David Daniel via lists.yoctoproject.org:
Quoted 152 lines
Hi there
I have trouble using the SDK on Windows generated by meta-mingw. There
are a few minor changes that need to be made to the environment setup file, namely the SDKROOT variable needs to be modified to only contain
forward slashes - those paths get passed to gcc. So I modified this according to some link I found:https://github.com/darko31/yocto_cross_compile_sdk/blob/main/readme_win.md
By replacing the first line with
set SDKROOT=%~dp0%
set "SDKROOT=%SDKROOT:\=/%"The second thing was that the cmake.bat file was missing in the windows
sysroots environment.d folder, there was only acmake.shfile. But its
easy to create it withset CMAKE_TOOLCHAIN_FILE=%OECORE_NATIVE_SYSROOT%/usr/share/cmake/OEToolch ainConfig.cmake
set OE_CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=64The third thing was that within the Windows sysroots
usr/share/cmakefolder there was no generated toolchain file that came from the template. So there were only two files:- OEToolchainConfig.cmake
- SDKToolchainConfig.cmake.templateWhereas in the linux SDK there is a third file that was generated by the SDKToolchainConfig.cmake.template file.
But even when I fix the above I cannot succeed to configure a build with cmake and the toolchain. I always get the error "is not able to compile a simple test program." with complaints that libs and objects cannot be found (cannot find Scrt1.o, cannot find crti.o, cannot find crtbebinS.o, cannot find -lgcc).
I simply call:
cmake -G Ninja --toolchain %CMAKE_TOOLCHAIN_FILE% -B build -S .
And I get
-- The CXX compiler identification is GNU 14.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler:
C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64-bf133- linux/powerpc64-bf133-linux-g++.exe
-- Check for working CXX compiler:
C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64-bf133- linux/powerpc64-bf133-linux-g++.exe - broken
CMake Error at C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/share/cmake-3.31/Modules/CMakeTestCXXCompiler.cmake:73 (message):
The C++ compiler"C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/powerpc64-bf133-linux-g++.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir:
'C:/dev/netcan/build/CMakeFiles/CMakeScratch/TryCompile-9amgcb'Run Build Command(s): C:/PROGRA~1/ninja/ninja.exe -v
cmTC_01890
[1/2] C:\dev\sdk\bf133\sysroots\x86_64-w64- mingw32\usr\bin\powerpc64-bf133-linux\powerpc64-bf133-linux-g++.exe(quoted diff) +0
-2-mbig-endian -mhard-float -m64 -mcpu=e5500 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux - -sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -O2 -g - pipe -o
CMakeFiles/cmTC_01890.dir/testCXXCompiler.cxx.o-c C:/dev/netcan/build/CMakeFiles/CMakeScratch/TryCompile- 9amgcb/testCXXCompiler.cxx
[2/2] C:\Windows\system32\cmd.exe /C "cd . && C:\dev\sdk\bf133\sysroots\x86_64-w64-mingw32\usr\bin\powerpc64-bf133- linux\powerpc64-bf133-linux-g++.exe -mbig-endian -mhard-float -m64 -mcpu=e5500 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 - Wformat -Wformat-security -Werror=format-security -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -O2 -g - pipe -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,- z,nowCMakeFiles/cmTC_01890.dir/testCXXCompiler.cxx.o-ocmTC_01890&& cd ."
FAILED:cmTC_01890
C:\Windows\system32\cmd.exe /C "cd . && C:\dev\sdk\bf133\sysroots\x86_64-w64-mingw32\usr\bin\powerpc64-bf133- linux\powerpc64-bf133-linux-g++.exe -mbig-endian -mhard-float -m64 -mcpu=e5500 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 - Wformat -Wformat-security -Werror=format-security -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -O2 -g - pipe -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,- z,nowCMakeFiles/cmTC_01890.dir/testCXXCompiler.cxx.o-ocmTC_01890&& cd ."
C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64-bf133- linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find Scrt1.o:
No such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64-bf133- linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find crti.o: No such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64-bf133- linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find crtbeginS.o: No such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64-bf133- linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find -lgcc: No such file or directory
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.CMake will not be able to correctly generate this project. Call Stack (most recent call first):
CMakeLists.txt:2 (project)-- Configuring incomplete, errors occurred!
Am I doing something wrong? Are there additional requirements for the Windows SDK except the configuration of SDKMACHINE?
Thanks for any hints, we keep struggling with this. I'd rather have my
colleagues use Linux but I cannot change that, unfortunately.BR
Dave-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#65300):
https://lists.yoctoproject.org/g/yocto/message/65300
Mute This Topic: https://lists.yoctoproject.org/mt/112895370/7801465
Group Owner: [email protected] Unsubscribe:
https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
There is no setup script on Windows to "install" the SDK like there is on Linux, so there's not really anything missing. There shouldn't be any relocation that needs to happen, but it's also possible cmake isn't working in the MinGW SDK for some reason.
Quoted 169 lines · David Daniel via lists.yoctoproject.org
What I realize is that on Linux I get a script to execute that then relocates the SDK, rewrites paths etc. The windows SDK is just an archive, there is no installer script. Nevertheless it contains post-
relocate-setup.sh- but no Windows batch file.Do my problems stem from the fact that the SDK is not setup correctly? So I am missing an installation or post-decompress step?
Still struggling, thanks for any hints!
BR
DaveAm Freitag, dem 09.05.2025 um 08:55 +0000 schrieb David Daniel via lists.yoctoproject.org:
Quoted 136 lines
Hi there
I have trouble using the SDK on Windows generated by meta-mingw. There
are a few minor changes that need to be made to the environment setup file, namely the SDKROOT variable needs to be modified to only contain
forward slashes - those paths get passed to gcc. So I modified this according to some link I found:https://github.com/darko31/yocto_cross_compile_sdk/blob/main/readme_win.md
By replacing the first line with
set SDKROOT=%~dp0% set "SDKROOT=%SDKROOT:\=/%"The second thing was that the cmake.bat file was missing in the windows
sysroots environment.d folder, there was only acmake.shfile. But its
easy to create it withset
CMAKE_TOOLCHAIN_FILE=%OECORE_NATIVE_SYSROOT%/usr/share/cmake/OEToolch ainConfig.cmake
set OE_CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=64The third thing was that within the Windows sysroots
usr/share/cmakefolder there was no generated toolchain file that came from the template. So there were only two files:- OEToolchainConfig.cmake
- SDKToolchainConfig.cmake.templateWhereas in the linux SDK there is a third file that was generated by the SDKToolchainConfig.cmake.template file.
But even when I fix the above I cannot succeed to configure a build with cmake and the toolchain. I always get the error "is not able to compile a simple test program." with complaints that libs and objects cannot be found (cannot find Scrt1.o, cannot find crti.o, cannot find crtbebinS.o, cannot find -lgcc).
I simply call:
cmake -G Ninja --toolchain %CMAKE_TOOLCHAIN_FILE% -B build -S .
And I get
-- The CXX compiler identification is GNU 14.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler:
C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64-bf133- linux/powerpc64-bf133-linux-g++.exe
-- Check for working CXX compiler:
C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64-bf133- linux/powerpc64-bf133-linux-g++.exe - brokenCMake Error at C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/share/cmake-3.31/Modules/CMakeTestCXXCompiler.cmake:73 (message):
The C++ compiler"C:/dev/sdk/bf133/sysroots/x86_64-w64-
mingw32/usr/bin/powerpc64-bf133-linux/powerpc64-bf133-linux-g++.exe"is not able to compile a simple test program.
It fails with the following output:
Change Dir:
'C:/dev/netcan/build/CMakeFiles/CMakeScratch/TryCompile-9amgcb'Run Build Command(s): C:/PROGRA~1/ninja/ninja.exe -v
cmTC_01890[1/2] C:\dev\sdk\bf133\sysroots\x86_64-w64-mingw32\usr\bin\powerpc64-bf133-linux\powerpc64-bf133-linux-g++.exe
(quoted diff) +0
-2-mbig-endian -mhard-float -m64 -mcpu=e5500 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -
-sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -O2 -g -
pipe -oCMakeFiles/cmTC_01890.dir/testCXXCompiler.cxx.o-c C:/dev/netcan/build/CMakeFiles/CMakeScratch/TryCompile- 9amgcb/testCXXCompiler.cxx[2/2] C:\Windows\system32\cmd.exe /C "cd . &&C:\dev\sdk\bf133\sysroots\x86_64-w64-mingw32\usr\bin\powerpc64-bf133-
linux\powerpc64-bf133-linux-g++.exe -mbig-endian -mhard-float -m64
-mcpu=e5500 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 - Wformat -Wformat-security -Werror=format-security -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -O2 -g - pipe -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,- z,nowCMakeFiles/cmTC_01890.dir/testCXXCompiler.cxx.o-ocmTC_01890&& cd ."FAILED: cmTC_01890 C:\Windows\system32\cmd.exe /C "cd . &&C:\dev\sdk\bf133\sysroots\x86_64-w64-mingw32\usr\bin\powerpc64-bf133-
linux\powerpc64-bf133-linux-g++.exe -mbig-endian -mhard-float -m64
-mcpu=e5500 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 - Wformat -Wformat-security -Werror=format-security -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -O2 -g - pipe -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,- z,nowCMakeFiles/cmTC_01890.dir/testCXXCompiler.cxx.o-ocmTC_01890&& cd ."C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64-bf133- linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find Scrt1.o: No such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64-bf133- linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find crti.o: No such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64-bf133- linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find crtbeginS.o: No such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64-bf133- linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find -lgcc: No such file or directory
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)-- Configuring incomplete, errors occurred!
Am I doing something wrong? Are there additional requirements for the Windows SDK except the configuration of SDKMACHINE?
Quoted 8 lines
Thanks for any hints, we keep struggling with this. I'd rather have my
colleagues use Linux but I cannot change that, unfortunately.BR
Dave-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#65301): https://lists.yoctoproject.org/g/yocto/message/65301
Mute This Topic: https://lists.yoctoproject.org/mt/112895370/3616693
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Thanks for that clarification. It seems that linking in general does not work:
powerpc64-bf133-linux-gcc.exe -mbig-endian -mhard-float -m64 -mcpu=e5500 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -LC:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux/usr/lib64 main.c
C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64-bf133-linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find Scrt1.o: No such file or directory
C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64-bf133-linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find crti.o: No such file or directory
C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64-bf133-linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find crtbeginS.o: No such file or directory
C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64-bf133-linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find -lgcc: No such file or directory
C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64-bf133-linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find -lgcc: No such file or directory
collect2.exe: error: ld returned 1 exit statusBut the files are present in C:/dev/sdk/bf133/sysroots/ppc64e5500-vrag- linux/usr/lib64.
It seems there is something broken with the Windows SDK. This is a simple hello world main. There is no such problem with the Linux SDK, that one works flawlessly. I am still puzzled how to solve this.
Am Freitag, dem 09.05.2025 um 08:25 -0600 schrieb Joshua Watt:
Quoted 220 lines
There is no setup script on Windows to "install" the SDK like there is
on Linux, so there's not really anything missing. There shouldn't be any relocation that needs to happen, but it's also possible cmake isn't working in the MinGW SDK for some reason.Quoted 211 lines · David Daniel via lists.yoctoproject.org
What I realize is that on Linux I get a script to execute that then relocates the SDK, rewrites paths etc. The windows SDK is just an archive, there is no installer script. Nevertheless it contains post-
relocate-setup.sh- but no Windows batch file.Do my problems stem from the fact that the SDK is not setup correctly?
So I am missing an installation or post-decompress step?Still struggling, thanks for any hints!
BR
DaveAm Freitag, dem 09.05.2025 um 08:55 +0000 schrieb David Daniel via lists.yoctoproject.org:
Quoted 172 lines
Hi there
I have trouble using the SDK on Windows generated by meta-mingw. There
are a few minor changes that need to be made to the environment setup
file, namely the SDKROOT variable needs to be modified to only contain
forward slashes - those paths get passed to gcc. So I modified this
according to some link I found:https://github.com/darko31/yocto_cross_compile_sdk/blob/main/readme_win.md
By replacing the first line with
set SDKROOT=%~dp0%
set "SDKROOT=%SDKROOT:\=/%"The second thing was that the cmake.bat file was missing in the windows
sysroots environment.d folder, there was only acmake.shfile. But
its
easy to create it withset CMAKE_TOOLCHAIN_FILE=%OECORE_NATIVE_SYSROOT%/usr/share/cmake/OETo olch
ainConfig.cmake
set OE_CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=64The third thing was that within the Windows sysroots
usr/share/cmake
folder there was no generated toolchain file that came from the template. So there were only two files:- OEToolchainConfig.cmake
- SDKToolchainConfig.cmake.templateWhereas in the linux SDK there is a third file that was generated by
the SDKToolchainConfig.cmake.template file.But even when I fix the above I cannot succeed to configure a build
with cmake and the toolchain. I always get the error "is not able to
compile a simple test program." with complaints that libs and objects
cannot be found (cannot find Scrt1.o, cannot find crti.o, cannot find
crtbebinS.o, cannot find -lgcc).I simply call:
cmake -G Ninja --toolchain %CMAKE_TOOLCHAIN_FILE% -B build -S .
And I get
-- The CXX compiler identification is GNU 14.2.0 -- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler:
C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64- bf133-
linux/powerpc64-bf133-linux-g++.exe
-- Check for working CXX compiler:
C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64- bf133-
linux/powerpc64-bf133-linux-g++.exe - broken
CMake Error at C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/share/cmake- 3.31/Modules/CMakeTestCXXCompiler.cmake:73
(message):
The C++ compiler"C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/powerpc64-bf133-linux- g++.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir:
'C:/dev/netcan/build/CMakeFiles/CMakeScratch/TryCompile-9amgcb'Run Build Command(s): C:/PROGRA~1/ninja/ninja.exe -v
cmTC_01890
[1/2] C:\dev\sdk\bf133\sysroots\x86_64-w64- mingw32\usr\bin\powerpc64-bf133-linux\powerpc64-bf133-linux- g++.exe
-mbig-endian -mhard-float -m64 -mcpu=e5500 -fstack-protector- strong
-O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security - Werror=format-
security --sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133- linux - -sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -O2 - g -
pipe -oCMakeFiles/cmTC_01890.dir/testCXXCompiler.cxx.o-c C:/dev/netcan/build/CMakeFiles/CMakeScratch/TryCompile- 9amgcb/testCXXCompiler.cxx
[2/2] C:\Windows\system32\cmd.exe /C "cd . && C:\dev\sdk\bf133\sysroots\x86_64-w64-mingw32\usr\bin\powerpc64- bf133-
linux\powerpc64-bf133-linux-g++.exe -mbig-endian -mhard-float - m64
-mcpu=e5500 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 - Wformat -Wformat-security -Werror=format-security -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -O2 -g -
pipe -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,- z,nowCMakeFiles/cmTC_01890.dir/testCXXCompiler.cxx.o-ocmTC_01890
&& cd ."
FAILED:cmTC_01890
C:\Windows\system32\cmd.exe /C "cd . && C:\dev\sdk\bf133\sysroots\x86_64-w64-mingw32\usr\bin\powerpc64- bf133-
linux\powerpc64-bf133-linux-g++.exe -mbig-endian -mhard-float - m64
-mcpu=e5500 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 - Wformat -Wformat-security -Werror=format-security -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -O2 -g -
pipe -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,- z,nowCMakeFiles/cmTC_01890.dir/testCXXCompiler.cxx.o-ocmTC_01890
&& cd ."
C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64- bf133-
linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find Scrt1.o:
No such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64- bf133-
linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find crti.o: No
such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64- bf133-
linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find crtbeginS.o: No such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64- bf133-
linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find -lgcc:
No
such file or directory
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.CMake will not be able to correctly generate this project. Call Stack (most recent call first):
CMakeLists.txt:2 (project)-- Configuring incomplete, errors occurred!
Am I doing something wrong? Are there additional requirements for the
Windows SDK except the configuration of SDKMACHINE?Quoted 9 lines
Thanks for any hints, we keep struggling with this. I'd rather have
my
colleagues use Linux but I cannot change that, unfortunately.BR
Dave-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#65301):
https://lists.yoctoproject.org/g/yocto/message/65301
Mute This Topic:
https://lists.yoctoproject.org/mt/112895370/3616693
Group Owner: [email protected] Unsubscribe:
https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi there and sorry for spamming - I am still completely puzzled and still spending loads of hours trying to the the Windows SDK to work.
Simple question - please - Is the meta-mingw, yocto generated SDK for Windows supposed to work? Or is it just a place for testing / evaluation? I see the last change took place more or less 2 weeks ago, so it seems it's still maintained.
Is there anybody out there who got the Windows SDK to work? Or do you recommend not trying to use it altogether?
Thanks for any hints!
BR
Dave
Am Montag, dem 12.05.2025 um 07:15 +0000 schrieb David Daniel via lists.yoctoproject.org:
Quoted 277 lines
Thanks for that clarification. It seems that linking in general does not work:
powerpc64-bf133-linux-gcc.exe -mbig-endian -mhard-float -m64 - mcpu=e5500 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux - LC:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux/usr/lib64
main.cC:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64- bf133-linux/../../libexec/powerpc64-bf133-linux/gcc/powerpc64-bf133- linux/14.2.0/ld.exe: cannot find Scrt1.o: No such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64- bf133-linux/../../libexec/powerpc64-bf133-linux/gcc/powerpc64-bf133- linux/14.2.0/ld.exe: cannot find crti.o: No such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64- bf133-linux/../../libexec/powerpc64-bf133-linux/gcc/powerpc64-bf133- linux/14.2.0/ld.exe: cannot find crtbeginS.o: No such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64- bf133-linux/../../libexec/powerpc64-bf133-linux/gcc/powerpc64-bf133- linux/14.2.0/ld.exe: cannot find -lgcc: No such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64- bf133-linux/../../libexec/powerpc64-bf133-linux/gcc/powerpc64-bf133- linux/14.2.0/ld.exe: cannot find -lgcc: No such file or directory collect2.exe: error: ld returned 1 exit statusBut the files are present in C:/dev/sdk/bf133/sysroots/ppc64e5500- vrag-
linux/usr/lib64.It seems there is something broken with the Windows SDK. This is a simple hello world main. There is no such problem with the Linux SDK, that one works flawlessly. I am still puzzled how to solve this.
Am Freitag, dem 09.05.2025 um 08:25 -0600 schrieb Joshua Watt:
Quoted 7 lines
There is no setup script on Windows to "install" the SDK like there is
on Linux, so there's not really anything missing. There shouldn't be
any relocation that needs to happen, but it's also possible cmake isn't working in the MinGW SDK for some reason.Quoted 223 lines
Quoted 220 lines · David Daniel via lists.yoctoproject.org
What I realize is that on Linux I get a script to execute that then
relocates the SDK, rewrites paths etc. The windows SDK is just an archive, there is no installer script. Nevertheless it contains post-relocate-setup.sh- but no Windows batch file.Do my problems stem from the fact that the SDK is not setup correctly?
So I am missing an installation or post-decompress step?Still struggling, thanks for any hints!
BR
DaveAm Freitag, dem 09.05.2025 um 08:55 +0000 schrieb David Daniel via
lists.yoctoproject.org:Quoted 197 lines
Hi there
I have trouble using the SDK on Windows generated by meta- mingw.
There
are a few minor changes that need to be made to the environment setup
file, namely the SDKROOT variable needs to be modified to only contain
forward slashes - those paths get passed to gcc. So I modified this
according to some link I found:https://github.com/darko31/yocto_cross_compile_sdk/blob/main/readme_win.md
By replacing the first line with
set SDKROOT=%~dp0%
set "SDKROOT=%SDKROOT:\=/%"The second thing was that the cmake.bat file was missing in the windows
sysroots environment.d folder, there was only acmake.shfile. But
its
easy to create it withset CMAKE_TOOLCHAIN_FILE=%OECORE_NATIVE_SYSROOT%/usr/share/cmake/OE To
olch
ainConfig.cmake
set OE_CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=64The third thing was that within the Windows sysroots
usr/share/cmake
folder there was no generated toolchain file that came from the template. So there were only two files:- OEToolchainConfig.cmake
- SDKToolchainConfig.cmake.templateWhereas in the linux SDK there is a third file that was generated
by
the SDKToolchainConfig.cmake.template file.But even when I fix the above I cannot succeed to configure a build
with cmake and the toolchain. I always get the error "is not able
to
compile a simple test program." with complaints that libs and objects
cannot be found (cannot find Scrt1.o, cannot find crti.o, cannot
find
crtbebinS.o, cannot find -lgcc).I simply call:
cmake -G Ninja --toolchain %CMAKE_TOOLCHAIN_FILE% -B build - S
.And I get
-- The CXX compiler identification is GNU 14.2.0 -- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler:
C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64- bf133-
linux/powerpc64-bf133-linux-g++.exe
-- Check for working CXX compiler:
C:/dev/sdk/bf133/sysroots/x86_64-w64-mingw32/usr/bin/powerpc64- bf133-
linux/powerpc64-bf133-linux-g++.exe - broken
CMake Error at C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/share/cmake- 3.31/Modules/CMakeTestCXXCompiler.cmake:73
(message):
The C++ compiler"C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/powerpc64-bf133-linux- g++.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir:
'C:/dev/netcan/build/CMakeFiles/CMakeScratch/TryCompile-9amgcb'Run Build Command(s): C:/PROGRA~1/ninja/ninja.exe -v
cmTC_01890
[1/2] C:\dev\sdk\bf133\sysroots\x86_64-w64- mingw32\usr\bin\powerpc64-bf133-linux\powerpc64-bf133-linux- g++.exe
-mbig-endian -mhard-float -m64 -mcpu=e5500 -fstack-protector- strong
-O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security - Werror=format-
security --sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133- linux -(quoted diff) +0
-2-sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -O2 -g -
pipe -oCMakeFiles/cmTC_01890.dir/testCXXCompiler.cxx.o-c C:/dev/netcan/build/CMakeFiles/CMakeScratch/TryCompile- 9amgcb/testCXXCompiler.cxx
[2/2] C:\Windows\system32\cmd.exe /C "cd . && C:\dev\sdk\bf133\sysroots\x86_64-w64-mingw32\usr\bin\powerpc64- bf133-
linux\powerpc64-bf133-linux-g++.exe -mbig-endian -mhard-float -
m64
-mcpu=e5500 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 - Wformat -Wformat-security -Werror=format-security -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -O2 - g
-
pipe -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,- z,relro,-
z,nowCMakeFiles/cmTC_01890.dir/testCXXCompiler.cxx.o-ocmTC_01890
&& cd ."
FAILED:cmTC_01890C:\Windows\system32\cmd.exe /C "cd . && C:\dev\sdk\bf133\sysroots\x86_64-w64-mingw32\usr\bin\powerpc64- bf133-
linux\powerpc64-bf133-linux-g++.exe -mbig-endian -mhard-float -
m64
-mcpu=e5500 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 - Wformat -Wformat-security -Werror=format-security -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -- sysroot=C:/dev/sdk/bf133/sysroots/ppc64e5500-bf133-linux -O2 - g
-
pipe -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,- z,relro,-
z,nowCMakeFiles/cmTC_01890.dir/testCXXCompiler.cxx.o-ocmTC_01890
&& cd ."
C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64- bf133-
linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find Scrt1.o:
No such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64- bf133-
linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find crti.o: No
such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64- bf133-
linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find crtbeginS.o: No such file or directory C:/dev/sdk/bf133/sysroots/x86_64-w64- mingw32/usr/bin/powerpc64-bf133-linux/../../libexec/powerpc64- bf133-
linux/gcc/powerpc64-bf133-linux/14.2.0/ld.exe: cannot find - lgcc:
No
such file or directory
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)-- Configuring incomplete, errors occurred!
Am I doing something wrong? Are there additional requirements for
the
Windows SDK except the configuration of SDKMACHINE?Thanks for any hints, we keep struggling with this. I'd rather have
my
colleagues use Linux but I cannot change that, unfortunately.BR
Dave-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#65305):
https://lists.yoctoproject.org/g/yocto/message/65305
Mute This Topic: https://lists.yoctoproject.org/mt/112895370/7801465
Group Owner: [email protected] Unsubscribe:
https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 10 lines · David Daniel via lists.yoctoproject.org
Hi there and sorry for spamming - I am still completely puzzled and still spending loads of hours trying to the the Windows SDK to work.
Simple question - please - Is the meta-mingw, yocto generated SDK for Windows supposed to work? Or is it just a place for testing / evaluation? I see the last change took place more or less 2 weeks ago, so it seems it's still maintained.
Is there anybody out there who got the Windows SDK to work? Or do you recommend not trying to use it altogether?
It gets built and tested on our autobuilder and there are automated tests that run under wine:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/7
It has been used in the past by people and we assume the automated tests mean it should work but personally, I don't use it.
Cheers,
Richard
A message that is not in the archive (sent off-list or not yet received): [email protected]
Am Freitag, dem 16.05.2025 um 03:13 +0200 schrieb Lukas Palme:
Quoted 44 lines
Quoted 11 lines
Hi there and sorry for spamming - I am still completely puzzled and still spending loads of hours trying to the the Windows SDK to work.
Simple question - please - Is the meta-mingw, yocto generated SDK for
Windows supposed to work? Or is it just a place for testing / evaluation? I see the last change took place more or less 2 weeks ago,
so it seems it's still maintained.Quoted 7 lines
Is there anybody out there who got the Windows SDK to work? Or do you
recommend not trying to use it altogether?Thanks for any hints!
BR
DaveHi Dave,
I use the MinGW SDK on a Windows 10 machine in my company.
One tricky part to find out was that it is necessary to extract the SDK
tar archive as Administrator (I use 7-zip), otherwise symlinks cannot be created correctly which causes problems.Also we don't use any setup script or CMake file from the SDK directly,
but handcrafted our own CMake toolchain file. Basically we took all the
relevant variables from the setup script and put them in the toolchain
file and assigned them to the corresponding CMake variables (e.g. CC ->CMAKE_C_COMPILER)
But invoking the compiler directly should work too.I should note that we are still on kirkstone, haven't tried scarthgap yet.
Kind regards,
Lukas
Hi Lukas
Thanks for your reply! I did exactly the same - use 7zip and extract as Administrator. There were some errors concerning lower case and upper case names, I think only some header file names. Otherwise there were no errors and the symlinks were created successfully.
I'll try another version. Would you mind sharing your toolchain file?
Thanks!
Kind regards,
Dave
Am Freitag, dem 16.05.2025 um 01:13 +0000 schrieb Lukas Palme:
Quoted 44 lines
Quoted 11 lines
Hi there and sorry for spamming - I am still completely puzzled and still spending loads of hours trying to the the Windows SDK to work.
Simple question - please - Is the meta-mingw, yocto generated SDK for
Windows supposed to work? Or is it just a place for testing / evaluation? I see the last change took place more or less 2 weeks ago,
so it seems it's still maintained.Quoted 7 lines
Is there anybody out there who got the Windows SDK to work? Or do you
recommend not trying to use it altogether?Thanks for any hints!
BR
DaveHi Dave,
I use the MinGW SDK on a Windows 10 machine in my company.
One tricky part to find out was that it is necessary to extract the SDK
tar archive as Administrator (I use 7-zip), otherwise symlinks cannot be created correctly which causes problems.Also we don't use any setup script or CMake file from the SDK directly,
but handcrafted our own CMake toolchain file. Basically we took all the
relevant variables from the setup script and put them in the toolchain
file and assigned them to the corresponding CMake variables (e.g. CC ->CMAKE_C_COMPILER)
But invoking the compiler directly should work too.I should note that we are still on kirkstone, haven't tried scarthgap yet.
Kind regards,
Lukas
Quoted 7 lines
Hi Lukas
Thanks for your reply! I did exactly the same - use 7zip and extract as
Administrator. There were some errors concerning lower case and upper case names, I think only some header file names. Otherwise there were no errors and the symlinks were created successfully.
Ah, totally forgot about that; yeah I think I always used the one in small letters and ditched the one in capital letters. Not that I think it matters much, my project does not seem to use any of these headers.
Quoted 1 line
I'll try another version. Would you mind sharing your toolchain file?
Sure, this is the content of my toolchain file:
----------------------------------------------set(CMAKE_SYSTEM_NAME "Linux")
set(SDKROOT "C:/SysGCC/wrlinux-10.22.33.19-i686_mingw32-mymachine") set(SDKTARGETSYSROOT "${SDKROOT}/sysroots/armv6hf-vfp-wrs-linux- gnueabi")set(SDKHOSTSYSROOT "${SDKROOT}/sysroots/i686-w64-mingw32") set(CMAKE_SYSROOT "${SDKTARGETSYSROOT}")
set(CMAKE_C_FLAGS "-pipe -feliminate-unused-debug-types -march=armv6 - mfpu=vfp -mfloat-abi=hard -fstack-protector-strong -fPIC -O2 -Wformat - Wformat-security -Werror=format-security -- sysroot=${SDKTARGETSYSROOT}")
set(CMAKE_CXX_FLAGS "-pipe -feliminate-unused-debug-types -march=armv6 -mfpu=vfp -mfloat-abi=hard -fstack-protector-strong -fPIC -O2 -Wformat -Wformat-security -Werror=format-security -- sysroot=${SDKTARGETSYSROOT}")
set(LDFLAGS "-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack- protector-strong -Wl,-z,relro,-z,now --sysroot=${SDKTARGETSYSROOT}") set(CMAKE_EXE_LINKER_FLAGS_INIT "${LDFLAGS}") set(CMAKE_MODULE_LINKER_FLAGS_INIT "${LDFLAGS}") set(CMAKE_SHARED_LINKER_FLAGS_INIT "${LDFLAGS}")
set(CMAKE_C_COMPILER "${SDKHOSTSYSROOT}/usr/bin/arm-wrs-linux- gnueabi/arm-wrs-linux-gnueabi-gcc.exe") set(CMAKE_CXX_COMPILER "${SDKHOSTSYSROOT}/usr/bin/arm-wrs-linux- gnueabi/arm-wrs-linux-gnueabi-g++.exe")
list(APPEND CMAKE_PREFIX_PATH CMAKE_SYSROOT)list(APPEND CMAKE_FIND_ROOT_PATH CMAKE_SYSROOT)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
----------------------------------------------
Not sure the last 6 lines are actually needed here.
Adapt the values of SDKROOT, SDKTARGETSYSROOT such that they suit your setup.
Also adapt the compiler/linker paths and flags by looking into what the environment-setup-script batch file has set.
Kind regards,
Lukas
Thanks a lot! I unfortunately couldn't find anything - and the Windows SDK here does not work, no matter what I try. I need to give up on that one. So my colleagues will have to setup their WSL and use the Linux SDK on Windows.
Kind regards,
Dave
Am Samstag, dem 17.05.2025 um 19:33 +0000 schrieb Lukas:
Quoted 72 lines
Quoted 10 lines
Hi Lukas
Thanks for your reply! I did exactly the same - use 7zip and extract
as
Administrator. There were some errors concerning lower case and upper
case names, I think only some header file names. Otherwise there were
no errors and the symlinks were created successfully.Ah, totally forgot about that; yeah I think I always used the one in small letters and ditched the one in capital letters. Not that I think
it matters much, my project does not seem to use any of these headers.Quoted 2 lines
I'll try another version. Would you mind sharing your toolchain file?
Sure, this is the content of my toolchain file:
----------------------------------------------
set(CMAKE_SYSTEM_NAME "Linux")
set(SDKROOT "C:/SysGCC/wrlinux-10.22.33.19-i686_mingw32-mymachine")set(SDKTARGETSYSROOT "${SDKROOT}/sysroots/armv6hf-vfp-wrs-linux- gnueabi")set(SDKHOSTSYSROOT "${SDKROOT}/sysroots/i686-w64-mingw32")set(CMAKE_SYSROOT "${SDKTARGETSYSROOT}")set(CMAKE_C_FLAGS "-pipe -feliminate-unused-debug-types -march=armv6 -
mfpu=vfp -mfloat-abi=hard -fstack-protector-strong -fPIC -O2 -Wformat -
Wformat-security -Werror=format-security -- sysroot=${SDKTARGETSYSROOT}")
set(CMAKE_CXX_FLAGS "-pipe -feliminate-unused-debug-types - march=armv6
-mfpu=vfp -mfloat-abi=hard -fstack-protector-strong -fPIC -O2 - Wformat
-Wformat-security -Werror=format-security -- sysroot=${SDKTARGETSYSROOT}")
set(LDFLAGS "-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack- protector-strong -Wl,-z,relro,-z,now --sysroot=${SDKTARGETSYSROOT}")set(CMAKE_EXE_LINKER_FLAGS_INIT "${LDFLAGS}")set(CMAKE_MODULE_LINKER_FLAGS_INIT "${LDFLAGS}")set(CMAKE_SHARED_LINKER_FLAGS_INIT "${LDFLAGS}")
set(CMAKE_C_COMPILER "${SDKHOSTSYSROOT}/usr/bin/arm-wrs-linux- gnueabi/arm-wrs-linux-gnueabi-gcc.exe")set(CMAKE_CXX_COMPILER "${SDKHOSTSYSROOT}/usr/bin/arm-wrs-linux- gnueabi/arm-wrs-linux-gnueabi-g++.exe")
list(APPEND CMAKE_PREFIX_PATH CMAKE_SYSROOT)list(APPEND CMAKE_FIND_ROOT_PATH CMAKE_SYSROOT)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
----------------------------------------------Not sure the last 6 lines are actually needed here.
Adapt the values of SDKROOT, SDKTARGETSYSROOT such that they suit your
setup.
Also adapt the compiler/linker paths and flags by looking into what the
environment-setup-script batch file has set.Kind regards,
Lukas