Skip to content

cmake GNU makefile link too long commandline

cmake generated a makefile line that is about 8400 characters long for the link step. Too long for windows limit.

the file build.make contains :

XXXXX_EXTERNAL_OBJECTS =
XXXX_OBJECTS = \
"file.c.obj" \
"file.c.obj" \
"file.c.obj" \
"file.c.obj" \

C:/YYYY/GNU_Tools_ARM_Embedded/6-2016-q4-major/bin/arm-none-eabi-gcc.exe  -mcpu=cortex-m4  -mthumb -DSTM32L496xx -mfloat-abi=softfp -DXXXX -O0 -g -Wfatal-errors -Wall -Wno-unused-function -std=c99 -fdata-sections -ffunction-sections  -mcpu=cortex-m4  -march=armv7e-m -O0 -g --specs=nano.specs -mthumb -Wl,--gc-sections -nostartfiles -Wl,-Map=$@.map -TC:SSSSSSSSS/STM32L496RGTx_FLASH.ld $(XXXX_OBJECTS) $(XXXXX_EXTERNAL_OBJECTS)  -o outHexFile_XXXX  -LC:/YYYYYYYYYYYYYYYY/arm-nano-eabi/lib

XXXX_OBJECTS is about 7700 char and this leads to total 8400 char in command line making link fail.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information