Browse Source

Add wasm32 CPU handling in embedded target

Pierre Muller 3 years ago
parent
commit
1c9280de56
3 changed files with 25 additions and 0 deletions
  1. 3 0
      rtl/embedded/Makefile
  2. 5 0
      rtl/embedded/Makefile.fpc
  3. 17 0
      rtl/embedded/system.cfg

+ 3 - 0
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)

+ 5 - 0
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

+ 17 - 0
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