Skip to content

Commit

Permalink
Build i386 binary
Browse files Browse the repository at this point in the history
Fixes #30
  • Loading branch information
krallin committed Jan 28, 2017
1 parent b837c03 commit 104cb5c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:
- CC=gcc ARCH_SUFFIX=amd64 ARCH_NATIVE=1 MINIMAL=
- CC=arm-linux-gnueabihf-gcc ARCH_SUFFIX=armhf ARCH_NATIVE= MINIMAL=
- CC=aarch64-linux-gnu-gcc ARCH_SUFFIX=arm64 ARCH_NATIVE= MINIMAL=
- CFLAGS="-m32" ARCH_SUFFIX=i386 ARCH_NATIVE=1
- CC=gcc ARCH_SUFFIX=amd64 ARCH_NATIVE=1 MINIMAL=1
global:
- SIGN_BINARIES=1
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM ubuntu:trusty

ARG ARCH_SUFFIX

COPY ci/install_deps.sh /install_deps.sh
RUN /install_deps.sh

Expand Down
22 changes: 18 additions & 4 deletions ci/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,25 @@ set -o nounset

apt-get update

apt-get install --no-install-recommends --yes \
DEPS=(
build-essential git gdb valgrind cmake rpm \
python-dev libcap-dev python-pip python-virtualenv \
hardening-includes gnupg \
gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu libc6-dev-arm64-cross \
gcc-arm-linux-gnueabihf binutils-arm-linux-gnueabi libc6-dev-armhf-cross
hardening-includes gnupg
)

if [[ "$ARCH_SUFFIX" = "amd64" ]]; then
true
elif [[ "$ARCH_SUFFIX" = "armhf" ]]; then
DEPS+=(gcc-arm-linux-gnueabihf binutils-arm-linux-gnueabi libc6-dev-armhf-cross)
elif [[ "$ARCH_SUFFIX" = "arm64" ]]; then
DEPS+=(gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu libc6-dev-arm64-cross)
elif [[ "$ARCH_SUFFIX" = "i386" ]]; then
DEPS+=(libc6-dev-i386 gcc-multilib)
else
echo "Unknown ARCH_SUFFIX=${ARCH_SUFFIX}"
exit 1
fi

apt-get install --no-install-recommends --yes "${DEPS[@]}"

rm -rf /var/lib/apt/lists/*
14 changes: 11 additions & 3 deletions ddist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@
set -o errexit
set -o nounset

if [[ "$#" != 1 ]]; then
echo "Usage: $0 ARCH_SUFFIX"
exit 1
fi

suffix="$1"

REL_HERE=$(dirname "${BASH_SOURCE}")
HERE=$(cd "${REL_HERE}"; pwd)

IMG="tini"
IMG="tini-build-${suffix}"
SRC="/tini"

# Cleanup the build dir
rm -f "${HERE}/dist"/*

# Create the build image
docker build -t "${IMG}" .
docker build --build-arg "ARCH_SUFFIX=${suffix}" -t "${IMG}" .

# Run test without subreaper support, don't copy build files here
docker run -it --rm \
Expand All @@ -22,7 +29,8 @@ docker run -it --rm \
-e FORCE_SUBREAPER="${FORCE_SUBREAPER:="1"}" \
-e GPG_PASSPHRASE="${GPG_PASSPHRASE:=}" \
-e CC="${CC:=gcc}" \
-e CFLAGS="${CFLAGS-}" \
-e ARCH_NATIVE="${ARCH_NATIVE-1}" \
-e ARCH_SUFFIX="${ARCH_SUFFIX-}" \
-e ARCH_SUFFIX="${suffix}" \
-e MINIMAL="${MINIMAL-}" \
"${IMG}" "${SRC}/ci/run_build.sh"

0 comments on commit 104cb5c

Please sign in to comment.