Skip to content

Assembly files not working with newer gcc, -assembler-with-cpp option does not exist? #1807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
matthijskooijman opened this issue Jan 14, 2014 · 3 comments

Comments

@matthijskooijman
Copy link
Collaborator

No description provided.

@matthijskooijman
Copy link
Collaborator Author

When trying to compile a .S file (just drop an empty .S file in any
library you are using) with 1.5.x from git using a newer avr-gcc
(4.8.something), I get:

avr-gcc -c -g -assembler-with-cpp -mmcu=atmega256rfr2 -DF_CPU=16000000L -DARDUINO=155 -DARDUINO_PINOCCIO -DARDUINO_ARCH_AVR -D__PROG_TYPES_COMPAT__ -I/home/matthijs/docs/Electronics/Arduino/Arduino-1.5/build/linux/work/hardware/arduino/avr/cores/arduino -I/home/matthijs/docs/Electronics/Arduino/hardware/pinoccio/avr/variants/pinoccio -I/home/matthijs/docs/Electronics/Arduino/libraries/DHT -I/home/matthijs/docs/Electronics/Arduino/libraries/DHT/utility /home/matthijs/docs/Electronics/Arduino/libraries/DHT/Asm.S -o /home/matthijs/docs/Electronics/Pinoccio/library-gainspan-s2w/examples/GSClientTLS/build/DHT/Asm.S.o 
avr-gcc: error: unrecognized command line option ‘-assembler-with-cpp’

This option comes from https://github.com/arduino/Arduino/blob/ide-1.5.x/hardware/arduino/avr/platform.txt#L20

I can't find any documentation of this option, but it seems that it has
been dropped in newer version. From newere documentation, it seems that
-x assembler-with-cpp is supposed to replace this option. Testing
shows that the -x version is also supported by the Arduino-bundled
4.3.2 version:

/home/matthijs/docs/Electronics/Arduino/Arduino-1.5/build/linux/work/hardware/tools/avr/bin/avr-gcc -c -g -assembler-with-cpp -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=155 -DARDUINO_AVR_ADK -DARDUINO_ARCH_AVR -I/home/matthijs/docs/Electronics/Arduino/Arduino-1.5/build/linux/work/hardware/arduino/avr/cores/arduino -I/home/matthijs/docs/Electronics/Arduino/Arduino-1.5/build/linux/work/hardware/arduino/avr/variants/mega -I/home/matthijs/docs/Electronics/Arduino/libraries/DHT -I/home/matthijs/docs/Electronics/Arduino/libraries/DHT/utility /home/matthijs/docs/Electronics/Arduino/libraries/DHT/Asm.S -o /home/matthijs/docs/Electronics/Pinoccio/library-gainspan-s2w/examples/GSClientTLS/build/DHT/Asm.S.o 

Would it make sense to just switch to the -x version to increase
future-proofness?

@b-rohit
Copy link

b-rohit commented Jan 17, 2017

I compiled a arduino mavlink sketch from https://github.com/alaney/arduino-mavlink in 1.8.1 and 1.8.2. and i got the same error.

Arduino: 1.8.2 (Windows 10), Board: "Arduino/Genuino Uno"

In file included from E:\Dw\arduino-mavlink-master\ArduinoMAVLink\ArduinoMAVLink.ino:2:0:

C:\Users\Rohit\Downloads\arduino-PR-5863-BUILD-637-windows\arduino-PR-5863-BUILD-637\libraries\FastSerial/FastSerial.h:47:3: error: #error Must include FastSerial.h before the Arduino serial driver is defined.

error Must include FastSerial.h before the Arduino serial driver is defined.

^
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

@matthijskooijman
Copy link
Collaborator Author

@b-rohit, huh? This does not seem to be related to this particular issue either. Are you having trouble creating a new issue, or?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants