cmake-rs icon indicating copy to clipboard operation
cmake-rs copied to clipboard

Cross-compiling on macos to mingw

Open jayvdb opened this issue 2 years ago • 0 comments

Using x86_64-w64-mingw32-gcc on host macos building a rust wrapper for C project https://github.com/swift-nav/libsettings/ , the macos default /usr/bin/ar was being used and naturally failed.

CMakeError.log:

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: x86_64-w64-mingw32-gcc 
Build flags: ;-ffunction-sections;-fdata-sections;-m64
Id flags:  

The output was:
No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: x86_64-w64-mingw32-gcc 
Build flags: ;-ffunction-sections;-fdata-sections;-m64
Id flags: -c 

The output was:
No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: x86_64-w64-mingw32-gcc 
Build flags: ;-ffunction-sections;-fdata-sections;-m64
Id flags: -Aa 

The output was:
No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: x86_64-w64-mingw32-gcc 
Build flags: ;-ffunction-sections;-fdata-sections;-m64
Id flags: -D__CLASSIC_C__ 

The output was:
No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: x86_64-w64-mingw32-gcc 
Build flags: ;-ffunction-sections;-fdata-sections;-m64
Id flags: --target=arm-arm-none-eabi;-mcpu=cortex-m3 

The output was:
No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: x86_64-w64-mingw32-gcc 
Build flags: ;-ffunction-sections;-fdata-sections;-m64
Id flags: -c;-I__does_not_exist__ 

The output was:
No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: x86_64-w64-mingw32-gcc 
Build flags: 
Id flags:  

The output was:
No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: x86_64-w64-mingw32-gcc 
Build flags: 
Id flags: -c 

The output was:
No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: x86_64-w64-mingw32-gcc 
Build flags: 
Id flags: -Aa 

The output was:
No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: x86_64-w64-mingw32-gcc 
Build flags: 
Id flags: -D__CLASSIC_C__ 

The output was:
No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: x86_64-w64-mingw32-gcc 
Build flags: 
Id flags: --target=arm-arm-none-eabi;-mcpu=cortex-m3 

The output was:
No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: x86_64-w64-mingw32-gcc 
Build flags: 
Id flags: -c;-I__does_not_exist__ 

The output was:
No such file or directory


Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: x86_64-w64-mingw32-g++ 
Build flags: ;-ffunction-sections;-fdata-sections;-m64
Id flags:  

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: x86_64-w64-mingw32-g++ 
Build flags: ;-ffunction-sections;-fdata-sections;-m64
Id flags: -c 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: x86_64-w64-mingw32-g++ 
Build flags: ;-ffunction-sections;-fdata-sections;-m64
Id flags: --c++ 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: x86_64-w64-mingw32-g++ 
Build flags: ;-ffunction-sections;-fdata-sections;-m64
Id flags: --ec++ 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: x86_64-w64-mingw32-g++ 
Build flags: ;-ffunction-sections;-fdata-sections;-m64
Id flags: --target=arm-arm-none-eabi;-mcpu=cortex-m3 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: x86_64-w64-mingw32-g++ 
Build flags: ;-ffunction-sections;-fdata-sections;-m64
Id flags: -c;-I__does_not_exist__ 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: x86_64-w64-mingw32-g++ 
Build flags: 
Id flags:  

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: x86_64-w64-mingw32-g++ 
Build flags: 
Id flags: -c 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: x86_64-w64-mingw32-g++ 
Build flags: 
Id flags: --c++ 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: x86_64-w64-mingw32-g++ 
Build flags: 
Id flags: --ec++ 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: x86_64-w64-mingw32-g++ 
Build flags: 
Id flags: --target=arm-arm-none-eabi;-mcpu=cortex-m3 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: x86_64-w64-mingw32-g++ 
Build flags: 
Id flags: -c;-I__does_not_exist__ 

The output was:
No such file or directory


Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
Detecting C compiler ABI info failed to compile with the following output:
Change Dir: /Users/john.vandenberg/work/libsettings/target/x86_64-pc-windows-gnu/debug/build/libsettings-d50eafd20c619d9e/out/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_e1e5b/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_e1e5b.dir/build.make CMakeFiles/cmTC_e1e5b.dir/build
Building C object CMakeFiles/cmTC_e1e5b.dir/CMakeCCompilerABI.c.obj
/usr/local/bin/x86_64-w64-mingw32-gcc   -ffunction-sections -fdata-sections -m64    -v -o CMakeFiles/cmTC_e1e5b.dir/CMakeCCompilerABI.c.obj -c /usr/local/Cellar/cmake/3.21.1/share/cmake/Modules/CMakeCCompilerABI.c
Using built-in specs.
COLLECT_GCC=/usr/local/bin/x86_64-w64-mingw32-gcc
Target: x86_64-w64-mingw32
Configured with: ../configure --target=x86_64-w64-mingw32 --with-sysroot=/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64 --prefix=/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64 --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --enable-languages=c,c++,fortran --with-ld=/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/bin/x86_64-w64-mingw32-ld --with-as=/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/bin/x86_64-w64-mingw32-as --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-zstd=no --disable-multilib --disable-nls --enable-threads=posix
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.0 (GCC) 
COLLECT_GCC_OPTIONS='-ffunction-sections' '-fdata-sections' '-m64' '-v' '-o' 'CMakeFiles/cmTC_e1e5b.dir/CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_e1e5b.dir/'
 /usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/libexec/gcc/x86_64-w64-mingw32/11.2.0/cc1 -quiet -v -D_REENTRANT /usr/local/Cellar/cmake/3.21.1/share/cmake/Modules/CMakeCCompilerABI.c -quiet -dumpdir CMakeFiles/cmTC_e1e5b.dir/ -dumpbase CMakeCCompilerABI.c.c -dumpbase-ext .c -m64 -mtune=generic -march=x86-64 -version -ffunction-sections -fdata-sections -o /var/folders/hz/tflgsmps1g95cdq5hdptdhc00000gp/T//ccCpx8eM.s
GNU C17 (GCC) version 11.2.0 (x86_64-w64-mingw32)
	compiled by GNU C version Apple LLVM 12.0.5 (clang-1205.0.22.9), GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version isl-0.24-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/usr/local/include"
ignoring duplicate directory "/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include
 /usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed
 /usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/include
End of search list.
GNU C17 (GCC) version 11.2.0 (x86_64-w64-mingw32)
	compiled by GNU C version Apple LLVM 12.0.5 (clang-1205.0.22.9), GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version isl-0.24-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 7a80cac6be494389ba0415000b441b68
COLLECT_GCC_OPTIONS='-ffunction-sections' '-fdata-sections' '-m64' '-v' '-o' 'CMakeFiles/cmTC_e1e5b.dir/CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_e1e5b.dir/'
 /usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/bin/x86_64-w64-mingw32-as -v --64 -o CMakeFiles/cmTC_e1e5b.dir/CMakeCCompilerABI.c.obj /var/folders/hz/tflgsmps1g95cdq5hdptdhc00000gp/T//ccCpx8eM.s
GNU assembler version 2.37 (x86_64-w64-mingw32) using BFD version (GNU Binutils) 2.37
COMPILER_PATH=/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/libexec/gcc/x86_64-w64-mingw32/11.2.0/:/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/libexec/gcc/x86_64-w64-mingw32/11.2.0/:/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/libexec/gcc/x86_64-w64-mingw32/:/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/lib/gcc/x86_64-w64-mingw32/11.2.0/:/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/lib/gcc/x86_64-w64-mingw32/:/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/
LIBRARY_PATH=/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/lib/gcc/x86_64-w64-mingw32/11.2.0/:/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/:/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/mingw/lib/../lib/:/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/:/usr/local/Cellar/mingw-w64/9.0.0_2/toolchain-x86_64/mingw/lib/
COLLECT_GCC_OPTIONS='-ffunction-sections' '-fdata-sections' '-m64' '-v' '-o' 'CMakeFiles/cmTC_e1e5b.dir/CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_e1e5b.dir/CMakeCCompilerABI.c.'
Linking C executable cmTC_e1e5b.exe
/usr/local/Cellar/cmake/3.21.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e1e5b.dir/link.txt --verbose=1
/usr/local/Cellar/cmake/3.21.1/bin/cmake -E rm -f CMakeFiles/cmTC_e1e5b.dir/objects.a
/usr/bin/ar qc CMakeFiles/cmTC_e1e5b.dir/objects.a @CMakeFiles/cmTC_e1e5b.dir/objects1.rsp
ar: @CMakeFiles/cmTC_e1e5b.dir/objects1.rsp: No such file or directory
make[1]: *** [cmTC_e1e5b.exe] Error 1
make: *** [cmTC_e1e5b/fast] Error 2

jayvdb avatar Aug 09 '21 08:08 jayvdb