123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- LIBRARY()
- VERSION(Service-proxy-version)
- LICENSE(
- BSD-1-Clause AND
- BSD-2-Clause AND
- BSD-3-Clause AND
- ISC
- )
- LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
- NO_COMPILER_WARNINGS()
- NO_UTIL()
- NO_RUNTIME()
- IF (NOT OS_WINDOWS)
- SRCS(
- string.c
- )
- ENDIF()
- DISABLE(PROVIDE_GETRANDOM_GETENTROPY)
- DISABLE(PROVIDE_REALLOCARRAY)
- # Android libc function appearance is documented here:
- # https://android.googlesource.com/platform/bionic/+/master/docs/status.md
- #
- # NB: nested IF's are needed due to the lack of lazy evaluation of logical statements: DEVTOOLS-7837
- IF (OS_ANDROID)
- SRCS(
- strlcat.c
- strlcpy.c
- )
- IF (ANDROID_API < 28)
- SRCS(
- glob.c
- )
- ENABLE(PROVIDE_GETRANDOM_GETENTROPY)
- ENABLE(PROVIDE_REALLOCARRAY)
- ENDIF()
- IF (ANDROID_API < 24)
- SRCS(
- ifaddrs.c
- )
- ADDINCL(
- GLOBAL contrib/libs/libc_compat/include/ifaddrs
- )
- ENDIF()
- IF (ANDROID_API < 21)
- SRCS(
- stpcpy.c
- )
- ENDIF()
- ENDIF()
- IF (OS_WINDOWS OR OS_DARWIN OR OS_IOS)
- SRCS(
- memrchr.c
- )
- ENDIF()
- IF (OS_DARWIN)
- SRCS(
- explicit_bzero.c
- )
- ENABLE(PROVIDE_REALLOCARRAY)
- ENDIF()
- IF (OS_WINDOWS)
- ADDINCL(
- GLOBAL contrib/libs/libc_compat/include/windows
- )
- SRCS(
- explicit_bzero.c
- stpcpy.c
- strlcat.c
- strlcpy.c
- strcasestr.c
- strsep.c
- src/windows/sys/uio.c
- )
- ENABLE(PROVIDE_REALLOCARRAY)
- ENDIF()
- IF (OS_LINUX)
- ADDINCL(
- GLOBAL contrib/libs/libc_compat/include/readpassphrase
- )
- SRCS(
- readpassphrase.c
- )
- ENDIF()
- IF (OS_LINUX AND NOT MUSL)
- IF (OS_SDK == "ubuntu-12")
- ADDINCL(
- # uchar.h was introduced in glibc=2.16
- GLOBAL contrib/libs/libc_compat/include/uchar
- )
- ENDIF()
- IF (OS_SDK == "ubuntu-12" OR OS_SDK == "ubuntu-14" OR OS_SDK == "ubuntu-16")
- # getrandom and getentropy were added in glibc=2.25
- ENABLE(PROVIDE_GETRANDOM_GETENTROPY)
- SRCS(
- # explicit_bzero was added in glibc=2.25
- explicit_bzero.c
- # memfd_create was added in glibc=2.27
- memfd_create.c
- )
- ENDIF()
- IF (OS_SDK != "ubuntu-20" AND OS_SDK != "ubuntu-22")
- # reallocarray was added in glibc=2.29
- ENABLE(PROVIDE_REALLOCARRAY)
- ENDIF()
- SRCS(
- # glibc does not offer strlcat / strlcpy yet
- strlcat.c
- strlcpy.c
- )
- IF (SANITIZER_TYPE == "memory")
- # llvm sanitized runtime is missing an interceptor for a buggy (getservbyname{_r}).
- # See: https://github.com/google/sanitizers/issues/1138
- ENABLE(PROVIDE_GETSERVBYNAME)
- ENDIF()
- ENDIF()
- IF (PROVIDE_REALLOCARRAY)
- SRCS(
- reallocarray/reallocarray.c
- )
- ADDINCL(
- GLOBAL contrib/libs/libc_compat/reallocarray
- )
- ENDIF()
- IF (PROVIDE_GETRANDOM_GETENTROPY)
- PEERDIR(
- library/cpp/sanitizer/include
- )
- SRCS(
- random/getrandom.c
- random/getentropy.c
- )
- ADDINCL(
- GLOBAL contrib/libs/libc_compat/random
- )
- ENDIF()
- IF (PROVIDE_GETSERVBYNAME)
- SRCS(
- getservbyname/getservbyname.c
- getservbyname/getservbyname_r.c
- getservbyname/lookup_serv.c
- )
- ENDIF()
- END()
|