aboutsummaryrefslogtreecommitdiffstats
path: root/build/platform/lld/ya.make
diff options
context:
space:
mode:
authorprettyboy <prettyboy@yandex-team.com>2023-08-24 18:54:01 +0300
committerprettyboy <prettyboy@yandex-team.com>2023-08-24 19:22:14 +0300
commitdebbd0cf88b4d90e9d441bc68be455abd90d2b15 (patch)
tree0db4ab0db0e968d2663dfcf081cc744a00f0923c /build/platform/lld/ya.make
parent036e55c4182c5cc43a0b7e6af296d52cc5aa1d95 (diff)
downloadydb-debbd0cf88b4d90e9d441bc68be455abd90d2b15.tar.gz
[devtools/contrib/piglet/projects/ydb/config.yaml] Removed build/platform/ from denylists
Cостояние build/platform/ после реимпорта https://paste.yandex-team.ru/8b2b3daa-e68b-42c1-a136-94d8409f87ae/text
Diffstat (limited to 'build/platform/lld/ya.make')
-rw-r--r--build/platform/lld/ya.make68
1 files changed, 68 insertions, 0 deletions
diff --git a/build/platform/lld/ya.make b/build/platform/lld/ya.make
new file mode 100644
index 0000000000..2261239619
--- /dev/null
+++ b/build/platform/lld/ya.make
@@ -0,0 +1,68 @@
+RESOURCES_LIBRARY()
+
+LICENSE(Service-Prebuilt-Tool)
+
+DEFAULT(LLD_VERSION 14)
+
+IF (LLD_VERSION == 14)
+ DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(LLD_ROOT lld14.json)
+ELSEIF (LLD_VERSION == 16)
+ DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(LLD_ROOT lld16.json)
+ENDIF()
+
+IF (OS_ANDROID)
+ # Use LLD shipped with Android NDK.
+ LDFLAGS(
+ -fuse-ld=lld
+ )
+ IF (ANDROID_API < 29)
+ # Dynamic linker on Android does not support lld's default rosegment
+ # prior to API Level 29 (Android Q)
+ # See:
+ # https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#additional-required-arguments
+ # https://github.com/android/ndk/issues/1196
+ LDFLAGS(
+ -Wl,--no-rosegment
+ )
+ ENDIF()
+ # Enable optimized relocations format (e.g. .rela.dyn section) to reduce binary size
+ # See:
+ # https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#relr-and-relocation-packing
+ IF (ANDROID_API >= 30)
+ LDFLAGS(-Wl,--pack-dyn-relocs=android+relr)
+ ELSEIF (ANDROID_API >= 28)
+ LDFLAGS(-Wl,--pack-dyn-relocs=android+relr,--use-android-relr-tags)
+ ELSEIF (ANDROID_API >= 23)
+ LDFLAGS(-Wl,--pack-dyn-relocs=android)
+ ENDIF()
+ELSEIF (OS_LINUX)
+ LDFLAGS(
+ -fuse-ld=lld
+ --ld-path=${LLD_ROOT_RESOURCE_GLOBAL}/ld.lld
+
+ # dynlinker on auld ubuntu versions can not handle .rodata stored in standalone segment [citation needed]
+ -Wl,--no-rosegment
+ # add build-id to binaries to allow external tools check equality of binaries
+ -Wl,--build-id=sha1
+ )
+ELSEIF (OS_DARWIN OR OS_IOS)
+ IF (MAPSMOBI_BUILD_TARGET AND XCODE)
+ LDFLAGS(
+ -fuse-ld=${LLD_ROOT_RESOURCE_GLOBAL}/ld64.lld
+ )
+ ELSE()
+ LDFLAGS(
+ -fuse-ld=lld
+ --ld-path=${LLD_ROOT_RESOURCE_GLOBAL}/ld64.lld
+ # FIXME: Remove fake linker version flag when clang 16 version arrives
+ -mlinker-version=705
+ )
+ ENDIF()
+ELSEIF (OS_EMSCRIPTEN)
+ LDFLAGS(
+ -fuse-ld=${LLD_ROOT_RESOURCE_GLOBAL}/wasm-ld
+ # FIXME: Linker does not capture "ld-path" and therefore it can not find "wasm-ld"
+ )
+ENDIF()
+
+END()