From 1c9280de560b65d02f03a4f1ee22df37a45084f9 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Tue, 4 Jan 2022 11:14:58 +0000 Subject: [PATCH] Add wasm32 CPU handling in embedded target --- rtl/embedded/Makefile | 3 +++ rtl/embedded/Makefile.fpc | 5 +++++ rtl/embedded/system.cfg | 17 +++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/rtl/embedded/Makefile b/rtl/embedded/Makefile index a60229128a..075dcc7c46 100644 --- a/rtl/embedded/Makefile +++ b/rtl/embedded/Makefile @@ -530,6 +530,9 @@ ifeq ($(CPU_UNITS_DEFINED),) $(error No CPUs enabled for given SUBARCH, pass either a SUBARCH or set CPU_UNITS_DEFINED=1 if you know what you are doing) endif endif +ifeq ($(ARCH),wasm32) +CPU_SPECIFIC_COMMON_UNITS=sysutils math classes fgl macpas typinfo types rtlconsts getopts +endif OBJPASDIR=$(RTL)/objpas GRAPHDIR=$(INC)/graph ifeq ($(FULL_TARGET),i386-linux) diff --git a/rtl/embedded/Makefile.fpc b/rtl/embedded/Makefile.fpc index 28ae2dce22..d33b12eee7 100644 --- a/rtl/embedded/Makefile.fpc +++ b/rtl/embedded/Makefile.fpc @@ -238,6 +238,11 @@ $(error No CPUs enabled for given SUBARCH, pass either a SUBARCH or set CPU_UNIT endif endif +ifeq ($(ARCH),wasm32) +CPU_SPECIFIC_COMMON_UNITS=sysutils math classes fgl macpas typinfo types rtlconsts getopts +# lineinfo +endif + # Paths OBJPASDIR=$(RTL)/objpas GRAPHDIR=$(INC)/graph diff --git a/rtl/embedded/system.cfg b/rtl/embedded/system.cfg index b09331b3d3..cf5d345d48 100644 --- a/rtl/embedded/system.cfg +++ b/rtl/embedded/system.cfg @@ -274,3 +274,20 @@ -SfRTTI -SfSOFTFPU #endif + +# wasm32 is powerful enough to handle most object pascal constructs +# it is only a matter of size, it does not need softfpu +#ifdef CPUWASM32 +-SfCLASSES +-SfEXCEPTIONS +-SfANSISTRINGS +-SfRTTI +-SfWIDESTRINGS +-SfDYNARRAYS +-SfTHREADING +-SfVARIANTS +-SfOBJECTS +-SfCOMMANDARGS +-SfRANDOM +-SfRESOURCES +#endif CPUWASM32