Commit 481de14f authored by Fangrui Song's avatar Fangrui Song Committed by Commit Bot

Drop shared objects' dependency on unversioned libdbus-1.so.3

Due to https://reviews.llvm.org/D80059, the Bug 751812 hack for
unversioned libdbus-1.so.3 symbols no longer works. This patch drops
dependent shared objects' dependency (DT_NEEDED) on libdbus-1.so.3 so
that LLD will not error. LLD does not error for undefined symbols
from a shared object if some dependencies are not input files.

Bug: 1086636
Change-Id: I7e8e3f935d96d534e94ad2ff905ace8cb56afdaa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2220362
Commit-Queue: Fangrui Song <maskray@google.com>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773297}
parent 503b46a1
......@@ -336,6 +336,20 @@ HacksAndPatchesCommon() {
cp "${SCRIPT_DIR}/libdbus-1-3-symbols" \
"${INSTALL_ROOT}/debian/libdbus-1-3/DEBIAN/symbols"
# Shared objects depending on libdbus-1.so.3 have unsatisfied undefined
# versioned symbols. To avoid LLD --no-allow-shlib-undefined errors, rewrite
# DT_NEEDED entries from libdbus-1.so.3 to a different string. LLD will
# suppress --no-allow-shlib-undefined diagnostics for such shared objects.
for f in "${INSTALL_ROOT}/lib/${arch}-${os}"/*.so; do
echo "$f" | grep -q 'libdbus-1.so$' && continue
# In a dependent shared object, the only occurrence of "libdbus-1.so.3" is
# the string referenced by the DT_NEEDED entry.
offset=$(LANG=C grep -abo libdbus-1.so.3 "$f")
[ -n "$offset" ] || continue
echo -n 'libdbus-1.so.0' | dd of="$f" conv=notrunc bs=1 \
seek="$(echo -n "$offset" | cut -d : -f 1)" status=none
done
# Glibc 2.27 introduced some new optimizations to several math functions, but
# it will be a while before it makes it into all supported distros. Luckily,
# glibc maintains ABI compatibility with previous versions, so the old symbols
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment