Skip to content
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

Compiler comandline fail, -mmcu= left unset #648

Open
JATothrim opened this issue Dec 9, 2020 · 1 comment
Open

Compiler comandline fail, -mmcu= left unset #648

JATothrim opened this issue Dec 9, 2020 · 1 comment

Comments

@JATothrim
Copy link

The blink.ino example project fails to build, because Arduino.mk does following with Arduino Nano.
Makefile:

ARDMK_DIR=/usr/share/arduino
ARDMK_VENDOR=archlinux-arduino
ARDUINO_DIR=/usr/share/arduino
ARCHITECTURE = avr
BOARD_TAG = nano
BOARD_SUB = atmega328p
include $(ARDMK_DIR)/Arduino.mk

Result:
/usr/bin/avr-g++ -x c++ -include Arduino.h -MMD -c -D__PROG_TYPES_COMPAT__ -mmcu= -DF_CPU=16000000L -DARDUINO=1813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-DARDUINO_BOARD=\"AVR_NANO\"" "-DARDUINO_VARIANT=\"eightanaloginputs\"" -I/usr/share/arduino/hardware/archlinux-arduino/avr/cores/arduino -I/usr/share/arduino/hardware/archlinux-arduino/avr/cores/arduino/api -I/usr/share/arduino/hardware/archlinux-arduino/avr/variants/eightanaloginputs -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto -fdiagnostics-color=always blink.ino -o build-nano-atmega328p/blink.ino.o avr-g++: error: missing device or architecture after '-mmcu='

Somehow -mmcu= is not set as "-mmcu=atmega328p" even though I specified it.
What's going on?

More over I would love to have more control how Arduino.mk setups the compiler command line flags for CFLAGS and CXXFLAGS etc.
Currently I can't by default remove etc. -fpermissive flag from the compiler cmdline without hacking the Arduino.mk installed on the system... :-(

@alpo
Copy link

alpo commented Dec 10, 2020

It seems to be a duplicate of issue #638.

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

2 participants