mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
Build: fixes for building with avr-g++ 4.7.0
This commit is contained in:
parent
51bb2a3b8d
commit
0c1912565a
@ -88,15 +88,22 @@ typedef struct {
|
|||||||
# undef PROGMEM
|
# undef PROGMEM
|
||||||
# define PROGMEM __attribute__(())
|
# define PROGMEM __attribute__(())
|
||||||
#else
|
#else
|
||||||
|
#ifndef __PROG_TYPES_COMPAT__
|
||||||
# undef PROGMEM
|
# undef PROGMEM
|
||||||
# define PROGMEM __attribute__(( section(".progmem.data") ))
|
# define PROGMEM __attribute__(( section(".progmem.data") ))
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
# undef PSTR
|
# undef PSTR
|
||||||
/* Need const type for progmem - new for avr-gcc 4.6 */
|
/* Need const type for progmem - new for avr-gcc 4.6 */
|
||||||
# if __AVR__ && __GNUC__ == 4 && __GNUC_MINOR__ > 5
|
# if __AVR__ && __GNUC__ == 4 && __GNUC_MINOR__ > 5
|
||||||
|
#ifdef __PROG_TYPES_COMPAT__
|
||||||
|
# define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); \
|
||||||
|
(const prog_char_t *)&__c[0]; }))
|
||||||
|
#else
|
||||||
# define PSTR(s) (__extension__({static const prog_char __c[] PROGMEM = (s); \
|
# define PSTR(s) (__extension__({static const prog_char __c[] PROGMEM = (s); \
|
||||||
(const prog_char_t *)&__c[0]; }))
|
(const prog_char_t *)&__c[0]; }))
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
# define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); \
|
# define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); \
|
||||||
(prog_char_t *)&__c[0]; }))
|
(prog_char_t *)&__c[0]; }))
|
||||||
@ -107,7 +114,6 @@ typedef struct {
|
|||||||
// this gets the gcc __format__ checking right
|
// this gets the gcc __format__ checking right
|
||||||
#define FPSTR(s) (wchar_t *)(s)
|
#define FPSTR(s) (wchar_t *)(s)
|
||||||
|
|
||||||
|
|
||||||
static inline int strcasecmp_P(const char *str1, const prog_char_t *pstr)
|
static inline int strcasecmp_P(const char *str1, const prog_char_t *pstr)
|
||||||
{
|
{
|
||||||
return strcasecmp_P(str1, (const prog_char *)pstr);
|
return strcasecmp_P(str1, (const prog_char *)pstr);
|
||||||
|
@ -228,19 +228,19 @@ endif
|
|||||||
#
|
#
|
||||||
# Tool options
|
# Tool options
|
||||||
#
|
#
|
||||||
DEFINES = -DF_CPU=$(F_CPU) -DARDUINO=$(ARDUINO_VERS) $(EXTRAFLAGS)
|
DEFINES = -D__PROG_TYPES_COMPAT__ -DF_CPU=$(F_CPU) -DARDUINO=$(ARDUINO_VERS) $(EXTRAFLAGS)
|
||||||
OPTFLAGS = -Os -Wformat -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wformat=2 -Wno-reorder
|
OPTFLAGS = -Os -Wformat -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wformat=2 -Wno-reorder
|
||||||
DEPFLAGS = -MD -MT $@
|
DEPFLAGS = -MD -MT $@
|
||||||
|
|
||||||
# XXX warning options TBD
|
# XXX warning options TBD
|
||||||
CXXOPTS = -mcall-prologues -ffunction-sections -fdata-sections -fno-exceptions
|
CXXOPTS = -mcall-prologues -ffunction-sections -fdata-sections -fno-exceptions
|
||||||
COPTS = -mcall-prologues -ffunction-sections -fdata-sections
|
COPTS = -mcall-prologues -ffunction-sections -fdata-sections
|
||||||
ASOPTS = -assembler-with-cpp
|
ASOPTS =
|
||||||
LISTOPTS = -adhlns=$(@:.o=.lst)
|
LISTOPTS = -adhlns=$(@:.o=.lst)
|
||||||
|
|
||||||
CXXFLAGS = -g -mmcu=$(MCU) $(DEFINES) -Wa,$(LISTOPTS) $(OPTFLAGS) $(DEPFLAGS) $(CXXOPTS)
|
CXXFLAGS = -g -mmcu=$(MCU) $(DEFINES) -Wa,$(LISTOPTS) $(OPTFLAGS) $(DEPFLAGS) $(CXXOPTS)
|
||||||
CFLAGS = -g -mmcu=$(MCU) $(DEFINES) -Wa,$(LISTOPTS) $(OPTFLAGS) $(DEPFLAGS) $(COPTS)
|
CFLAGS = -g -mmcu=$(MCU) $(DEFINES) $(OPTFLAGS) $(DEPFLAGS) $(COPTS)
|
||||||
ASFLAGS = -g -mmcu=$(MCU) $(DEFINES) $(LISTOPTS) $(DEPFLAGS) $(ASOPTS)
|
ASFLAGS = -g -mmcu=$(MCU) $(DEFINES) $(DEPFLAGS) $(ASOPTS)
|
||||||
LDFLAGS = -g -mmcu=$(MCU) $(OPTFLAGS) -Wl,--relax,--gc-sections -Wl,-Map -Wl,$(SKETCHMAP)
|
LDFLAGS = -g -mmcu=$(MCU) $(OPTFLAGS) -Wl,--relax,--gc-sections -Wl,-Map -Wl,$(SKETCHMAP)
|
||||||
|
|
||||||
ifeq ($(BOARD),mega)
|
ifeq ($(BOARD),mega)
|
||||||
|
Loading…
Reference in New Issue
Block a user