File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ #
3+ # This script is called in a 32-bit build environment to install necessary
4+ # dependencies.
5+
6+ set -ex
7+
8+ # Work out if we need to install with sudo or not.
9+ if [[ $( id -u) -eq 0 ]]
10+ then
11+ # We are root, so we can install without sudo.
12+ echo " Running as root, no sudo required."
13+ export SUDO=" "
14+ else
15+ # We are not root, so we need to use sudo.
16+ echo " Running as non-root, using sudo."
17+ export SUDO=" sudo"
18+ fi
19+
20+ # Download dependencies for oss-fuzz
21+ $SUDO dpkg --add-architecture i386
22+ $SUDO apt-get -o Dpkg::Use-Pty=0 update
23+ $SUDO apt-get -o Dpkg::Use-Pty=0 install -y \
24+ protobuf-compiler:i386 \
25+ libprotobuf-dev:i386 \
26+ libstdc++-9-dev:i386
Original file line number Diff line number Diff line change @@ -31,6 +31,12 @@ export BUILD_ROOT; BUILD_ROOT=$(readlink -f "${SCRIPTDIR}/..")
3131# shellcheck source=stdlib_flag_utils.sh
3232source " ${SCRIPTDIR} /stdlib_flag_utils.sh"
3333
34+ # Install any 32-bit dependencies if building for 32-bit.
35+ if [[ " ${ARCHITECTURE:- } " == " i386" ]]
36+ then
37+ " ${SCRIPTDIR} /32bitdeps.sh"
38+ fi
39+
3440# Check for GDB-specific behaviour by checking for the GDBMODE flag.
3541# - Compile with -O0 so that DEBUGASSERTs can be debugged in gdb.
3642if [[ -n ${GDBMODE:- } ]]
You can’t perform that action at this time.
0 commit comments