[libc][NFC] Merge llvmlibc and llvmlibm targets in to a single target.

The single target is called llvmlibc. We can add back smaller libm and
other targets in future if required.
This commit is contained in:
Siva Chandra Reddy 2021-02-23 21:19:05 -08:00
parent 9a9d56eb3e
commit 8d4ac5337f
5 changed files with 41 additions and 37 deletions

View File

@ -70,7 +70,7 @@ include("${LIBC_SOURCE_DIR}/config/${LIBC_TARGET_OS}/${LIBC_TARGET_MACHINE}/entr
include("${LIBC_SOURCE_DIR}/config/${LIBC_TARGET_OS}/${LIBC_TARGET_MACHINE}/headers.txt")
set(TARGET_ENTRYPOINT_NAME_LIST "")
foreach(entrypoint IN LISTS TARGET_LIBC_ENTRYPOINTS TARGET_LIBM_ENTRYPOINTS)
foreach(entrypoint IN LISTS TARGET_LLVMLIBC_ENTRYPOINTS)
string(FIND ${entrypoint} "." last_dot_loc REVERSE)
if(${last_dot_loc} EQUAL -1)
message(FATAL "Invalid entrypoint target name ${entrypoint}; Expected a '.' "

View File

@ -20,19 +20,6 @@ set(TARGET_LIBC_ENTRYPOINTS
# errno.h entrypoints
libc.src.errno.__errno_location
# fenv.h entrypoints
libc.src.fenv.feclearexcept
libc.src.fenv.fegetenv
libc.src.fenv.fegetexceptflag
libc.src.fenv.fegetround
libc.src.fenv.feholdexcept
libc.src.fenv.fesetenv
libc.src.fenv.fesetexceptflag
libc.src.fenv.fesetround
libc.src.fenv.feraiseexcept
libc.src.fenv.fetestexcept
libc.src.fenv.feupdateenv
# stdlib.h entrypoints
libc.src.stdlib.abs
libc.src.stdlib.labs
@ -62,6 +49,19 @@ set(TARGET_LIBC_ENTRYPOINTS
)
set(TARGET_LIBM_ENTRYPOINTS
# fenv.h entrypoints
libc.src.fenv.feclearexcept
libc.src.fenv.fegetenv
libc.src.fenv.fegetexceptflag
libc.src.fenv.fegetround
libc.src.fenv.feholdexcept
libc.src.fenv.fesetenv
libc.src.fenv.fesetexceptflag
libc.src.fenv.fesetround
libc.src.fenv.feraiseexcept
libc.src.fenv.fetestexcept
libc.src.fenv.feupdateenv
# math.h entrypoints
libc.src.math.copysign
libc.src.math.copysignf
@ -144,3 +144,8 @@ set(TARGET_LIBM_ENTRYPOINTS
libc.src.math.truncf
libc.src.math.truncl
)
set(TARGET_LLVMLIBC_ENTRYPOINTS
${TARGET_LIBC_ENTRYPOINTS}
${TARGET_LIBM_ENTRYPOINTS}
)

View File

@ -23,19 +23,6 @@ set(TARGET_LIBC_ENTRYPOINTS
# errno.h entrypoints
libc.src.errno.__errno_location
# fenv.h entrypoints
libc.src.fenv.feclearexcept
libc.src.fenv.fegetenv
libc.src.fenv.fegetexceptflag
libc.src.fenv.fegetround
libc.src.fenv.feholdexcept
libc.src.fenv.fesetenv
libc.src.fenv.fesetexceptflag
libc.src.fenv.fesetround
libc.src.fenv.feraiseexcept
libc.src.fenv.fetestexcept
libc.src.fenv.feupdateenv
# signal.h entrypoints
libc.src.signal.raise
libc.src.signal.sigaction
@ -96,6 +83,19 @@ set(TARGET_LIBC_ENTRYPOINTS
)
set(TARGET_LIBM_ENTRYPOINTS
# fenv.h entrypoints
libc.src.fenv.feclearexcept
libc.src.fenv.fegetenv
libc.src.fenv.fegetexceptflag
libc.src.fenv.fegetround
libc.src.fenv.feholdexcept
libc.src.fenv.fesetenv
libc.src.fenv.fesetexceptflag
libc.src.fenv.fesetround
libc.src.fenv.feraiseexcept
libc.src.fenv.fetestexcept
libc.src.fenv.feupdateenv
# math.h entrypoints
libc.src.math.copysign
libc.src.math.copysignf
@ -178,3 +178,8 @@ set(TARGET_LIBM_ENTRYPOINTS
libc.src.math.truncf
libc.src.math.truncl
)
set(TARGET_LLVMLIBC_ENTRYPOINTS
${TARGET_LIBC_ENTRYPOINTS}
${TARGET_LIBM_ENTRYPOINTS}
)

View File

@ -1,11 +1,5 @@
add_entrypoint_library(
llvmlibc
DEPENDS
${TARGET_LIBC_ENTRYPOINTS}
)
add_entrypoint_library(
llvmlibm
DEPENDS
${TARGET_LIBM_ENTRYPOINTS}
${TARGET_LLVMLIBC_ENTRYPOINTS}
)

View File

@ -15,7 +15,7 @@ add_subdirectory(unistd)
set(public_test ${CMAKE_CURRENT_BINARY_DIR}/public_integration_test.cpp)
set(entrypoints_name_list "")
foreach(entry IN LISTS TARGET_LIBC_ENTRYPOINTS TARGET_LIBM_ENTRYPOINTS)
foreach(entry IN LISTS TARGET_LLVMLIBC_ENTRYPOINTS)
get_target_property(entry_name ${entry} "ENTRYPOINT_NAME")
list(APPEND entrypoints_name_list ${entry_name})
endforeach()
@ -36,7 +36,7 @@ add_custom_command(
DEPENDS ${LIBC_SOURCE_DIR}/config/${LIBC_TARGET_OS}/api.td ${spec_files}
libc-prototype-testgen ${TARGET_PUBLIC_HEADERS}
llvmlibc llvmlibm
llvmlibc
)
add_executable(
@ -69,7 +69,7 @@ target_link_options(
PRIVATE "-nostdlib"
)
set(library_files)
foreach(library_name IN LISTS "llvmlibc;llvmlibm")
foreach(library_name IN LISTS "llvmlibc")
get_target_property(library_file ${library_name} "LIBRARY_FILE")
list(APPEND library_files ${library_file})
endforeach()