Skip to content

Commit

Permalink
hermetic build: hermetic host tools
Browse files Browse the repository at this point in the history
Use the glibc prebuilt sysroot as sysroot for all host tools. In order
to use that, also add the prebuilt kernel tools (include, lib64) to
satisfy dependencies like openssl (via boringssl).

Bug: 135570712
Signed-off-by: Matthias Maennich <[email protected]>
Change-Id: I20bc005488b166b8363c17af9a602c66f7db6298
  • Loading branch information
metti committed Dec 7, 2020
1 parent 2526d9d commit ec2d611
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
12 changes: 12 additions & 0 deletions _setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@ if [ -n "${HERMETIC_TOOLCHAIN}" ]; then
# (e.g. debug info)
export KCPPFLAGS="-ffile-prefix-map=${ROOT_DIR}/="

# set the common sysroot
sysroot_flags+="--sysroot=${ROOT_DIR}/build/build-tools/sysroot "

# add openssl (via boringssl) and other prebuilts into the lookup path
cflags+="-I${ROOT_DIR}/prebuilts/kernel-build-tools/linux-x86/include "

# add openssl and further prebuilt libraries into the lookup path
ldflags+="-Wl,-rpath,${ROOT_DIR}/prebuilts/kernel-build-tools/linux-x86/lib64 "
ldflags+="-L ${ROOT_DIR}/prebuilts/kernel-build-tools/linux-x86/lib64 "

export HOSTCFLAGS="$sysroot_flags $cflags"
export HOSTLDFLAGS="$sysroot_flags $ldflags"
fi

for PREBUILT_BIN in "${PREBUILTS_PATHS[@]}"; do
Expand Down
1 change: 1 addition & 0 deletions build-tools/sysroot
2 changes: 0 additions & 2 deletions hermetic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ RUN apt-get -y update \
# Those are likely essential
git \
# To be removed
libc6-dev \
libssl-dev \
rsync \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
Expand Down

0 comments on commit ec2d611

Please sign in to comment.