summaryrefslogtreecommitdiff
path: root/compile.bat
diff options
context:
space:
mode:
authorGravatar Michael Smith <mikesmiffy128@gmail.com> 2025-12-27 03:05:05 +0000
committerGravatar Michael Smith <mikesmiffy128@gmail.com> 2026-02-16 19:11:24 +0000
commit8d4b47298b6c9eeb9a3f79a5b80d894f80ed4a45 (patch)
tree63a8ea6f645b997fd7943a58a002e66244fa49ac /compile.bat
parente7943fb834cbcaec585ed68e67b5f17ceda504f7 (diff)
downloadsst-8d4b47298b6c9eeb9a3f79a5b80d894f80ed4a45.tar.gz
sst-8d4b47298b6c9eeb9a3f79a5b80d894f80ed4a45.zip
Do away with memcpy/memset/memcmp
Now everything is either explicitly a rep thing, or explicitly some other small run of reasonably efficient instructions. No library calls or function call overhead of any kind. Code size remains nice and small. Ban a few other bad libc functions while we're at it. More can be added later if we decide that's a useful idea. This will require some discipline and workarounds to cope with Clang's tendency to shove mem* calls in places you don't want them even when you tell it not to. Well, c'est la vie. I'm a little nervous that the __builtin_memmove() usage in shuntvars() could still one day emit actual library calls. It appears we're not importing memmove() from anywhere at the moment, though. So I guess it's good enough for now. Also I had to get rid of alloca() in con_.c but that was kind of bad anyway, so that's fine.
Diffstat (limited to 'compile.bat')
-rw-r--r--compile.bat8
1 files changed, 4 insertions, 4 deletions
diff --git a/compile.bat b/compile.bat
index 2958186..10be904 100644
--- a/compile.bat
+++ b/compile.bat
@@ -29,8 +29,8 @@ if "%dbg%"=="1" (
set cflags=-O0 -g3 -masm=intel -fsanitize-trap=undefined -DSST_DBG
set ldflags=-O0 -g3
) else (
- set cflags=-O2 -masm=intel
- set ldflags=-O2
+ set cflags=-O2 -masm=intel -ffreestanding
+ set ldflags=-O2 -ffreestanding
)
set objs=
@@ -46,8 +46,8 @@ set dmodname= -DMODULE_NAME=%basename%
if "%dmodname%"==" -DMODULE_NAME=con_" set dmodname= -DMODULE_NAME=con
if "%dmodname%"==" -DMODULE_NAME=sst" set dmodname=
set objs=%objs% .build/%basename%%ext%.o
-%CC% -c -flto -mno-stack-arg-probe %cflags% %warnings% %stdflags% -I.build/include ^
--D_DLL%dmodname% -o .build/%basename%%ext%.o %1 || goto :end
+%CC% -c -flto -mno-stack-arg-probe %cflags% %warnings% %stdflags% -include src/1.h ^
+-I.build/include -D_DLL%dmodname% -o .build/%basename%%ext%.o %1 || goto :end
goto :eof
:main