[libc-commits] [libc] cec1de3 - [libc] Fix vendor implemented math functions not being exported (#65510)

via libc-commits libc-commits at lists.llvm.org
Wed Sep 6 12:43:27 PDT 2023


Author: Joseph Huber
Date: 2023-09-06T14:43:23-05:00
New Revision: cec1de3f3565997704dd16f490cdfa80cc59d239

URL: https://github.com/llvm/llvm-project/commit/cec1de3f3565997704dd16f490cdfa80cc59d239
DIFF: https://github.com/llvm/llvm-project/commit/cec1de3f3565997704dd16f490cdfa80cc59d239.diff

LOG: [libc] Fix vendor implemented math functions not being exported (#65510)

Summary:
A previous introduced a new object type for the GPU functions
implemented by an external vendor library. This was done so they we did
not attempt to run tests on functions which we did not implement,
however this accidentally stopped them from being included in the actual
output. Fix this by checking the new type as well.

The long term goal is to remove this vendor handling altogether, but is
being used as a short-term solution to provide a math library on the
GPU which currently lacks one.

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCLibraryRules.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCLibraryRules.cmake b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
index 3fe93e0e00b89d3..c2e5594a09fc321 100644
--- a/libc/cmake/modules/LLVMLibCLibraryRules.cmake
+++ b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
@@ -19,7 +19,8 @@ function(collect_object_file_deps target result)
     return()
   endif()
 
-  if(${target_type} STREQUAL ${ENTRYPOINT_OBJ_TARGET_TYPE})
+  if(${target_type} STREQUAL ${ENTRYPOINT_OBJ_TARGET_TYPE} OR
+     ${target_type} STREQUAL ${ENTRYPOINT_OBJ_VENDOR_TARGET_TYPE})
     set(entrypoint_target ${target})
     get_target_property(is_alias ${entrypoint_target} "IS_ALIAS")
     if(is_alias)
@@ -85,7 +86,8 @@ function(add_entrypoint_library target_name)
     list(APPEND all_deps ${recursive_deps})
     # Add the entrypoint object target explicitly as collect_object_file_deps
     # only collects object files from non-entrypoint targets.
-    if(${dep_type} STREQUAL ${ENTRYPOINT_OBJ_TARGET_TYPE})
+    if(${dep_type} STREQUAL ${ENTRYPOINT_OBJ_TARGET_TYPE} OR
+       ${dep_type} STREQUAL ${ENTRYPOINT_OBJ_VENDOR_TARGET_TYPE})
       set(entrypoint_target ${dep})
       get_target_property(is_alias ${entrypoint_target} "IS_ALIAS")
       if(is_alias)


        


More information about the libc-commits mailing list