summaryrefslogtreecommitdiff
path: root/examples/rules.mk
diff options
context:
space:
mode:
authorValentin Milea <[email protected]>2022-01-07 15:12:07 +0200
committerValentin Milea <[email protected]>2022-01-07 15:12:07 +0200
commitc2533a45bd932d672458cf54d37ac5207a734e41 (patch)
treea8d886bdccaed451053262b0d875612338389474 /examples/rules.mk
parenta284e438f1952315631f354dee2b30b264afb324 (diff)
parent3b09b82123a50bef6b18cf90c2734ae7581da4a3 (diff)
Merge branch 'master' into feature/feedback_format
Diffstat (limited to 'examples/rules.mk')
-rw-r--r--examples/rules.mk10
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/rules.mk b/examples/rules.mk
index 4cc35cb22..95a9c9879 100644
--- a/examples/rules.mk
+++ b/examples/rules.mk
@@ -12,8 +12,10 @@ ifeq (,$(findstring $(FAMILY),esp32s2 esp32s3 rp2040))
# Compiler Flags
# ---------------------------------------
+LIBS_GCC ?= -lgcc -lm -lnosys
+
# libc
-LIBS += -lgcc -lm -lnosys
+LIBS += $(LIBS_GCC)
ifneq ($(BOARD), spresense)
LIBS += -lc
@@ -49,7 +51,11 @@ ifeq ($(NO_LTO),1)
CFLAGS := $(filter-out -flto,$(CFLAGS))
endif
-LDFLAGS += $(CFLAGS) -Wl,-T,$(TOP)/$(LD_FILE) -Wl,[email protected] -Wl,-cref -Wl,-gc-sections
+ifneq ($(LD_FILE),)
+LDFLAGS_LD_FILE ?= -Wl,-T,$(TOP)/$(LD_FILE)
+endif
+
+LDFLAGS += $(CFLAGS) $(LDFLAGS_LD_FILE) -Wl,[email protected] -Wl,-cref -Wl,-gc-sections
ifneq ($(SKIP_NANOLIB), 1)
LDFLAGS += -specs=nosys.specs -specs=nano.specs
endif