[compiler-rt] [compiler-rt] Allow building builtins.a without a libc (PR #86737)
Jon Chesterfield via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 26 14:12:11 PDT 2024
https://github.com/JonChesterfield updated https://github.com/llvm/llvm-project/pull/86737
>From 57c41c9ede71e9c2b3341ae36c2f7c0cb716a53d Mon Sep 17 00:00:00 2001
From: Jon Chesterfield <jonathanchesterfield at gmail.com>
Date: Tue, 26 Mar 2024 20:46:58 +0000
Subject: [PATCH] [compiler-rt] Allow building builtins.a without a libc
---
compiler-rt/cmake/config-ix.cmake | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index 2ca18ebb4ad489..40651b96c89eae 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -235,9 +235,9 @@ set(COMPILER_RT_SUPPORTED_ARCH)
# Try to compile a very simple source file to ensure we can target the given
# platform. We use the results of these tests to build only the various target
# runtime libraries supported by our current compilers cross-compiling
-# abilities.
+# abilities. Avoids using libc as that may not be available yet.
set(SIMPLE_SOURCE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple.cc)
-file(WRITE ${SIMPLE_SOURCE} "#include <stdlib.h>\n#include <stdio.h>\nint main(void) { printf(\"hello, world\"); }\n")
+file(WRITE ${SIMPLE_SOURCE} "int main(void) { return 0; }\n")
# Detect whether the current target platform is 32-bit or 64-bit, and setup
# the correct commandline flags needed to attempt to target 32-bit and 64-bit.
More information about the llvm-commits
mailing list