Docker / CodeSourcery Compiler Id
When running a docker container defined by the attached Dockerfile in a Windows 10 Hypervisor CMake does not properly identify the CodeSourcery compiler when performing the CMake configure from within a drive mount.
docker run -u0 --privileged=true -ti --rm -v C:/Your/Windows/Path/:/root/ --name DockerContainer
When running the container, if you CD into the mount and try to run the following commands...
export PATH="$PATH:/opt/CodeSourcery/Sourcery_G++_Lite/bin"
cmake -DCMAKE_CXX_COMPILER=arm-none-linux-gnueabi-g++ -DCMAKE_C_COMPILER=arm-none-linux-gnueabi-gcc .
You get the following output...
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc
-- Check for working C compiler: /opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc -- broken
CMake Error at /usr/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"/opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /root/Dummy/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_6609a/fast"
/usr/bin/make -f CMakeFiles/cmTC_6609a.dir/build.make CMakeFiles/cmTC_6609a.dir/build
make[1]: Entering directory '/root/Dummy/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_6609a.dir/testCCompiler.c.o
/opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc -o CMakeFiles/cmTC_6609a.dir/testCCompiler.c.o -c /root/Dummy/CMakeFiles/CMakeTmp/testCCompiler.c
cc1: fatal error: /root/Dummy/CMakeFiles/CMakeTmp/testCCompiler.c: Value too large for defined data type
compilation terminated.
CMakeFiles/cmTC_6609a.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_6609a.dir/testCCompiler.c.o' failed
make[1]: *** [CMakeFiles/cmTC_6609a.dir/testCCompiler.c.o] Error 1
make[1]: Leaving directory '/root/Dummy/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_6609a/fast' failed
make: *** [cmTC_6609a/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 "/root/Dummy/CMakeFiles/CMakeOutput.log".
See also "/root/Dummy/CMakeFiles/CMakeError.log".
The output with Debug, Trace, and Dev warnings enabled is attached.
If you copy the project outside of the mount into another location on the container..., such as /tmp, then the configure works fine.
-- The C compiler identification is GNU 4.5.2
-- The CXX compiler identification is GNU 4.5.2
-- Check for working C compiler: /opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc
-- Check for working C compiler: /opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-g++
-- Check for working CXX compiler: /opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/Dummy
I ultimately don't know if this is a Docker/Hypervisor issue, but it would be good to understand why it is failing so I can request a correction either here, or with the Docker implementation.