mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Fixed problem with debug build and _sbrk, caused by missing -lc linker
option. Re-ordered some makefile statements to be in-line with baseflight for easier merging.
This commit is contained in:
parent
b96d1ae71d
commit
61bdc2ad5d
1 changed files with 11 additions and 12 deletions
23
Makefile
23
Makefile
|
@ -338,16 +338,15 @@ SIZE = arm-none-eabi-size
|
||||||
ifeq ($(DEBUG),GDB)
|
ifeq ($(DEBUG),GDB)
|
||||||
OPTIMIZE = -O0
|
OPTIMIZE = -O0
|
||||||
LTO_FLAGS = $(OPTIMIZE)
|
LTO_FLAGS = $(OPTIMIZE)
|
||||||
SPEC_FLAGS =
|
|
||||||
else
|
else
|
||||||
OPTIMIZE = -Os
|
OPTIMIZE = -Os
|
||||||
LTO_FLAGS = $(OPTIMIZE) -flto -fuse-linker-plugin
|
LTO_FLAGS = -flto -fuse-linker-plugin $(OPTIMIZE)
|
||||||
SPEC_FLAGS = --specs=nano.specs
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DEBUG_FLAGS = -ggdb3
|
DEBUG_FLAGS = -ggdb3
|
||||||
|
|
||||||
CFLAGS = $(ARCH_FLAGS) \
|
CFLAGS = $(ARCH_FLAGS) \
|
||||||
|
$(LTO_FLAGS) \
|
||||||
$(addprefix -D,$(OPTIONS)) \
|
$(addprefix -D,$(OPTIONS)) \
|
||||||
$(addprefix -I,$(INCLUDE_DIRS)) \
|
$(addprefix -I,$(INCLUDE_DIRS)) \
|
||||||
$(DEBUG_FLAGS) \
|
$(DEBUG_FLAGS) \
|
||||||
|
@ -359,24 +358,24 @@ CFLAGS = $(ARCH_FLAGS) \
|
||||||
-DUSE_STDPERIPH_DRIVER \
|
-DUSE_STDPERIPH_DRIVER \
|
||||||
$(TARGET_FLAGS) \
|
$(TARGET_FLAGS) \
|
||||||
-D'__FORKNAME__="$(FORKNAME)"' \
|
-D'__FORKNAME__="$(FORKNAME)"' \
|
||||||
-save-temps=obj \
|
-save-temps=obj
|
||||||
$(LTO_FLAGS)
|
|
||||||
|
|
||||||
ASFLAGS = $(ARCH_FLAGS) \
|
ASFLAGS = $(ARCH_FLAGS) \
|
||||||
-x assembler-with-cpp \
|
-x assembler-with-cpp \
|
||||||
$(addprefix -I,$(INCLUDE_DIRS))
|
$(addprefix -I,$(INCLUDE_DIRS))
|
||||||
|
|
||||||
# XXX Map/crossref output?
|
LDFLAGS = -lm \
|
||||||
LDFLAGS = -T$(LD_SCRIPT) \
|
-nostartfiles \
|
||||||
|
--specs=nano.specs \
|
||||||
|
-lc \
|
||||||
|
-lnosys \
|
||||||
$(ARCH_FLAGS) \
|
$(ARCH_FLAGS) \
|
||||||
|
$(LTO_FLAGS) \
|
||||||
$(DEBUG_FLAGS) \
|
$(DEBUG_FLAGS) \
|
||||||
-static \
|
-static \
|
||||||
-nostartfiles \
|
|
||||||
-Wl,-gc-sections,-Map,$(TARGET_MAP) \
|
-Wl,-gc-sections,-Map,$(TARGET_MAP) \
|
||||||
-lnosys \
|
-T$(LD_SCRIPT)
|
||||||
-lm \
|
|
||||||
$(LTO_FLAGS) \
|
|
||||||
$(SPEC_FLAGS)
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# No user-serviceable parts below
|
# No user-serviceable parts below
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue