Skip to content

Commit aed555b

Browse files
authored
Use armv7l policy for 64-bit arm kernel in 32-bit mode (armv8l) (#419)
1 parent 0dd24f0 commit aed555b

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/auditwheel/policy/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,12 @@ def get_arch_name() -> str:
2323
machine = _platform_module.machine()
2424
if sys.platform == "darwin" and machine == "arm64":
2525
return "aarch64"
26-
if machine not in {"x86_64", "i686"}:
27-
return machine
28-
return {64: "x86_64", 32: "i686"}[bits]
26+
if machine in {"x86_64", "i686"}:
27+
return {64: "x86_64", 32: "i686"}[bits]
28+
if machine in {"aarch64", "armv8l"}:
29+
# use armv7l policy for 64-bit arm kernel in 32-bit mode (armv8l)
30+
return {64: "aarch64", 32: "armv7l"}[bits]
31+
return machine
2932

3033

3134
_ARCH_NAME = get_arch_name()

tests/unit/test_policy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
[
2121
("armv6l", "armv6l"),
2222
("armv7l", "armv7l"),
23+
("armv8l", "armv7l"),
24+
("aarch64", "armv7l"),
2325
("i686", "i686"),
2426
("x86_64", "i686"),
2527
],
@@ -35,8 +37,10 @@ def test_32bits_arch_name(machine_mock, reported_arch, expected_arch):
3537
@pytest.mark.parametrize(
3638
"reported_arch,expected_arch",
3739
[
40+
("armv8l", "aarch64"),
3841
("aarch64", "aarch64"),
3942
("ppc64le", "ppc64le"),
43+
("i686", "x86_64"),
4044
("x86_64", "x86_64"),
4145
],
4246
)

0 commit comments

Comments
 (0)