Skip to content

Commit

Permalink
Merge gitian_linux32
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Nov 8, 2021
2 parents 32dd1d3 + eeea5b7 commit 95d7826
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion contrib/gitian-descriptors/gitian-linux.yml
Expand Up @@ -25,6 +25,9 @@ packages:
- "python3"
- "python3-pip"
# Cross compilation HOSTS:
# - i686-pc-linux-gnu
- "gcc-8-multilib"
- "g++-8-multilib"
# - arm-linux-gnueabihf
- "binutils-arm-linux-gnueabihf"
- "g++-8-arm-linux-gnueabihf"
Expand All @@ -48,7 +51,7 @@ script: |
set -e -o pipefail
WRAP_DIR=$HOME/wrapped
HOSTS="x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu powerpc64-linux-gnu powerpc64le-linux-gnu riscv64-linux-gnu"
HOSTS="i686-pc-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu powerpc64-linux-gnu powerpc64le-linux-gnu riscv64-linux-gnu"
CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests --disable-fuzz-binary"
FAKETIME_HOST_PROGS="gcc g++"
FAKETIME_PROGS="date ar ranlib nm"
Expand Down Expand Up @@ -97,6 +100,41 @@ script: |
fi
done
done
EXTRA_INCLUDES_BASE="${WRAP_DIR}/extra_includes"
mkdir -p "${EXTRA_INCLUDES_BASE}"
# x86 needs /usr/include/i386-pc-linux-gnu/asm pointed to /usr/include/x86_64-linux-gnu/asm,
# but we can't write there. Instead, create a link here and force it to be included in the
# search paths by wrapping gcc/g++.
mkdir -p "${EXTRA_INCLUDES_BASE}/i686-pc-linux-gnu"
rm -f "${WRAP_DIR}/extra_includes/i686-pc-linux-gnu/asm"
ln -s /usr/include/x86_64-linux-gnu/asm "${EXTRA_INCLUDES_BASE}/i686-pc-linux-gnu/asm"
for prog in gcc g++; do
rm -f "${WRAP_DIR}/${prog}"
cat <<EOF > "${WRAP_DIR}/${prog}"
#!/usr/bin/env bash
REAL="\$(which -a ${prog}-8 | grep -v ${WRAP_DIR}/${prog} | head -1)"
for var in "\$@"
do
if [ "\$var" = "-m32" ]; then
export C_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu"
export CPLUS_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu"
break
fi
done
export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'
export FAKETIME="$1"
exec "\$REAL" "\$@"
EOF
cat <<EOF > "${WRAP_DIR}/i686-pc-linux-gnu-${prog}"
#!/usr/bin/env bash
exec "${WRAP_DIR}/${prog}" -m32 "\$@"
EOF
chmod +x "${WRAP_DIR}/${prog}" "${WRAP_DIR}/i686-pc-linux-gnu-${prog}"
done
}
pip3 install lief==0.11.5
Expand Down

0 comments on commit 95d7826

Please sign in to comment.