From bbdac6c9d03b0da42050e1f8d9f4696fdc1c8630 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 376bf6620457d5892beb6c83a95f5aebe8aabee5..983ce1933f5cddbfaff8f28ebdb8604f2a737dbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -691,7 +691,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 f020f6a5518d997a2635c147976892bfa0307149..71c955ce65628394b22e0bb732893ad86a223514 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