Skip to content

Commit 8543b7b

Browse files
Merge pull request #61729 from tensorflow/r2.13-d14bacc5503
r2.13 cherry-pick: d14bacc "Upgrade patchelf to v0.18.0 to fix certain TF shared libaries having corrupted PT_NOTE program headers."
2 parents 2cb8ee3 + 1d55ad5 commit 8543b7b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tensorflow/tools/tf_sig_build_dockerfiles/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,18 @@ RUN /setup.sources.sh && /setup.packages.sh /devel.packages.txt && /setup.cuda.s
3434
# - buildifier: clean bazel build deps
3535
# - buildozer: clean bazel build deps
3636
# - gcloud SDK: communicate with Google Cloud Platform (GCP) for RBE, CI
37+
# - patchelf: Utility tool to modify existing ELF executables and libraries
3738
RUN git clone --branch v1.7.0 https://github.com/bats-core/bats-core.git && bats-core/install.sh /usr/local && rm -rf bats-core
3839
RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64 -O /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel
3940
RUN wget https://github.com/bazelbuild/buildtools/releases/download/3.5.0/buildifier -O /usr/local/bin/buildifier && chmod +x /usr/local/bin/buildifier
4041
RUN wget https://github.com/bazelbuild/buildtools/releases/download/3.5.0/buildozer -O /usr/local/bin/buildozer && chmod +x /usr/local/bin/buildozer
4142
RUN curl -sSL https://sdk.cloud.google.com > /tmp/gcloud && bash /tmp/gcloud --install-dir=~/usr/local/bin --disable-prompts
42-
43+
# Download and install patchelf v0.18.0 from GitHub. The default Ubuntu focal
44+
# packages only provide the "0.10-2build1" version. We use patchelf to manipulate
45+
# certain shared libraries during the wheel building process (https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/pip_package/build_pip_package.sh#L255-L262).
46+
# When we use Patchelf versions <0.12, those shared libraries end up with a
47+
# corrupted PT_NOTE program header. This was fixed in v0.12, see https://github.com/NixOS/patchelf/commit/43a33482b501b0f5ee9da312aabfca3806570cc9.
48+
RUN wget https://github.com/NixOS/patchelf/releases/download/0.18.0/patchelf-0.18.0-x86_64.tar.gz && tar -zxvf patchelf-0.18.0-x86_64.tar.gz -C /usr && rm -rf patchelf-0.18.0-x86_64.tar.gz
4349

4450
# All lines past this point are reset when $CACHEBUSTER is set. We need this
4551
# for Python specifically because we install some nightly packages which are

tensorflow/tools/tf_sig_build_dockerfiles/devel.packages.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ mlocate
4848
moreutils
4949
openjdk-11-jdk
5050
openjdk-11-jre-headless
51-
patchelf
5251
pkg-config
5352
python3-dev
5453
python3-setuptools

0 commit comments

Comments
 (0)