Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions libc/cmake/modules/LLVMLibCLibraryRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
25 changes: 0 additions & 25 deletions libc/cmake/modules/LLVMLibCObjectRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading