runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Cross building on Linux requires more prerequisite packages

Open hqueue opened this issue 10 years ago • 1 comments

Recently I've setup a new Ubuntu 14.04 box and try to cross-build corefx as described in https://github.com/dotnet/corefx/blob/master/Documentation/building/cross-building.md

Following cmake error occured at the very early stage of building.

~/github/hqueue/corefx  (master)$ sudo ROOTFS_DIR=/home/dotnet/corefx-cross/arm ./build.sh native arm debug verbose clean cross
Setting up directories for build
Checking pre-requisites...
Cleaning previous output for the selected configuration
Setting up directories for build
Commencing build of corefx native components for Linux.arm.Debug
Invoking cmake with arguments: "/home/dotnet/github/hqueue/corefx/src/Native" DEBUG 
No CMake extra Args specified
loading initial cache file /home/dotnet/github/hqueue/corefx/src/Native/../../cross/arm/tryrun.cmake
Re-run cmake no build system arguments
-- The C compiler identification is Clang 3.5.0
-- The CXX compiler identification is Clang 3.5.0
-- Check for working C compiler: /usr/bin/clang-3.5
-- Check for working C compiler: /usr/bin/clang-3.5 -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/usr/bin/clang-3.5" is not able to compile a simple test
  program.

  It fails with the following output:

   Change Dir: /home/dotnet/github/hqueue/corefx/bin/obj/Linux.arm.Debug/Native/CMakeFiles/CMakeTmp



  Run Build Command:/usr/bin/make "cmTryCompileExec4056523230/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec4056523230.dir/build.make
  CMakeFiles/cmTryCompileExec4056523230.dir/build

  make[1]: Entering directory
  `/home/dotnet/github/hqueue/corefx/bin/obj/Linux.arm.Debug/Native/CMakeFiles/CMakeTmp'


  /usr/bin/cmake -E cmake_progress_report
  /home/dotnet/github/hqueue/corefx/bin/obj/Linux.arm.Debug/Native/CMakeFiles/CMakeTmp/CMakeFiles
  1

  Building C object
  CMakeFiles/cmTryCompileExec4056523230.dir/testCCompiler.c.o

  /usr/bin/clang-3.5 -target armv7-linux-gnueabihf -mthumb -mfpu=vfpv3
  --sysroot=/home/dotnet/corefx-cross/arm -o
  CMakeFiles/cmTryCompileExec4056523230.dir/testCCompiler.c.o -c
  /home/dotnet/github/hqueue/corefx/bin/obj/Linux.arm.Debug/Native/CMakeFiles/CMakeTmp/testCCompiler.c


  Linking C executable cmTryCompileExec4056523230

  /usr/bin/cmake -E cmake_link_script
  CMakeFiles/cmTryCompileExec4056523230.dir/link.txt --verbose=1

  /usr/bin/clang-3.5 -target arm-linux-gnueabihf -B
  /home/dotnet/corefx-cross/arm/usr/lib/gcc/arm-linux-gnueabihf
  -L/home/dotnet/corefx-cross/arm/lib/arm-linux-gnueabihf
  --sysroot=/home/dotnet/corefx-cross/arm
  CMakeFiles/cmTryCompileExec4056523230.dir/testCCompiler.c.o -o
  cmTryCompileExec4056523230 -rdynamic

  /usr/bin/arm-linux-gnueabihf-ld: cannot find crt1.o: No such file or
  directory

  /usr/bin/arm-linux-gnueabihf-ld: cannot find crti.o: No such file or
  directory

  /usr/bin/arm-linux-gnueabihf-ld: cannot find crtbegin.o: No such file or
  directory

  /usr/bin/arm-linux-gnueabihf-ld: cannot find -lgcc

  /usr/bin/arm-linux-gnueabihf-ld: cannot find -lgcc_s

  /usr/bin/arm-linux-gnueabihf-ld: cannot find -lc

  /usr/bin/arm-linux-gnueabihf-ld: cannot find -lgcc

  /usr/bin/arm-linux-gnueabihf-ld: cannot find -lgcc_s

  /usr/bin/arm-linux-gnueabihf-ld: cannot find crtend.o: No such file or
  directory

  /usr/bin/arm-linux-gnueabihf-ld: cannot find crtn.o: No such file or
  directory

  clang: error: linker command failed with exit code 1 (use -v to see
  invocation)

  make[1]: *** [cmTryCompileExec4056523230] Error 1

  make[1]: Leaving directory
  `/home/dotnet/github/hqueue/corefx/bin/obj/Linux.arm.Debug/Native/CMakeFiles/CMakeTmp'


  make: *** [cmTryCompileExec4056523230/fast] Error 2





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


-- Configuring incomplete, errors occurred!
See also "/home/dotnet/github/hqueue/corefx/bin/obj/Linux.arm.Debug/Native/CMakeFiles/CMakeOutput.log".
See also "/home/dotnet/github/hqueue/corefx/bin/obj/Linux.arm.Debug/Native/CMakeFiles/CMakeError.log".
Failed to generate native component build project!
~/github/hqueue/corefx  (master)$

After installing cross gcc and g++ for target, above errors disappeared.

hqueue avatar May 16 '16 11:05 hqueue

Sorry to bother all of you. It was due to incomplete setup of arm roofts while running build-rootfs.sh. However there is still dotnet/runtime#17292 issue.

hqueue avatar May 16 '16 14:05 hqueue