Skip to content

Commit d14bacc

Browse files
nitins17tensorflower-gardener
authored andcommitted
Upgrade patchelf to v0.18.0 to fix certain TF shared libaries having corrupted PT_NOTE program headers.
It seems that using Patchelf <0.12 during the [wheel building process](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/pip_package/build_pip_package.sh#L255-L262) corrupts the PT_NOTE program headers of certain shared libraries. Upgrading the patchelf version seems to fix this. We need to download the latest version from GitHub because the default Ubuntu Focal packages only provide the "0.10-2build1" version. PiperOrigin-RevId: 560754278
1 parent c88e17f commit d14bacc

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
@@ -47,7 +47,6 @@ mlocate
4747
moreutils
4848
openjdk-11-jdk
4949
openjdk-11-jre-headless
50-
patchelf
5150
pkg-config
5251
python3-dev
5352
python3-setuptools

0 commit comments

Comments
 (0)