Skip to content

Commit 557cb64

Browse files
committed
bootstrap.c: add -pthread if the compiler is gnu
otherwise we get undefined symbol errors on pthread stuff
1 parent 0dbaa8d commit 557cb64

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

bootstrap.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,16 @@ int main(int argc, char **argv) {
175175
const char *child_argv[] = {
176176
cc, "-o", "zig2", "zig2.c", "compiler_rt.c",
177177
"-std=c99", "-O2", "-fno-stack-protector",
178-
"-Wl,-z,stack-size=0x10000000", "-Istage1", NULL,
178+
"-Istage1",
179+
#if defined(__APPLE__)
180+
"-Wl,-stack_size,0x10000000",
181+
#else
182+
"-Wl,-z,stack-size=0x10000000",
183+
#endif
184+
#if defined(__GNUC__)
185+
"-pthread",
186+
#endif
187+
NULL,
179188
};
180189
print_and_run(child_argv);
181190
}

0 commit comments

Comments
 (0)