CMake fails to apply compiler flags during compiler testing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cmake (Ubuntu) |
Expired
|
Undecided
|
Unassigned |
Bug Description
When cross-compiling for a STM32 I've found that no compiler flags are passed during compiler testing on several releases of Ubuntu but I have no issues on Fedora. In both cases build flags are
shown in the log but on Ubuntu they are not used... Since it errors out on Ubuntu I have both CMakeOutput.log and CmakeError.log:
CmakeOutput.log:
The target system is: Generic - 1 - arm
The host system is: Linux - 4.15.0-32-generic - x86_64
Compiling the C compiler identification source file "CMakeCCompiler
Compiler: /usr/bin/
Build flags: ;-Wall;
Id flags:
The output was:
0
/usr/lib/
Compilation of the C compiler identification source "CMakeCCompiler
The C compiler identification is GNU, found in "/home/
CmakeError.log:
Determining if the C compiler works failed with the following output:
Change Dir: /home/richard/
Run Build Command:
/usr/bin/make -f CMakeFiles/
make[1]: Entering directory '/home/
Building C object CMakeFiles/
/usr/bin/
Linking C executable cmTC_e5a38
/usr/bin/cmake -E cmake_link_script CMakeFiles/
/usr/bin/
/usr/lib/
/build/
collect2: error: ld returned 1 exit status
CMakeFiles/
make[1]: *** [cmTC_e5a38] Error 1
make[1]: Leaving directory '/home/
Makefile:126: recipe for target 'cmTC_e5a38/fast' failed
make: *** [cmTC_e5a38/fast] Error 2
On Fedora the build flags are passed to the compiler during compiler testing:
The target system is: Generic - - arm
The host system is: Linux - 4.17.12-
Compiling the C compiler identification source file "CMakeCCompiler
Compiler: /usr/lib64/
Build flags: ;-Wall;
Id flags:
The output was:
0
/usr/lib/
Compilation of the C compiler identification source "CMakeCCompiler
The C compiler identification is GNU, found in "/home/
Determining if the C compiler works passed with the following output:
Change Dir: /home/build/
Run Build Command:
/usr/bin/gmake -f CMakeFiles/
gmake[1]: Entering directory '/home/
Building C object CMakeFiles/
/usr/lib64/
Linking C executable cmTC_e050e
/usr/bin/cmake -E cmake_link_script CMakeFiles/
/usr/lib64/
/usr/lib/
gmake[1]: Leaving directory '/home/
I have reproduced this on Ubuntu 18 but have reports from other developers on version 14 and 17.
Cmake version on Ubuntu Bionic: 3.10.2
on Fedora 28: 3.11.2
please tell me all the steps (including dependencies and a test-case) to reproduce the issue.
Also the Ubuntu version and architecture.