Skip to content

Try to infer compiler for cross compilation automatically - #6160

Open
arckoor wants to merge 1 commit into
randombit:masterfrom
arckoor:infer-cross-compiler
Open

arckoor wants to merge 1 commit into
randombit:masterfrom
arckoor:infer-cross-compiler

Conversation

@arckoor

@arckoor arckoor commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #6142
Does its best for the "default case", i.e. (cross) building with standard gcc / clang for a gnu env.

For gcc it tries the typical <arch>-[unknown]-<sys>-gnu-g++ combo, the unknown because it's sometimes there, and sometimes not :D (e.g. for my local dev environment, depending on how I build the compiler I either get aarch64-linux-gnu-g++ or aarch64-unknown-linux-gnu-g++). There's a gotcha here, i.e. that in the normal case, the compiler will change from just g++ to x86_64-linux-gnu-g++. I couldn't yet think of a nice way to try a normal gcc binary, since the selecting and testing of the compiler happen at two different points currently, and I didn't want to change that much in the code, not yet anyway. I think when you install a native gcc they always alias those to that binary, so it should be fine, but still worth some consideration :p

For clang it tries -target <arch>-<sys>-gnu, but only if -target doesn't appear in the ABI flags yet. This can't do fancy stuff like -target arm64v7a-..., but that shouldn't be automatically possible right now anyway, so still an improvement imo.

@arckoor
arckoor force-pushed the infer-cross-compiler branch 3 times, most recently from d3a4b66 to c0f2fd5 Compare November 30, 2026 10:57
@arckoor
arckoor force-pushed the infer-cross-compiler branch from c0f2fd5 to bda73ef Compare November 30, 2026 15:09
@arckoor
arckoor requested a balanced review from Copilot November 30, 2026 15:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@arckoor
arckoor requested a review from randombit November 30, 2026 15:23
@arckoor
arckoor marked this pull request as ready for review November 30, 2026 15:23
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.

Automatic compiler selection while cross building botan (-rs)

2 participants