aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhiddenpath <hiddenpath@yandex-team.com>2024-08-22 08:17:13 +0300
committerhiddenpath <hiddenpath@yandex-team.com>2024-08-22 08:31:10 +0300
commit09b7cd61fa6d98c03d6612f2130641e209f61a06 (patch)
tree2e82dc4b7d26e3aa4949c35e2481c039d6ded689
parente4b45ffc2b85a1133d737279e39d5b64a1548bad (diff)
downloadydb-09b7cd61fa6d98c03d6612f2130641e209f61a06.tar.gz
Enable fix-elf only with _FIX_ELF flag
f1b4ab8d00e0ac2175f0ea34a0353ce2963549b7
-rw-r--r--build/scripts/link_dyn_lib.py11
-rw-r--r--build/ymake.core.conf6
2 files changed, 17 insertions, 0 deletions
diff --git a/build/scripts/link_dyn_lib.py b/build/scripts/link_dyn_lib.py
index 98b5f86e98..72937544b6 100644
--- a/build/scripts/link_dyn_lib.py
+++ b/build/scripts/link_dyn_lib.py
@@ -212,6 +212,7 @@ def parse_args():
parser.add_option('--soname')
parser.add_option('--source-root')
parser.add_option('--build-root')
+ parser.add_option('--fix-elf')
parser.add_option('--linker-output')
parser.add_option('--musl', action='store_true')
parser.add_option('--dynamic-cuda', action='store_true')
@@ -267,6 +268,16 @@ if __name__ == '__main__':
print >> sys.stderr, 'linker command:', shlex_join(cmd)
sys.exit(proc.returncode)
+ if opts.fix_elf:
+ cmd = [opts.fix_elf, opts.target]
+ proc = subprocess.Popen(cmd, shell=False, stderr=sys.stderr, stdout=sys.stdout)
+ proc.communicate()
+
+ if proc.returncode:
+ print >> sys.stderr, 'fix_elf has failed with retcode:', proc.returncode
+ print >> sys.stderr, 'fix_elf command:', shlex_join(cmd)
+ sys.exit(proc.returncode)
+
if opts.soname and opts.soname != opts.target:
if os.path.exists(opts.soname):
os.unlink(opts.soname)
diff --git a/build/ymake.core.conf b/build/ymake.core.conf
index 6d637f7d21..049e18e38a 100644
--- a/build/ymake.core.conf
+++ b/build/ymake.core.conf
@@ -2122,6 +2122,12 @@ module DLL_UNIT: _LINK_UNIT {
}
}
+ when ($OS_LINUX == "yes" && $ARCH_X86_64 == "yes") {
+ when ($_FIX_ELF == "yes") {
+ LINK_DYN_LIB_FLAGS+=--fix-elf ${tool:"tools/fix_elf"}
+ }
+ }
+
when ($DARWIN == "yes") {
LDFLAGS += -undefined dynamic_lookup
}