2016-08-17 11:08:22 -04:00
|
|
|
|
2019-03-08 02:07:50 -05:00
|
|
|
ifeq ($(GCC_NOT_5_2_0), 1)
|
|
|
|
|
|
|
|
ifdef CONFIG_NEWLIB_NANO_FORMAT
|
|
|
|
LIBC := c_nano
|
|
|
|
else # CONFIG_NEWLIB_NANO_FORMAT
|
|
|
|
LIBC := c
|
|
|
|
endif # CONFIG_NEWLIB_NANO_FORMAT
|
|
|
|
|
2019-04-01 03:21:12 -04:00
|
|
|
# Order of linking matters: libnewlib.a should go before libc.a
|
|
|
|
COMPONENT_ADD_LDFLAGS := -lnewlib -l$(LIBC) -lm
|
2019-03-08 02:07:50 -05:00
|
|
|
COMPONENT_ADD_INCLUDEDIRS := platform_include
|
|
|
|
|
|
|
|
ifdef CONFIG_SPIRAM_CACHE_WORKAROUND
|
|
|
|
COMPONENT_ADD_LDFRAGMENTS := esp32-spiram-rom-functions-c.lf
|
|
|
|
endif
|
|
|
|
|
2019-04-01 03:21:12 -04:00
|
|
|
# Forces the linker to include locks, heap, and syscalls from this component,
|
|
|
|
# instead of the implementations provided by newlib.
|
2019-03-17 23:47:00 -04:00
|
|
|
COMPONENT_ADD_LDFLAGS += -u newlib_include_locks_impl
|
2019-04-01 03:21:12 -04:00
|
|
|
COMPONENT_ADD_LDFLAGS += -u newlib_include_heap_impl
|
|
|
|
COMPONENT_ADD_LDFLAGS += -u newlib_include_syscalls_impl
|
2019-03-17 23:47:00 -04:00
|
|
|
|
2019-03-08 02:07:50 -05:00
|
|
|
else # GCC_NOT_5_2_0
|
|
|
|
# Remove this section when GCC 5.2.0 is no longer supported
|
|
|
|
|
2017-09-05 01:50:31 -04:00
|
|
|
ifdef CONFIG_SPIRAM_CACHE_WORKAROUND
|
2017-07-20 04:26:35 -04:00
|
|
|
LIBC_PATH := $(COMPONENT_PATH)/lib/libc-psram-workaround.a
|
|
|
|
LIBM_PATH := $(COMPONENT_PATH)/lib/libm-psram-workaround.a
|
2019-03-08 02:07:50 -05:00
|
|
|
COMPONENT_ADD_LDFRAGMENTS := esp32-spiram-rom-functions-psram-workaround.lf
|
2017-07-20 04:26:35 -04:00
|
|
|
else
|
|
|
|
|
2017-09-05 01:50:31 -04:00
|
|
|
ifdef CONFIG_NEWLIB_NANO_FORMAT
|
2016-11-07 05:43:29 -05:00
|
|
|
LIBC_PATH := $(COMPONENT_PATH)/lib/libc_nano.a
|
|
|
|
else
|
|
|
|
LIBC_PATH := $(COMPONENT_PATH)/lib/libc.a
|
2017-09-05 01:50:31 -04:00
|
|
|
endif # CONFIG_NEWLIB_NANO_FORMAT
|
2016-11-07 05:43:29 -05:00
|
|
|
|
2016-12-11 23:54:30 -05:00
|
|
|
LIBM_PATH := $(COMPONENT_PATH)/lib/libm.a
|
|
|
|
|
2016-12-03 17:11:22 -05:00
|
|
|
endif # CONFIG_SPIRAM_CACHE_WORKAROUND
|
2017-07-20 04:26:35 -04:00
|
|
|
|
|
|
|
COMPONENT_ADD_LDFLAGS := $(LIBC_PATH) $(LIBM_PATH) -lnewlib
|
2016-12-11 23:54:30 -05:00
|
|
|
|
|
|
|
COMPONENT_ADD_LINKER_DEPS := $(LIBC_PATH) $(LIBM_PATH)
|
2016-08-17 11:08:22 -04:00
|
|
|
|
2017-07-12 00:57:44 -04:00
|
|
|
COMPONENT_ADD_INCLUDEDIRS := platform_include include
|
2019-03-08 02:07:50 -05:00
|
|
|
endif # GCC_NOT_5_2_0
|
2018-11-21 23:19:49 -05:00
|
|
|
|
2019-04-01 03:21:12 -04:00
|
|
|
COMPONENT_ADD_LDFRAGMENTS += newlib.lf
|
|
|
|
|
|
|
|
heap.o: CFLAGS += -fno-builtin
|