ReservedField/evic-sdk

arm-none-eabi-gcc -v returns something unexpected in arch linux

Closed this issue · 4 comments

The version string that is grepped in Base.mk returns gcc version 5.3.0 (Arch Repository) on arch linux.

If you manually do

echo "gcc version 5.3.0 (Arch Repository)" | grep "^gcc version" | awk '{print $$3}'

it returns Repository), but the error that is given shows that the whole gcc version 5.3.0 (Arch Repository) follows. (LIne 3)

arm-none-eabi-gcc -Wall -mcpu=cortex-m4 -mthumb -Os -fdata-sections -ffunction-sections -I/home/localsys/projects/evic-sdk/nuvoton-sdk/Library/CMSIS/Include -I/home/localsys/projects/evic-sdk/nuvoton-sdk/Library/Device/Nuvoton/M451Series/Include -I/home/localsys/projects/evic-sdk/nuvoton-sdk/Library/StdDriver/inc -I/home/localsys/projects/evic-sdk/include -c main.c -o main.o
test -d bin || mkdir bin
arm-none-eabi-ld main.o -L/usr/arm-none-eabi/lib -L/usr/lib/arm-none-eabi/newlib -L/usr/lib/gcc/arm-none-eabi/gcc version 5.3.0 (Arch Repository)  -L/home/localsys/projects/evic-sdk/lib -nostdlib -nostartfiles -T/home/localsys/projects/evic-sdk/linker/linker.ld --gc-sections -o bin/atomizer.elf
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `arm-none-eabi-ld main.o -L/usr/arm-none-eabi/lib -L/usr/lib/arm-none-eabi/newlib -L/usr/lib/gcc/arm-none-eabi/gcc version 5.3.0 (Arch Repository)  -L/home/localsys/projects/evic-sdk/lib -nostdlib -nostartfiles -T/home/localsys/projects/evic-sdk/linker/linker.ld --gc-sections -o bin/atomizer.elf'
/home/localsys/projects/evic-sdk/make/Base.mk:115: recipe for target 'atomizer.elf' failed
make: *** [atomizer.elf] Error 1

grep "^gcc version" | awk '{print $3}' works in bash, but not in make.

Wow, sorry for that noise, should be properly set up now.

I'm not exactly what someone would call an 'expert'.

::Edit:: Now, finally, I think I've got this.

Ban3 commented

I'm on Arch and I can't reproduce this.

Note that you need to remove the second $ from arm-none-eabi-gcc -v 2>&1 | grep '^gcc version' | awk '{print $$3}' if you're testing the line in shell. Make requires you to escape the $.

$ arm-none-eabi-gcc -v 2>&1 | grep '^gcc version' | awk '{print $3}'
5.3.0

Using -dumpversion does make more sense, though.