[libc-commits] [libc] [libc] Disable `-ffreestanding` and `-fno-builtin` on the GPU build (PR #97636)

Matt Arsenault via libc-commits libc-commits at lists.llvm.org
Wed Jul 3 14:41:27 PDT 2024


================
@@ -60,7 +62,25 @@ function(_get_common_compile_options output_var flags)
       list(APPEND compile_options "-ffixed-point")
     endif()
 
-    list(APPEND compile_options "-fno-builtin")
+    # Builtin recognition causes issues when trying to implement the builtin
+    # functions themselves. The GPU backends do not use libcalls so we disable
+    # the known problematic ones. This allows inlining during LTO linking.
+    if(LIBC_TARGET_OS_IS_GPU)
+      list(APPEND compile_options "-fno-builtin-bcmp")
----------------
arsenm wrote:

The one list not embedded in the foreach line would be most readable 

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


More information about the libc-commits mailing list