avr-llvm / clang

[MERGED UPSTREAM] Clang frontend supporting AVR
Other
11 stars 1 forks source link

avr-ld: unknown option --gc-sections #10

Closed 4ntoine closed 9 years ago

4ntoine commented 9 years ago
MBA-Anton:bin asmirnov$ ./clang -w -Os -Wl,--gc-sections,--relax -mmcu=atmega328p -o /tmp/arduino_test1/Blink.cpp.elf /tmp/arduino_test1/Blink.cpp.o /tmp/arduino_test1/core.a -L/tmp/arduino_test1 -lm -v
clang version 3.8.0 (https://github.com/avr-llvm/clang.git 3b2c949e21022c841c80fca5e79d1f1387cd012c) (llvm/llvm.git 47a798c880f7baaf6b80b99e8653a22a28efc025)
Target: x86_64-apple-darwin14.3.0
Thread model: posix
InstalledDir: /Users/asmirnov/Documents/dev/src/avr-llvm/build/bin/.
 "/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.10.0 -w -o /tmp/arduino_test1/Blink.cpp.elf -L/tmp/arduino_test1 --gc-sections --relax /tmp/arduino_test1/Blink.cpp.o /tmp/arduino_test1/core.a -lm -lSystem
ld: unknown option: --gc-sections
4ntoine commented 9 years ago

as far as i can see it uses system linker /usr/bin/ld and not avr-ld though avr-ld is in system path:

MBA-Anton:bin asmirnov$ which avr-ld
/usr/local/bin/avr-ld
4ntoine commented 9 years ago

sorry, i've missed --target=avr argument, closing this