Skip to content

Commit dca3126

Browse files
committed
all: shrink bdwgc library
By disabling some configuration options, the library becomes a lot smaller. On Linux, binaries are ~12kb smaller. This isn't really important on Linux/macOS/Windows, but will become important when we start using bdwgc on WebAssembly.
1 parent fdf075a commit dca3126

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

builder/bdwgc.go

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ var BoehmGC = Library{
3030
// Use a minimal environment.
3131
"-DNO_MSGBOX_ON_ERROR", // don't call MessageBoxA on Windows
3232
"-DDONT_USE_ATEXIT",
33+
"-DNO_CLOCK", // don't use system clock
34+
"-DNO_DEBUGGING", // reduce code size
35+
"-DGC_NO_FINALIZATION", // finalization is not used at the moment
36+
"-DNO_GETENV", // smaller binary, more predictable configuration
3337

3438
// Special flag to work around the lack of __data_start in ld.lld.
3539
// TODO: try to fix this in LLVM/lld directly so we don't have to

0 commit comments

Comments
 (0)