Skip to content

Commit 772cb84

Browse files
authored
[libc][NFC] Remove unused add_redirector_object and add_redirector_library in cmake. (#156485)
1 parent f0c8198 commit 772cb84

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

libc/cmake/modules/LLVMLibCLibraryRules.cmake

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -151,35 +151,6 @@ function(add_entrypoint_library target_name)
151151
set_target_properties(${target_name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${LIBC_LIBRARY_DIR})
152152
endfunction(add_entrypoint_library)
153153

154-
# Rule to build a shared library of redirector objects.
155-
function(add_redirector_library target_name)
156-
cmake_parse_arguments(
157-
"REDIRECTOR_LIBRARY"
158-
""
159-
""
160-
"DEPENDS"
161-
${ARGN}
162-
)
163-
164-
set(obj_files "")
165-
foreach(dep IN LISTS REDIRECTOR_LIBRARY_DEPENDS)
166-
# TODO: Ensure that each dep is actually a add_redirector_object target.
167-
list(APPEND obj_files $<TARGET_OBJECTS:${dep}>)
168-
endforeach(dep)
169-
170-
# TODO: Call the linker explicitly instead of calling the compiler driver to
171-
# prevent DT_NEEDED on C++ runtime.
172-
add_library(
173-
${target_name}
174-
EXCLUDE_FROM_ALL
175-
SHARED
176-
${obj_files}
177-
)
178-
set_target_properties(${target_name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${LIBC_LIBRARY_DIR})
179-
target_link_libraries(${target_name} -nostdlib -lc -lm)
180-
set_target_properties(${target_name} PROPERTIES LINKER_LANGUAGE "C")
181-
endfunction(add_redirector_library)
182-
183154
set(HDR_LIBRARY_TARGET_TYPE "HDR_LIBRARY")
184155

185156
# Internal function, used by `add_header_library`.

libc/cmake/modules/LLVMLibCObjectRules.cmake

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -470,31 +470,6 @@ function(add_entrypoint_external target_name)
470470

471471
endfunction(add_entrypoint_external)
472472

473-
# Rule build a redirector object file.
474-
function(add_redirector_object target_name)
475-
cmake_parse_arguments(
476-
"REDIRECTOR_OBJECT"
477-
"" # No optional arguments
478-
"SRC" # The cpp file in which the redirector is defined.
479-
"" # No multivalue arguments
480-
${ARGN}
481-
)
482-
if(NOT REDIRECTOR_OBJECT_SRC)
483-
message(FATAL_ERROR "'add_redirector_object' rule requires SRC option listing one source file.")
484-
endif()
485-
486-
add_library(
487-
${target_name}
488-
EXCLUDE_FROM_ALL
489-
OBJECT
490-
${REDIRECTOR_OBJECT_SRC}
491-
)
492-
target_compile_options(
493-
${target_name}
494-
BEFORE PRIVATE -fPIC ${LIBC_COMPILE_OPTIONS_DEFAULT}
495-
)
496-
endfunction(add_redirector_object)
497-
498473
# Helper to define a function with multiple implementations
499474
# - Computes flags to satisfy required/rejected features and arch,
500475
# - Declares an entry point,

0 commit comments

Comments
 (0)