diff --git a/Build/Makefile.conf b/Build/Makefile.conf index 66bc5a88..396be2db 100644 --- a/Build/Makefile.conf +++ b/Build/Makefile.conf @@ -6,6 +6,10 @@ ifdef STDCLIB override NEWLIB := $(STDCLIB) endif +ifeq ($(TOOLCHAIN),hightec) +override STDCLIB := picolibc_small +endif + include $(NUCLEI_SDK_BUILD)/Makefile.files include $(NUCLEI_SDK_NMSIS)/build.mk include $(NUCLEI_SDK_BUILD)/Makefile.soc diff --git a/Build/toolchain/hightec.mk b/Build/toolchain/hightec.mk index ee097e6f..2118e038 100644 --- a/Build/toolchain/hightec.mk +++ b/Build/toolchain/hightec.mk @@ -8,29 +8,25 @@ AR := llvm-ar SIZE := llvm-size OPENOCD := openocd -ifneq ($(findstring libncrt,$(STDCLIB)),) -$(error Terapines toolchain dont provide libncrt library support) -endif - # Handle standard c library selection variable STDCLIB -ifneq ($(findstring newlib,$(STDCLIB)),) -### Handle cases when STDCLIB variable has newlib in it -ifeq ($(STDCLIB),newlib_full) +ifneq ($(findstring picolibc,$(STDCLIB)),) +### Handle cases when STDCLIB variable has picolibc in it +ifeq ($(STDCLIB),picolibc_full) LDLIBS += -lc -else ifeq ($(STDCLIB),newlib_fast) +else ifeq ($(STDCLIB),picolibc_fast) LDLIBS += -lc -STDCLIB_LDFLAGS += -u _printf_float -u _scanf_float -else ifeq ($(STDCLIB),newlib_small) +STDCLIB_LDFLAGS += +else ifeq ($(STDCLIB),picolibc_small) LDLIBS += -lc -STDCLIB_LDFLAGS += -u _printf_float -else ifeq ($(STDCLIB),newlib_nano) +STDCLIB_LDFLAGS += +else ifeq ($(STDCLIB),picolibc_nano) LDLIBS += -lc # work around for relocation R_RISCV_PCREL_HI20 out of range: -524289 is not in [-524288, 524287]; references _printf_float when compile with rv64 -# so with this change below, newlib_nano = newlib_small now -STDCLIB_LDFLAGS += -u _printf_float +# so with this change below, picolibc_nano = picolibc_small now +STDCLIB_LDFLAGS += else LDLIBS += -lc -STDCLIB_LDFLAGS += -u _printf_float +STDCLIB_LDFLAGS += endif ### else ifeq ($(STDCLIB),nostd) @@ -43,7 +39,7 @@ COMMON_FLAGS += ### else LDLIBS += -lc -STDCLIB_LDFLAGS += -u _printf_float +STDCLIB_LDFLAGS += ### endif @@ -86,7 +82,7 @@ ifneq ($(RISCV_TUNE),) COMMON_FLAGS +=# -mtune=$(RISCV_TUNE) endif -ifneq ($(findstring newlib,$(STDCLIB)),) +ifneq ($(findstring picolibc,$(STDCLIB)),) LDFLAGS += #-u __on_exit_args endif diff --git a/SoC/evalsoc/build.mk b/SoC/evalsoc/build.mk index 5638bc1c..2bdd65f6 100644 --- a/SoC/evalsoc/build.mk +++ b/SoC/evalsoc/build.mk @@ -189,6 +189,8 @@ C_SRCDIRS += $(NUCLEI_SDK_SOC_COMMON)/Source $(NUCLEI_SDK_SOC_COMMON)/Source/Dri ifeq ($(SEMIHOST),) ifneq ($(findstring newlib,$(STDCLIB)),) C_SRCDIRS += $(NUCLEI_SDK_SOC_COMMON)/Source/Stubs/newlib +else ifneq ($(findstring picolibc,$(STDCLIB)),) +C_SRCDIRS += $(NUCLEI_SDK_SOC_COMMON)/Source/Stubs/picolibc else # no stubs will be used endif