Skip to content

Commit

Permalink
linux-armv6: upgrade to Debian 11 (glibc 2.31)
Browse files Browse the repository at this point in the history
Allows use of the standard crossbuild tooling
  • Loading branch information
lovell committed Jul 17, 2024
1 parent 6651f42 commit d8ce721
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion npm/linux-arm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"type": "commonjs",
"config": {
"glibc": ">=2.28"
"glibc": ">=2.31"
},
"os": [
"linux"
Expand Down
11 changes: 5 additions & 6 deletions platforms/linux-armv6/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM debian:buster
FROM debian:bullseye
LABEL maintainer="Lovell Fuller <[email protected]>"

# 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 \
Expand All @@ -19,6 +19,7 @@ RUN \
autoconf \
autopoint \
cmake \
crossbuild-essential-armhf \
gettext \
git \
gperf \
Expand All @@ -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 \
Expand All @@ -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" \
Expand Down
10 changes: 5 additions & 5 deletions platforms/linux-armv6/Toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 7 additions & 7 deletions platforms/linux-armv6/meson.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

3 comments on commit d8ce721

@kleisauke
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://stackoverflow.com/a/50832243, Debian's cross-compiler emits Thumb code by default, which could be the reason for the segv in sharp's test suite.

@lovell
Copy link
Owner Author

@lovell lovell commented on d8ce721 Aug 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thank you, I've been investigating the failure and strongly suspected this commit was related.

I thought that the existing -mcpu setting would determine -march but maybe it's more like -mtune in that regard.

@lovell
Copy link
Owner Author

@lovell lovell commented on d8ce721 Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reverted this commit via fd99a03

Please sign in to comment.