Setting CMAKE_AR to gcc-ar fails on Ubuntu 20.10 but works on Windows
Hi, I'm having a strange problem after moving my project from Windows to Ubuntu 20.10 (using VMware).
CMake: 3.19.4
Toolchain I'm using: gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux
Description of problem
The following works on Windows 10 but does not work on Ubuntu 20.10:
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(AS arm-none-eabi-as)
set(CMAKE_AR arm-none-eabi-gcc-ar)
set(OBJCOPY arm-none-eabi-objcopy)
set(OBJDUMP arm-none-eabi-objdump)
set(SIZE arm-none-eabi-size)
Here is the output:
Here is an image to show that arm-none-eabi-gcc-ar
is a recognised command:
I noticed CMAKE_AR
isn't actually added to the CMakeCache.txt
so I assume I am setting the wrong variable. But on Windows 10 CMake doesn't complain.
Workaround
If I comment out CMAKE_AR
(on Ubuntu) everything runs ok. What I don't understand is why there is a difference in behaviour between Windows 10 and Ubuntu 20.10?
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(AS arm-none-eabi-as)
#set(CMAKE_AR arm-none-eabi-gcc-ar)
set(OBJCOPY arm-none-eabi-objcopy)
set(OBJDUMP arm-none-eabi-objdump)
set(SIZE arm-none-eabi-size)
Edited by Guðni Már Gilbert