From 5fb8343c7a0ebe6228f73cd1fe86098abba11958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 19 Aug 2026 12:58:09 +0200 Subject: [PATCH] build: pass -lc when generating compiler_rt.c --- CMakeLists.txt | 2 +- bootstrap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e74b6f17b313a6c4bef52610f2d49b33ecda978..837a5bcd1b8de6225797bdb92031b306fdd7bf92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -690,7 +690,7 @@ add_custom_command( set(BUILD_COMPILER_RT_ARGS "${PROJECT_SOURCE_DIR}/lib" - build-obj -ofmt=c -OReleaseSmall + build-obj -ofmt=c -lc -OReleaseSmall --name compiler_rt -femit-bin="${ZIG_COMPILER_RT_C_SOURCE}" -target "${ZIG_HOST_TARGET_TRIPLE}" diff --git a/bootstrap.c b/bootstrap.c index f0cdc8e0a2e2cb418ea0029cbb0a4aaae6c258be..4e41d2ebdc8a0839182901b33e6214ad3f6ae3f4 100644 --- a/bootstrap.c +++ b/bootstrap.c @@ -212,7 +212,7 @@ int main(int argc, char **argv) { { const char *child_argv[] = { "./zig1", "lib", "build-obj", - "-ofmt=c", "-OReleaseSmall", + "-ofmt=c", "-lc", "-OReleaseSmall", "--name", "compiler_rt", "-femit-bin=compiler_rt.c", "-target", host_triple, "-Mroot=lib/compiler_rt.zig", -- 2.54.0