From ba859c584baff8ae1f0c2acf501225b369f0c7ad Mon Sep 17 00:00:00 2001 From: spaceface Date: Sun, 22 May 2022 20:25:46 +0200 Subject: [PATCH] builtin: add static GC support on Windows with TCC (#14497) --- .github/workflows/ci.yml | 4 +++- vlib/builtin/builtin_d_gcboehm.c.v | 9 ++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d36c80e7e..a966d8b729 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -594,7 +594,9 @@ jobs: - name: Build examples run: ./v build-examples - name: v2 self compilation - run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v + run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v && .\v3.exe -o v4.exe cmd/v + - name: v2 self compilation with -gc boehm + run: .\v.exe -o v2.exe -gc boehm cmd/v && .\v2.exe -o v3.exe -gc boehm cmd/v && .\v3.exe -o v4.exe -gc boehm cmd/v ## ## tcc32 ## - name: Build with make.bat -tcc32 diff --git a/vlib/builtin/builtin_d_gcboehm.c.v b/vlib/builtin/builtin_d_gcboehm.c.v index ccc76ff0fb..69dac05359 100644 --- a/vlib/builtin/builtin_d_gcboehm.c.v +++ b/vlib/builtin/builtin_d_gcboehm.c.v @@ -59,14 +59,13 @@ $if dynamic_boehm ? { #flag $first_existing("/usr/local/lib/libgc.a", "/usr/lib/libgc.a") #flag -lpthread } $else $if windows { + #flag -DGC_NOT_DLL=1 + #flag -DGC_WIN32_THREADS=1 $if tinyc { #flag -I@VEXEROOT/thirdparty/libgc/include - #flag -L@VEXEROOT/thirdparty/tcc/lib - #flag -lgc + #flag @VEXEROOT/thirdparty/tcc/lib/libgc.a + #flag -luser32 } $else { - #flag -DGC_NOT_DLL=1 - #flag -DGC_WIN32_THREADS=1 - #flag -DGC_BUILTIN_ATOMIC=1 #flag -I@VEXEROOT/thirdparty/libgc/include #flag @VEXEROOT/thirdparty/libgc/gc.o }