[libc-commits] [libc] 772cb84 - [libc][NFC] Remove unused add_redirector_object and add_redirector_library in cmake. (#156485)
via libc-commits
libc-commits at lists.llvm.org
Tue Sep 2 10:08:20 PDT 2025
Author: lntue
Date: 2025-09-02T13:08:17-04:00
New Revision: 772cb84b9f03e1f630d237183acf37ba4c7a3bcf
URL: https://github.com/llvm/llvm-project/commit/772cb84b9f03e1f630d237183acf37ba4c7a3bcf
DIFF: https://github.com/llvm/llvm-project/commit/772cb84b9f03e1f630d237183acf37ba4c7a3bcf.diff
LOG: [libc][NFC] Remove unused add_redirector_object and add_redirector_library in cmake. (#156485)
Added:
Modified:
libc/cmake/modules/LLVMLibCLibraryRules.cmake
libc/cmake/modules/LLVMLibCObjectRules.cmake
Removed:
################################################################################
diff --git a/libc/cmake/modules/LLVMLibCLibraryRules.cmake b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
index b464c189420b7..80439de6bb4b0 100644
--- a/libc/cmake/modules/LLVMLibCLibraryRules.cmake
+++ b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
@@ -151,35 +151,6 @@ function(add_entrypoint_library target_name)
set_target_properties(${target_name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${LIBC_LIBRARY_DIR})
endfunction(add_entrypoint_library)
-# Rule to build a shared library of redirector objects.
-function(add_redirector_library target_name)
- cmake_parse_arguments(
- "REDIRECTOR_LIBRARY"
- ""
- ""
- "DEPENDS"
- ${ARGN}
- )
-
- set(obj_files "")
- foreach(dep IN LISTS REDIRECTOR_LIBRARY_DEPENDS)
- # TODO: Ensure that each dep is actually a add_redirector_object target.
- list(APPEND obj_files $<TARGET_OBJECTS:${dep}>)
- endforeach(dep)
-
- # TODO: Call the linker explicitly instead of calling the compiler driver to
- # prevent DT_NEEDED on C++ runtime.
- add_library(
- ${target_name}
- EXCLUDE_FROM_ALL
- SHARED
- ${obj_files}
- )
- set_target_properties(${target_name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${LIBC_LIBRARY_DIR})
- target_link_libraries(${target_name} -nostdlib -lc -lm)
- set_target_properties(${target_name} PROPERTIES LINKER_LANGUAGE "C")
-endfunction(add_redirector_library)
-
set(HDR_LIBRARY_TARGET_TYPE "HDR_LIBRARY")
# Internal function, used by `add_header_library`.
diff --git a/libc/cmake/modules/LLVMLibCObjectRules.cmake b/libc/cmake/modules/LLVMLibCObjectRules.cmake
index 030157bf64585..6c534dfccec10 100644
--- a/libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ b/libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -470,31 +470,6 @@ function(add_entrypoint_external target_name)
endfunction(add_entrypoint_external)
-# Rule build a redirector object file.
-function(add_redirector_object target_name)
- cmake_parse_arguments(
- "REDIRECTOR_OBJECT"
- "" # No optional arguments
- "SRC" # The cpp file in which the redirector is defined.
- "" # No multivalue arguments
- ${ARGN}
- )
- if(NOT REDIRECTOR_OBJECT_SRC)
- message(FATAL_ERROR "'add_redirector_object' rule requires SRC option listing one source file.")
- endif()
-
- add_library(
- ${target_name}
- EXCLUDE_FROM_ALL
- OBJECT
- ${REDIRECTOR_OBJECT_SRC}
- )
- target_compile_options(
- ${target_name}
- BEFORE PRIVATE -fPIC ${LIBC_COMPILE_OPTIONS_DEFAULT}
- )
-endfunction(add_redirector_object)
-
# Helper to define a function with multiple implementations
# - Computes flags to satisfy required/rejected features and arch,
# - Declares an entry point,
More information about the libc-commits
mailing list