windows: add support for the Boehm-Demers-Weiser GC

A few small changes were needed to make this work. In particular, I
found a critical bug (see the previous commit) that needed to be fixed
to make this work on Windows.
This commit is contained in:
Ayke van Laethem
2025-03-22 09:39:27 +01:00
committed by Ron Evans
parent fd3976b5bb
commit b9bf0aa0da
5 changed files with 23 additions and 5 deletions
+2
View File
@@ -395,8 +395,10 @@ func (c *Config) LibcCFlags() []string {
"-nostdlibinc",
"-isystem", filepath.Join(path, "include"),
"-isystem", filepath.Join(root, "lib", "mingw-w64", "mingw-w64-headers", "crt"),
"-isystem", filepath.Join(root, "lib", "mingw-w64", "mingw-w64-headers", "include"),
"-isystem", filepath.Join(root, "lib", "mingw-w64", "mingw-w64-headers", "defaults", "include"),
"-D_UCRT",
"-D_WIN32_WINNT=0x0a00", // target Windows 10
}
case "":
// No libc specified, nothing to add.
+1 -1
View File
@@ -427,7 +427,7 @@ func defaultTarget(options *Options) (*TargetSpec, error) {
"src/runtime/runtime_unix.c",
"src/runtime/signal.c")
case "windows":
spec.GC = "precise"
spec.GC = "boehm"
spec.Linker = "ld.lld"
spec.Libc = "mingw-w64"
// Note: using a medium code model, low image base and no ASLR