Skip to content

Fix check for .cfi_negate_ra_state on aarch64#18262

Merged
behlendorf merged 1 commit intoopenzfs:masterfrom
arter97:cfi-pseudo
Mar 6, 2026
Merged

Fix check for .cfi_negate_ra_state on aarch64#18262
behlendorf merged 1 commit intoopenzfs:masterfrom
arter97:cfi-pseudo

Conversation

@arter97
Copy link
Contributor

@arter97 arter97 commented Feb 25, 2026

Checking for LD_VERSION in unreliable as not all distros define it on the compiler's preprocessor.

Explicitly check it via autoconf.

This fixes support for Ubuntu 18.04 on arm64.

Motivation and Context

Previous compatibility fix 90ba19e is incomplete as not all distros define LD_VERSION.

Since the linker version is unavailable in preprocessor, the only reliable method is to detect it and control via macro as a compiler flag.

This fixes Ubuntu 18.04 compatibility on arm64.

Description

Removes unreliable LD_VERSION check and introduced a HAVE_AS_CFI_PSEUDO_OP flag on autoconf.

How Has This Been Tested?

Passes build on Ubuntu 18.04 - 26.04, armhf/arm64/amd64.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Copilot AI review requested due to automatic review settings February 25, 2026 15:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request improves the reliability of detecting assembler support for the .cfi_negate_ra_state CFI directive on AArch64 platforms by replacing an unreliable preprocessor check with proper autoconf feature detection.

Changes:

  • Replaces LD_VERSION preprocessor check with autoconf-based HAVE_AS_CFI_PSEUDO_OP macro
  • Adds new autoconf macro ZFS_AC_CONFIG_ALWAYS_TOOLCHAIN_CFI_PSEUDO_OP to detect assembler support at configure time
  • Updates comments in assembly files to better describe the feature check

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
module/icp/asm-aarch64/blake3/b3_aarch64_sse41.S Replaces LD_VERSION check with HAVE_AS_CFI_PSEUDO_OP macro and updates comment
module/icp/asm-aarch64/blake3/b3_aarch64_sse2.S Replaces LD_VERSION check with HAVE_AS_CFI_PSEUDO_OP macro and updates comment
config/zfs-build.m4 Integrates new CFI pseudo-op detection macro into configure flow
config/toolchain-simd.m4 Adds ZFS_AC_CONFIG_ALWAYS_TOOLCHAIN_CFI_PSEUDO_OP macro for detecting .cfi_negate_ra_state support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@behlendorf
Copy link
Contributor

@mcmilk @zxombie would you mind reviewing this followup to the build previous fix.

@arter97 there a minor checkstyle warning to fix as well.

error: commit message body contains line over 72 characters

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Mar 2, 2026
@lundman
Copy link
Contributor

lundman commented Mar 3, 2026

Not directly related to this, but in the same sort of arena, we had to do this recently:
openzfsonosx#61
more of a macOS quirk though.

@behlendorf
Copy link
Contributor

Oh interesting. Thanks for the heads up on those related CFI changes, even if they're at the moment a macOS thing.

Checking for LD_VERSION in unreliable as not all distros define it on
the compiler's preprocessor.

Explicitly check it via autoconf.

This fixes support for Ubuntu 18.04 on arm64.

Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
@arter97
Copy link
Contributor Author

arter97 commented Mar 6, 2026

Rebased to master with feedback applied.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Mar 6, 2026
@behlendorf behlendorf merged commit c58b8b7 into openzfs:master Mar 6, 2026
21 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Accepted Ready to integrate (reviewed, tested)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants