Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use armv7l policy for 64-bit arm kernel in 32-bit mode (armv8l) #419

Merged
merged 1 commit into from
Apr 24, 2023
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
9 changes: 6 additions & 3 deletions src/auditwheel/policy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ def get_arch_name() -> str:
machine = _platform_module.machine()
if sys.platform == "darwin" and machine == "arm64":
return "aarch64"
if machine not in {"x86_64", "i686"}:
return machine
return {64: "x86_64", 32: "i686"}[bits]
if machine in {"x86_64", "i686"}:
return {64: "x86_64", 32: "i686"}[bits]
if machine in {"aarch64", "armv8l"}:
# use armv7l policy for 64-bit arm kernel in 32-bit mode (armv8l)
return {64: "aarch64", 32: "armv7l"}[bits]
return machine


_ARCH_NAME = get_arch_name()
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/test_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
[
("armv6l", "armv6l"),
("armv7l", "armv7l"),
("armv8l", "armv7l"),
("aarch64", "armv7l"),
("i686", "i686"),
("x86_64", "i686"),
],
Expand All @@ -35,8 +37,10 @@ def test_32bits_arch_name(machine_mock, reported_arch, expected_arch):
@pytest.mark.parametrize(
"reported_arch,expected_arch",
[
("armv8l", "aarch64"),
("aarch64", "aarch64"),
("ppc64le", "ppc64le"),
("i686", "x86_64"),
("x86_64", "x86_64"),
],
)
Expand Down