diff options
| author | Jerzy Kasenberg <[email protected]> | 2021-12-26 22:19:07 +0100 |
|---|---|---|
| committer | Jerzy Kasenberg <[email protected]> | 2021-12-27 10:11:56 +0100 |
| commit | 5c5ecea6f17aae16808533aa248671069cdc5fa5 (patch) | |
| tree | e79192ab522d229069d5630e585adf81fbe3bebf /examples/rules.mk | |
| parent | a6789b5d5a3c9e41771e5eb8fdb08182c95fbe08 (diff) | |
build system: Changes for xc32 compiler
Three changes are needed to accommodate xc32 compiler build:
- optimized build flag other than -Os
added CFLAGS_OPTIMIZED that defaults to -Os but can be overridden in boards
- build without -lnosys
added LIBS_GCC with default libraries that can be changed in boards
- build without LD_FILE specification
if LD_FILE is empty -Wl,-T options is not added to LDFLAGS
Diffstat (limited to 'examples/rules.mk')
| -rw-r--r-- | examples/rules.mk | 10 |
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 |
