From cc2847f6fff42e56f5466f4a0b5f639ea1b0a1ea Mon Sep 17 00:00:00 2001 From: Bakul Shah Date: Mon, 25 Oct 2021 00:24:08 -0700 Subject: [PATCH] builtin: fix compilation with `-gc boehm` on some FreeBSD versions (#12289) --- vlib/builtin/builtin_d_gcboehm.c.v | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/vlib/builtin/builtin_d_gcboehm.c.v b/vlib/builtin/builtin_d_gcboehm.c.v index 658dbc301e..4493cab0df 100644 --- a/vlib/builtin/builtin_d_gcboehm.c.v +++ b/vlib/builtin/builtin_d_gcboehm.c.v @@ -1,6 +1,17 @@ module builtin -#flag -DGC_THREADS=1 +$if freebsd { + // Tested on FreeBSD 13.0-RELEASE-p3, with clang, gcc and tcc: + #flag -DBUS_PAGE_FAULT=T_PAGEFLT + $if !tinyc { + #flag -DGC_THREADS=1 + #flag -DGC_BUILTIN_ATOMIC=1 + #flag @VEXEROOT/thirdparty/libgc/gc.o + #flag -lpthread + } +} $else { + #flag -DGC_THREADS=1 +} $if static_boehm ? { $if macos {