Skip to content

Fix cross-compiling by using CMAKE_SYSTEM_PROCESSOR and respecting -march|-mcpu - #904

Merged
Coldwings merged 2 commits into
alibaba:mainfrom
chewi:cross
Jul 30, 2025
Merged

Fix cross-compiling by using CMAKE_SYSTEM_PROCESSOR and respecting -march|-mcpu#904
Coldwings merged 2 commits into
alibaba:mainfrom
chewi:cross

Conversation

@chewi

@chewi chewi commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

There is no need to check the architecture twice. Also check for arm64 (MacOS) wherever we check for aarch64 (Linux).

Packagers may specify a target system up front, which should be respected. The CRC extensions are not strictly necessary as there is a software fallback.

Otherwise, use -mcpu=native if it works (it won't when cross-compiling) or -mcpu=generic+crc.

chewi added 2 commits July 28, 2025 10:23
There is no need to check the architecture twice. Also check for arm64
(MacOS) wherever we check for aarch64 (Linux).

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Packagers may specify a target system up front, which should be
respected. The CRC extensions are not strictly necessary as there is a
software fallback.

Otherwise, use -mcpu=native if it works (it won't when cross-compiling)
or -mcpu=generic+crc.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
@CLAassistant

CLAassistant commented Jul 28, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@lihuiba

lihuiba commented Jul 29, 2025

Copy link
Copy Markdown
Collaborator

Thanks for your contribution. Please sign the CLA.

@Coldwings

Copy link
Copy Markdown
Collaborator

Thanks for the contribute. We do should considering when -mcpu=native not working. Seems this PR is a much better solution.

We are looking forward to merge it, still, need you to signing the CLA.

@chewi

chewi commented Jul 29, 2025

Copy link
Copy Markdown
Contributor Author

I have signed the CLA through GitHub and sent the signed PDF by email.

@beef9999 beef9999 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Coldwings
Coldwings merged commit 4d69cca into alibaba:main Jul 30, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants