Go Down

Topic: Please add ability to compile .S (assembler files) (Read 2698 times) previous topic - next topic


As know is enough:
if (files.endsWith(".c") || files.endsWith(".cpp"))

and replace it with this line:
if (files.endsWith(".S") || files.endsWith(".c") || files.endsWith(".cpp"))

Details in post #7 at www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1222355444


This was already added (I think) in Version 0017.
The topic you refer to is 2 years old!



Yes, arduino compiles ".S" file - I have set option "preproc.save_build_files=true" and find "ffft.S.o" in TEMP dir.

Here output with "build.verbose=true":
Code: [Select]

\avr\bin\avr-gcc -c -g -assembler-with-cpp -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=18 -I\arduino-0018\hardware\arduino\cores\arduino -I\arduino-0018\libraries\IRremote -I\arduino-0018\libraries\ffft -I\arduino-0018\libraries\ffft\utility \arduino-0018\libraries\ffft\ffft.S -o\Temp\build.tmp\ffft\ffft.S.o

But linker does not find functions in "ffft.S.o"!
Code: [Select]
\avr\bin\avr-gcc -Os -Wl,--gc-sections -mmcu=atmega328p -o \Temp\build.tmp\ColorMusic.cpp.elf \Temp\build.tmp\IRremote\IRremote.cpp.o \Temp\build.tmp\ffft\ffft.S.o \Temp\build.tmp\ColorMusic.cpp.o \Temp\build.tmp\core.a -L\Temp\build.tmp -lm

o: In function `loop':
\Temp\build.tmp/ColorMusic.cpp:45: undefined reference to `fft_input(int const*, _tag_complex_t*)'
\Temp\build.tmp/ColorMusic.cpp:46: undefined reference to `fft_execute(_tag_complex_t*)'
\Temp\build.tmp/ColorMusic.cpp:47: undefined reference to `fft_output(_tag_complex_t*, unsigned int*)'

Coding Badly

Aug 22, 2010, 09:36 am Last Edit: Aug 22, 2010, 09:37 am by bcook Reason: 1
Code: [Select]

extern "C" {

// Put your function prototypes here



Ohh, thanks! It's worked!
I had not thought about C++ to generate names...

Go Up