From d8ce72127239048574784145b5b55df3595f88ff Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Wed, 17 Jul 2024 15:31:21 +0100 Subject: [PATCH] linux-armv6: upgrade to Debian 11 (glibc 2.31) Allows use of the standard crossbuild tooling --- npm/linux-arm/package.json | 2 +- platforms/linux-armv6/Dockerfile | 11 +++++------ platforms/linux-armv6/Toolchain.cmake | 10 +++++----- platforms/linux-armv6/meson.ini | 14 +++++++------- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/npm/linux-arm/package.json b/npm/linux-arm/package.json index b7d0ff2a..710c1e70 100644 --- a/npm/linux-arm/package.json +++ b/npm/linux-arm/package.json @@ -28,7 +28,7 @@ }, "type": "commonjs", "config": { - "glibc": ">=2.28" + "glibc": ">=2.31" }, "os": [ "linux" diff --git a/platforms/linux-armv6/Dockerfile b/platforms/linux-armv6/Dockerfile index 2ea91fec..3ac139fa 100644 --- a/platforms/linux-armv6/Dockerfile +++ b/platforms/linux-armv6/Dockerfile @@ -1,13 +1,13 @@ -FROM debian:buster +FROM debian:bullseye LABEL maintainer="Lovell Fuller " -# Create Debian 10 (glibc 2.28) container suitable for cross-compiling Linux ARMv6 binaries +# Create Debian 11 (glibc 2.31) container suitable for cross-compiling Linux ARMv6 binaries # Path settings ENV \ RUSTUP_HOME="/usr/local/rustup" \ CARGO_HOME="/usr/local/cargo" \ - PATH="/usr/local/cargo/bin:/root/tools/x64-gcc-6.5.0/arm-rpi-linux-gnueabihf/bin:$PATH" + PATH="/usr/local/cargo/bin:$PATH" # Build dependencies RUN \ @@ -19,6 +19,7 @@ RUN \ autoconf \ autopoint \ cmake \ + crossbuild-essential-armhf \ gettext \ git \ gperf \ @@ -30,8 +31,6 @@ RUN \ python3-packaging \ python3-pip \ && \ - mkdir /root/tools && \ - curl -Ls https://github.com/rvagg/rpi-newer-crosstools/archive/master.tar.gz | tar xzC /root/tools --strip-components=1 && \ curl https://sh.rustup.rs -sSf | sh -s -- -y \ --no-modify-path \ --profile minimal \ @@ -44,7 +43,7 @@ RUN \ ENV \ PKG_CONFIG="arm-linux-gnueabihf-pkg-config --static" \ PLATFORM="linux-armv6" \ - CHOST="arm-rpi-linux-gnueabihf" \ + CHOST="arm-linux-gnueabihf" \ RUST_TARGET="arm-unknown-linux-gnueabihf" \ FLAGS="-marm -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard" \ WITHOUT_NEON="true" \ diff --git a/platforms/linux-armv6/Toolchain.cmake b/platforms/linux-armv6/Toolchain.cmake index 279e2990..3ec1bca1 100644 --- a/platforms/linux-armv6/Toolchain.cmake +++ b/platforms/linux-armv6/Toolchain.cmake @@ -2,11 +2,11 @@ set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_PROCESSOR armv6-a) -SET(CMAKE_C_COMPILER arm-rpi-linux-gnueabihf-gcc) -set(CMAKE_CXX_COMPILER arm-rpi-linux-gnueabihf-g++) -SET(CMAKE_AR arm-rpi-linux-gnueabihf-ar) -SET(CMAKE_STRIP arm-rpi-linux-gnueabihf-strip) -SET(CMAKE_RANLIB arm-rpi-linux-gnueabihf-ranlib) +SET(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) +set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) +SET(CMAKE_AR arm-linux-gnueabihf-ar) +SET(CMAKE_STRIP arm-linux-gnueabihf-strip) +SET(CMAKE_RANLIB arm-linux-gnueabihf-ranlib) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) diff --git a/platforms/linux-armv6/meson.ini b/platforms/linux-armv6/meson.ini index d06f2638..3920ebec 100644 --- a/platforms/linux-armv6/meson.ini +++ b/platforms/linux-armv6/meson.ini @@ -5,13 +5,13 @@ cpu = 'armv6-a' endian = 'little' [binaries] -c = 'arm-rpi-linux-gnueabihf-gcc' -cpp = 'arm-rpi-linux-gnueabihf-g++' -ar = 'arm-rpi-linux-gnueabihf-ar' -nm = 'arm-rpi-linux-gnueabihf-gcc-nm' -ld = 'arm-rpi-linux-gnueabihf-gcc-ld' -strip = 'arm-rpi-linux-gnueabihf-strip' -ranlib = 'arm-rpi-linux-gnueabihf-gcc-ranlib' +c = 'arm-linux-gnueabihf-gcc' +cpp = 'arm-linux-gnueabihf-g++' +ar = 'arm-linux-gnueabihf-ar' +nm = 'arm-linux-gnueabihf-gcc-nm' +ld = 'arm-linux-gnueabihf-gcc-ld' +strip = 'arm-linux-gnueabihf-strip' +ranlib = 'arm-linux-gnueabihf-gcc-ranlib' [built-in options] libdir = 'lib'