Issue building armv5te-linux-gnueapi with different glibc version #1152
-
I'm trying to build a cdylib for armv5te-linux-gnueapi with glibc 2.24. But the installed glibc version on the default cross docker image for that target is 2.28 making the resulting library incompatible with the target Maschine (update glibc is not possible). I have tried various methods like adding a symlink asm to set the maximum glibc version or created a pre-execution script that installs glibc 2.24 and sets the environment to use it. Without any luck. It is a hard requirement to be a dynamic library and musl does not support it. I'm not very familiar with either cross or docker. If you have any idea on how to get this working please help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
We've never supported anything under Ubuntu 18.04 for this target, but if you use Ubuntu 16.04, it comes with glibc 2.23 for the armel targets. Your Dockerfile then would be something like this: FROM ubuntu:16.04
ARG DEBIAN_FRONTEND=noninteractive
COPY common.sh lib.sh /
RUN /common.sh
COPY cmake.sh /
RUN /cmake.sh
COPY xargo.sh /
RUN /xargo.sh
RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
g++-arm-linux-gnueabi \
crossbuild-essential-armel \
libc6-dev-armel-cross
COPY deny-debian-packages.sh /
RUN TARGET_ARCH=armel /deny-debian-packages.sh \
binutils \
binutils-arm-linux-gnueabi
# Qemu is disabled since we've changed the scripts to require newer Python versions.
#COPY qemu.sh /
#RUN /qemu.sh arm
COPY qemu-runner base-runner.sh /
ENV CROSS_TOOLCHAIN_PREFIX=arm-linux-gnueabi-
ENV CROSS_SYSROOT=/usr/arm-linux-gnueabi
ENV CARGO_TARGET_ARMV5TE_UNKNOWN_LINUX_GNUEABI_LINKER="$CROSS_TOOLCHAIN_PREFIX"gcc \
CARGO_TARGET_ARMV5TE_UNKNOWN_LINUX_GNUEABI_RUNNER="/qemu-runner arm" \
AR_armv5te_unknown_linux_gnueabi="$CROSS_TOOLCHAIN_PREFIX"ar \
CC_armv5te_unknown_linux_gnueabi="$CROSS_TOOLCHAIN_PREFIX"gcc \
CXX_armv5te_unknown_linux_gnueabi="$CROSS_TOOLCHAIN_PREFIX"g++ \
BINDGEN_EXTRA_CLANG_ARGS_armv5te_unknown_linux_gnueabi="--sysroot=$CROSS_SYSROOT" \
QEMU_LD_PREFIX="$CROSS_SYSROOT" \
RUST_TEST_THREADS=1 \
PKG_CONFIG_PATH="/usr/lib/arm-linux-gnueabi/pkgconfig/:${PKG_CONFIG_PATH}" Save that file as export CROSS_TARGET_ARMV5TE_UNKNOWN_LINUX_GNUEABI_IMAGE=ghcr.io/cross-rs/armv5te-unknown-linux-gnueabi-cross:local
cross build --target armv5te-unknown-linux-gnueabi Note that you will need most of cross's build scripts, so it is highly recommended you use the above workflow with |
Beta Was this translation helpful? Give feedback.
We've never supported anything under Ubuntu 18.04 for this target, but if you use Ubuntu 16.04, it comes with glibc 2.23 for the armel targets. Your Dockerfile then would be something like this: