ldc-developers / ldc

The LLVM-based D Compiler.
http://wiki.dlang.org/LDC
Other
1.19k stars 258 forks source link

List of registered targets doesn't match target triple #3805

Open jacob-carlborg opened 3 years ago

jacob-carlborg commented 3 years ago

The following is the list of registered targets for LDC 1.27.0:

  Registered Targets:
    aarch64    - AArch64 (little endian)
    aarch64_32 - AArch64 (little endian ILP32)
    aarch64_be - AArch64 (big endian)
    amdgcn     - AMD GCN GPUs
    arm        - ARM
    arm64      - ARM64 (little endian)
    arm64_32   - ARM64 (little endian ILP32)
    armeb      - ARM (big endian)
    avr        - Atmel AVR Microcontroller
    mips       - MIPS (32-bit big endian)
    mips64     - MIPS (64-bit big endian)
    mips64el   - MIPS (64-bit little endian)
    mipsel     - MIPS (32-bit little endian)
    msp430     - MSP430 [experimental]
    nvptx      - NVIDIA PTX 32-bit
    nvptx64    - NVIDIA PTX 64-bit
    ppc32      - PowerPC 32
    ppc32le    - PowerPC 32 LE
    ppc64      - PowerPC 64
    ppc64le    - PowerPC 64 LE
    r600       - AMD GPUs HD2XXX-HD6XXX
    riscv32    - 32-bit RISC-V
    riscv64    - 64-bit RISC-V
    thumb      - Thumb
    thumbeb    - Thumb (big endian)
    wasm32     - WebAssembly 32-bit
    wasm64     - WebAssembly 64-bit
    x86        - 32-bit X86: Pentium-Pro and above
    x86-64     - 64-bit X86: EM64T and AMD64

The identifiers on the left side don't always match what's expected by the --mtriple flag. For example, the x86 identifier should be i386 and x86-64 should be x86_64. Most of the other ones I've tested seem to be correct.

JohanEngelen commented 3 years ago

Can you submit this feature request at LLVM? We use llvm::TargetRegistry::printRegisteredTargetsForVersion for this print out.

jacob-carlborg commented 3 years ago

I can give that a try.

kinke commented 3 years ago

I found the x86-64 vs. x86_64 particularly annoying too. For some arch families, there's no 1:1 mapping (x86 => i[3-6]86, arm => armv{6,7a,...})...

JohanEngelen commented 3 years ago

Is there an online resource about what triples are recognized?

jacob-carlborg commented 3 years ago

Is there an online resource about what triples are recognized?

I've looked and couldn't find anything.

kinke commented 3 years ago

I don't know of any either; that's why I've created a little list in https://wiki.dlang.org/Cross-compiling_with_LDC#The_-mtriple_command-line_option.