ya.make 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. LIBRARY()
  2. VERSION(Service-proxy-version)
  3. LICENSE(
  4. BSD-1-Clause AND
  5. BSD-2-Clause AND
  6. BSD-3-Clause AND
  7. ISC
  8. )
  9. LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
  10. NO_COMPILER_WARNINGS()
  11. NO_UTIL()
  12. NO_RUNTIME()
  13. IF (NOT OS_WINDOWS)
  14. SRCS(
  15. string.c
  16. )
  17. ENDIF()
  18. DISABLE(PROVIDE_GETRANDOM_GETENTROPY)
  19. DISABLE(PROVIDE_REALLOCARRAY)
  20. # Android libc function appearance is documented here:
  21. # https://android.googlesource.com/platform/bionic/+/master/docs/status.md
  22. #
  23. # NB: nested IF's are needed due to the lack of lazy evaluation of logical statements: DEVTOOLS-7837
  24. IF (OS_ANDROID)
  25. SRCS(
  26. strlcat.c
  27. strlcpy.c
  28. )
  29. IF (ANDROID_API < 28)
  30. SRCS(
  31. glob.c
  32. )
  33. ENABLE(PROVIDE_GETRANDOM_GETENTROPY)
  34. ENABLE(PROVIDE_REALLOCARRAY)
  35. ENDIF()
  36. IF (ANDROID_API < 24)
  37. SRCS(
  38. ifaddrs.c
  39. )
  40. ADDINCL(
  41. GLOBAL contrib/libs/libc_compat/include/ifaddrs
  42. )
  43. ENDIF()
  44. IF (ANDROID_API < 21)
  45. SRCS(
  46. stpcpy.c
  47. )
  48. ENDIF()
  49. ENDIF()
  50. IF (OS_WINDOWS OR OS_DARWIN OR OS_IOS)
  51. SRCS(
  52. memrchr.c
  53. )
  54. ENDIF()
  55. IF (OS_DARWIN)
  56. SRCS(
  57. explicit_bzero.c
  58. )
  59. ENABLE(PROVIDE_REALLOCARRAY)
  60. ENDIF()
  61. IF (OS_WINDOWS)
  62. ADDINCL(
  63. GLOBAL contrib/libs/libc_compat/include/windows
  64. )
  65. SRCS(
  66. explicit_bzero.c
  67. stpcpy.c
  68. strlcat.c
  69. strlcpy.c
  70. strcasestr.c
  71. strsep.c
  72. src/windows/sys/uio.c
  73. )
  74. ENABLE(PROVIDE_REALLOCARRAY)
  75. ENDIF()
  76. IF (OS_LINUX)
  77. ADDINCL(
  78. GLOBAL contrib/libs/libc_compat/include/readpassphrase
  79. )
  80. SRCS(
  81. readpassphrase.c
  82. )
  83. ENDIF()
  84. IF (OS_LINUX AND NOT MUSL)
  85. IF (OS_SDK == "ubuntu-12")
  86. ADDINCL(
  87. # uchar.h was introduced in glibc=2.16
  88. GLOBAL contrib/libs/libc_compat/include/uchar
  89. )
  90. ENDIF()
  91. IF (OS_SDK == "ubuntu-12" OR OS_SDK == "ubuntu-14" OR OS_SDK == "ubuntu-16")
  92. # getrandom and getentropy were added in glibc=2.25
  93. ENABLE(PROVIDE_GETRANDOM_GETENTROPY)
  94. SRCS(
  95. # explicit_bzero was added in glibc=2.25
  96. explicit_bzero.c
  97. # memfd_create was added in glibc=2.27
  98. memfd_create.c
  99. )
  100. ENDIF()
  101. IF (OS_SDK != "ubuntu-20" AND OS_SDK != "ubuntu-22")
  102. # reallocarray was added in glibc=2.29
  103. ENABLE(PROVIDE_REALLOCARRAY)
  104. ENDIF()
  105. SRCS(
  106. # glibc does not offer strlcat / strlcpy yet
  107. strlcat.c
  108. strlcpy.c
  109. )
  110. IF (SANITIZER_TYPE == "memory")
  111. # llvm sanitized runtime is missing an interceptor for a buggy (getservbyname{_r}).
  112. # See: https://github.com/google/sanitizers/issues/1138
  113. ENABLE(PROVIDE_GETSERVBYNAME)
  114. ENDIF()
  115. ENDIF()
  116. IF (PROVIDE_REALLOCARRAY)
  117. SRCS(
  118. reallocarray/reallocarray.c
  119. )
  120. ADDINCL(
  121. GLOBAL contrib/libs/libc_compat/reallocarray
  122. )
  123. ENDIF()
  124. IF (PROVIDE_GETRANDOM_GETENTROPY)
  125. PEERDIR(
  126. library/cpp/sanitizer/include
  127. )
  128. SRCS(
  129. random/getrandom.c
  130. random/getentropy.c
  131. )
  132. ADDINCL(
  133. GLOBAL contrib/libs/libc_compat/random
  134. )
  135. ENDIF()
  136. IF (PROVIDE_GETSERVBYNAME)
  137. SRCS(
  138. getservbyname/getservbyname.c
  139. getservbyname/getservbyname_r.c
  140. getservbyname/lookup_serv.c
  141. )
  142. ENDIF()
  143. END()