[compiler-rt] [compiler-rt] Allow using a compiler without `stdio` and `printf` (PR #95234)

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 08:21:24 PDT 2024


================
@@ -223,7 +223,7 @@ set(COMPILER_RT_SUPPORTED_ARCH)
 # runtime libraries supported by our current compilers cross-compiling
 # abilities.
 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} "#include <stdint.h>\nint main(void) { return 0; }\n")
----------------
compnerd wrote:

Shouldn't this be fine to leave as is? The builtins set `TEST_COMPILE_ONLY` which will use:
```c
#include <limits.h>
int foo(int x, int y) { return x + y; }
```
as the test code rather than this, which is still useful for the non-builtins code in the repository.

Could you share more about how this is problematic when building just the builtins?

https://github.com/llvm/llvm-project/pull/95234


More information about the llvm-commits mailing list