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

Add support for freestanding targets #22

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from
Open

Add support for freestanding targets #22

wants to merge 4 commits into from

Conversation

shym
Copy link
Owner

@shym shym commented Jan 8, 2025

No description provided.

shym added 4 commits January 8, 2025 12:26
Accept `*-none` and `*-elf*` triplets for all the architectures with a
native backend to describe the corresponding freestanding target
Define `system` to `none` is such cases

Rationale: the last component of the target triplet is usually the OS;
for freestanding targets, the most commonly used placeholders one might
want to target with OCaml are `none` and `elf*`.
Set the value of `Sys.os_type` (for compiled programs) and of the
`os_type` compiler configuration to `None` for freestanding targets
The freestanding targets currently used rely on either GNU `ld` or
`lld`. GNU `ld` now requires the explicit mention that the stack should
not be executable by seeing the `.note.GNU-stack` section. `lld` ignores
this section.

Recall that on freestanding targets, `system` is set to `none`.
Allow the use of *-*-ocaml or *-*-*-ocaml target triplets to stand for
freestanding cross compilers by temporarily rewriting the target OS to
`none` when generating the canonical target

This allows to use *-*-ocaml and *-*-*-ocaml prefixes for cross-compiler
specific toolchains, so that all the specific tools (for instance
aarch64-solo5-ocaml-gcc, etc.) can be discovered automatically by
`configure`
@shym shym force-pushed the trunk branch 4 times, most recently from 617e121 to 4136244 Compare January 15, 2025 10:20
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.

1 participant