Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 43 additions & 19 deletions 0001-Support-musllinux-armv6l.patch
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
From 1c9bba7af44d2465d3657f7a63f8a0ffdca3239b Mon Sep 17 00:00:00 2001
From 523ad69294a1190812e63fb78ff94c8f5359011f Mon Sep 17 00:00:00 2001
From: Pascal Vizeli <pvizeli@syshack.ch>
Date: Wed, 15 Jun 2022 12:48:56 +0000
Subject: [PATCH] Support musllinux armv6l

---
src/auditwheel/policy/__init__.py | 1 +
src/auditwheel/policy/musllinux-policy.json | 4 ++++
2 files changed, 5 insertions(+)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>

diff --git a/src/auditwheel/architecture.py b/src/auditwheel/architecture.py
index 4a506e8..f0c39d6 100644
--- a/src/auditwheel/architecture.py
+++ b/src/auditwheel/architecture.py
@@ -11,6 +11,7 @@ class Architecture(Enum):
value: str

aarch64 = "aarch64"
+ armv6l = "armv6l"
armv7l = "armv7l"
i686 = "i686"
loongarch64 = "loongarch64"
diff --git a/src/auditwheel/policy/__init__.py b/src/auditwheel/policy/__init__.py
index f38ab43..8ed9db8 100644
index 29a743c..36c9ba2 100644
--- a/src/auditwheel/policy/__init__.py
+++ b/src/auditwheel/policy/__init__.py
@@ -285,6 +285,7 @@ def _fixup_musl_libc_soname(libc: Libc, arch: str, whitelist):
"aarch64": "libc.musl-aarch64.so.1",
"s390x": "libc.musl-s390x.so.1",
"ppc64le": "libc.musl-ppc64le.so.1",
+ "armv6l": "libc.musl-armvhf.so.1",
"armv7l": "libc.musl-armv7.so.1",
"riscv64": "libc.musl-riscv64.so.1",
}
@@ -295,6 +295,7 @@ def _fixup_musl_libc_soname(
Architecture.aarch64: "libc.musl-aarch64.so.1",
Architecture.s390x: "libc.musl-s390x.so.1",
Architecture.ppc64le: "libc.musl-ppc64le.so.1",
+ Architecture.armv6l: "libc.musl-armhf.so.1",
Comment on lines -19 to +28
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note the libc filename is actually libc.musl-armhf.so.1 (without the v). See https://pkgs.alpinelinux.org/contents?name=musl&repo=main&branch=v3.22&arch=armhf

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Uh I see, nice find! Shouldn't this have caused issues for armv6l builds? 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No. It's just that libc won't be whitelisted anymore and thus always copied into the wheel. I.e. with this fix the new wheels for armv6 will probably be noticeable smaller.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah I see, nice!

Architecture.armv7l: "libc.musl-armv7.so.1",
Architecture.riscv64: "libc.musl-riscv64.so.1",
Architecture.loongarch64: "libc.musl-loongarch64.so.1",
diff --git a/src/auditwheel/policy/musllinux-policy.json b/src/auditwheel/policy/musllinux-policy.json
index f2f6a06..c02436e 100644
index a55e5fb..2584904 100644
--- a/src/auditwheel/policy/musllinux-policy.json
+++ b/src/auditwheel/policy/musllinux-policy.json
@@ -20,6 +20,8 @@
Expand All @@ -42,7 +51,22 @@ index f2f6a06..c02436e 100644
"armv7l": {
},
"riscv64": {

base-commit: 7d50cf2e4ba1d46ec9ac361661e563fea84c6eca
--
2.45.2
diff --git a/src/auditwheel/wheel_abi.py b/src/auditwheel/wheel_abi.py
index 0e51ce5..7a4caed 100644
--- a/src/auditwheel/wheel_abi.py
+++ b/src/auditwheel/wheel_abi.py
@@ -98,7 +98,13 @@ def get_wheel_elfdata(
if architecture is None:
log.info("setting architecture to %s", elf_arch.value)
architecture = elf_arch
- elif elf_arch != architecture.baseline:
+ elif (
+ elf_arch != architecture.baseline
+ and not (
+ architecture.baseline == Architecture.armv6l
+ and elf_arch == Architecture.armv7l
+ )
+ ):
shared_libraries_with_invalid_machine.append(so_name)
log.warning("ignoring: %s with %s architecture", so_name, elf_arch)
continue
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG \
BUILD_ARCH \
CPYTHON_ABI \
QEMU_CPU \
AUDITWHEEL_VERSION=6.2.0 \
AUDITWHEEL_VERSION=6.4.2 \
PIP_EXTRA_INDEX_URL=https://wheels.home-assistant.io/musllinux-index/

WORKDIR /usr/src
Expand Down