Skip to content

zig dependents: fix CPU target for arm64 Linux #213589

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

Closed
wants to merge 10 commits into from
Closed

Conversation

carlocab
Copy link
Member

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

See #213501.

  • bold: fix CPU target for arm64 Linux
  • fancy-cat: fix CPU target for arm64 Linux
  • flow-control: fix CPU target for arm64 Linux
  • glyph: fix CPU target for arm64 Linux
  • hevi: fix CPU target for arm64 Linux
  • ncdu: fix CPU target for arm64 Linux
  • superhtml: fix CPU target for arm64 Linux
  • zigmod: fix CPU target for arm64 Linux
  • zigup: fix CPU target for arm64 Linux
  • zls: fix CPU target for arm64 Linux

@carlocab carlocab added CI-skip-dependents Pass --skip-dependents to brew test-bot. CI-no-bottles Merge without publishing bottles labels Mar 21, 2025
@github-actions github-actions bot added the zig Zig use is a significant feature of the PR or issue label Mar 21, 2025
cpu = case Hardware.oldest_cpu # See `zig targets`.
# Cortex A-53 seems to be the oldest available ARMv8-A processor.
# https://en.wikipedia.org/wiki/ARM_Cortex-A53
when :armv8 then "cortex_a53"
Copy link
Member

@cho-m cho-m Mar 21, 2025

Choose a reason for hiding this comment

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

Maybe one of the targets with only v8a less extensions would be more portable? I think the most minimal 64-bit aarch64 option is A-35.

EDIT: Updated to use correct section of zig target (aarch64)

            .cortex_a34 = .{
                "aes",
                "crc",
                "perfmon",
                "sha2",
                "v8a",
            },
            .cortex_a35 = .{
                "aes",
                "crc",
                "perfmon",
                "sha2",
                "v8a",
            },
            .cortex_a53 = .{
                "aes",
                "balance_fp_ops",
                "crc",
                "fuse_adrp_add",
                "fuse_aes",
                "perfmon",
                "sha2",
                "use_postra_scheduler",
                "v8a",
            },

Copy link
Member

@cho-m cho-m Mar 28, 2025

Choose a reason for hiding this comment

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

Looking at zig targets again, the most minimal option is X-Gene 1 which may be the only CPU without CRC (closest to -march=armv8-a):

            .xgene1 = .{
                "perfmon",
                "v8a",
            },

Not sure what chances of someone running this specific CPU is (old data center CPU). Would be okay with baseline target having at least CRC.

The next minimal are Cortex A34 and A35 which adds crc+aes+sha2 so could optimize up to -march=armv8-a+crc+aes+sha2

Ampere eMAG seems to be similar as it adds crc+crypto with latter being equivalent to aes+sha2

Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale No recent activity label Apr 19, 2025
@github-actions github-actions bot closed this Apr 26, 2025
@github-actions github-actions bot deleted the zig-dependents branch April 26, 2025 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-no-bottles Merge without publishing bottles CI-skip-dependents Pass --skip-dependents to brew test-bot. stale No recent activity zig Zig use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants