Skip to content

target "triples" #1452

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

Open
alex-s168 opened this issue Apr 30, 2025 · 2 comments
Open

target "triples" #1452

alex-s168 opened this issue Apr 30, 2025 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@alex-s168
Copy link
Collaborator

alex-s168 commented Apr 30, 2025

for LM, we want to support different combinations of:

  • compiler backend
  • target architecture
  • target environment: libc, wasip1, ...
  • target OS (optional-ish)
  • object format

to do that, we should add this target "triple" format:

format

<backend> - <arch> - <environment> - <object format> - ....

everything after the fourth dash (if present) can be ignored.
this is for forwards compatibility.

valid backend values

  • c
  • c_gnu: also for clang
  • c_clang
  • c_msvc
  • c_tcc

valid architectures + sub architectures:

  • c: should be used when architecture is completely abstracted away by C backend
  • all LLVM architectures (see here). syntax for arch+sub arch should be: arch_subarch

valid environment values:

  • freestanding
  • libc
  • libc_unix
  • libc_posix
  • libc_glibc
  • libc_win32
  • wasip1
  • wasip1_threads
  • ...

valid object format values:

  • external: when abstracted away by external toolchain (when used with for example C backend)
  • elf
  • wasm: wasm binary format
  • coff
  • ...

examples:

  • c-c-libc-external: what we are doing currently
  • c_clang-riscv64-libc_posix-external
  • llvm-wasm32-wasip1_threads-wasm : there will probably never be an LLVM backend, but that is just an example.
@alex-s168
Copy link
Collaborator Author

@andrew-johnson-4 thoughts?

@alex-s168 alex-s168 added the enhancement New feature or request label Apr 30, 2025
@alex-s168 alex-s168 self-assigned this Apr 30, 2025
@andrew-johnson-4
Copy link
Collaborator

yeah, triples are the best practice way of doing this. I just don't want to think about this until core is more stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants