Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake fails on windows #81

Closed
stefan-nu opened this issue Oct 6, 2014 · 1 comment
Closed

CMake fails on windows #81

stefan-nu opened this issue Oct 6, 2014 · 1 comment

Comments

@stefan-nu
Copy link

Hello,

I try to crosscompile NE10 on windows 7 64Bit.

CMake is configured to use linaro GCC crosscompiler arm-linux-gnueabihf.

When running CMake the linker fails with error message
arm-linux-gnueabihf/bin/ld.exe: unrecognized option '--out-implib'

Would somebody please point out how to correctly configure the cmake file to build on windows.

thank you very much.
Stefan

Here is the full log output of cmake:

The C compiler identification is GNU 4.9.2
The ASM compiler identification is GNU
Found assembler: C:/Program Files (x86)/Linaro/gcc-linaro-arm-linux-gnueabihf-4.9-2014.08/bin/arm-linux-gnueabihf-as.exe
Check for working C compiler: C:/Program Files (x86)/Linaro/gcc-linaro-arm-linux-gnueabihf-4.9-2014.08/bin/arm-linux-gnueabihf-gcc.exe
Check for working C compiler: C:/Program Files (x86)/Linaro/gcc-linaro-arm-linux-gnueabihf-4.9-2014.08/bin/arm-linux-gnueabihf-gcc.exe -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.0/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "C:/Program Files
  (x86)/Linaro/gcc-linaro-arm-linux-gnueabihf-4.9-2014.08/bin/arm-linux-gnueabihf-gcc.exe"
  is not able to compile a simple test program.

  It fails with the following output:
   Change Dir: C:/Users/.../workspace/Ne10/build/CMakeFiles/CMakeTmp

  Run Build Command:"C:/MinGW/bin/mingw32-make.exe"
  "cmTryCompileExec3169079659/fast"

  C:/MinGW/bin/mingw32-make.exe -f
  CMakeFiles\cmTryCompileExec3169079659.dir\build.make
  CMakeFiles/cmTryCompileExec3169079659.dir/build

  mingw32-make.exe[1]: Entering directory
  'C:/Users/.../workspace/Ne10/build/CMakeFiles/CMakeTmp'

  "C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_progress_report
  C:\Users\...\workspace\Ne10\build\CMakeFiles\CMakeTmp\CMakeFiles 1

  Building C object
  CMakeFiles/cmTryCompileExec3169079659.dir/testCCompiler.c.obj

  C:\PROGRA~2\Linaro\GCC-LI~1.08\bin\AREFB3~1.EXE -o
  CMakeFiles\cmTryCompileExec3169079659.dir\testCCompiler.c.obj -c
  C:\Users\...\workspace\Ne10\build\CMakeFiles\CMakeTmp\testCCompiler.c

  Linking C executable cmTryCompileExec3169079659.exe

  "C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_link_script
  CMakeFiles\cmTryCompileExec3169079659.dir\link.txt --verbose=1

  "C:\Program Files (x86)\CMake\bin\cmake.exe" -E remove -f
  CMakeFiles\cmTryCompileExec3169079659.dir/objects.a

  C:\PROGRA~2\Linaro\GCC-LI~1.08\bin\ARM-LI~2.EXE cr
  CMakeFiles\cmTryCompileExec3169079659.dir/objects.a
  @CMakeFiles\cmTryCompileExec3169079659.dir\objects1.rsp

  C:\PROGRA~2\Linaro\GCC-LI~1.08\bin\AREFB3~1.EXE -Wl,--whole-archive
  CMakeFiles\cmTryCompileExec3169079659.dir/objects.a -Wl,--no-whole-archive
  -o cmTryCompileExec3169079659.exe
  -Wl,--out-implib,libcmTryCompileExec3169079659.dll.a
  -Wl,--major-image-version,0,--minor-image-version,0 

  c:/progra~2/linaro/gcc-li~1.08/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld.exe:
  unrecognized option '--out-implib'

  c:/progra~2/linaro/gcc-li~1.08/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld.exe:
  use the --help option for usage information

  collect2.exe: error: ld returned 1 exit status

  CMakeFiles\cmTryCompileExec3169079659.dir\build.make:88: recipe for target
  'cmTryCompileExec3169079659.exe' failed

  mingw32-make.exe[1]: *** [cmTryCompileExec3169079659.exe] Error 1

  mingw32-make.exe[1]: Leaving directory
  'C:/Users/.../workspace/Ne10/build/CMakeFiles/CMakeTmp'

  Makefile:117: recipe for target 'cmTryCompileExec3169079659/fast' failed
  mingw32-make.exe: *** [cmTryCompileExec3169079659/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:29 (project)

Configuring incomplete, errors occurred!
See also "C:/Users/.../workspace/Ne10/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/.../workspace/Ne10/build/CMakeFiles/CMakeError.log".
@stefan-nu
Copy link
Author

I think I found the solution:

in the CMake configuration file "GNUlinux_config.cmake" should be defined the target plattform as

set(CMAKE_SYSTEM_NAME Linux)

Then run cmake and specify the Generator with -G"MinGW Makefiles". This assumes that MinGW ist being used.

The complete command line ist

C:\...\NE10\build cmake -G"MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE=../GNUlinux_config.cmake ..
C:\...\Ne10\build make

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants