From 557cb646918fd58e6a71e7be9fb49434e2930c18 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 12 Nov 2023 17:29:21 -0700 Subject: [PATCH] bootstrap.c: add -pthread if the compiler is gnu otherwise we get undefined symbol errors on pthread stuff --- bootstrap.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bootstrap.c b/bootstrap.c index a32b3d2a5f..35ad33d266 100644 --- a/bootstrap.c +++ b/bootstrap.c @@ -175,7 +175,16 @@ int main(int argc, char **argv) { const char *child_argv[] = { cc, "-o", "zig2", "zig2.c", "compiler_rt.c", "-std=c99", "-O2", "-fno-stack-protector", - "-Wl,-z,stack-size=0x10000000", "-Istage1", NULL, + "-Istage1", +#if defined(__APPLE__) + "-Wl,-stack_size,0x10000000", +#else + "-Wl,-z,stack-size=0x10000000", +#endif +#if defined(__GNUC__) + "-pthread", +#endif + NULL, }; print_and_run(child_argv); }