Opened 5 years ago

Closed 20 months ago

#7608 closed task (wontfix)

LLVM only handles a hard-coded list of triples.

Reported by: singpolyma Owned by:
Priority: normal Milestone: 8.0.1
Component: Compiler (LLVM) Version: 7.7
Keywords: cross-compiling llvm Cc: erikd
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Other Test Case:
Blocked By: Blocking: #7610
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by dterei)

LLVM simply has a hard-coded list of triples for supported platforms in compiler/llvmGen/LlvmCodeGen/Ppr.hs :: moduleLayout.

Apparently this information can potentially be sourced by configure / autotools instead. This may be a better way forward rather than adding code for each platform.

Change History (14)

comment:1 Changed 5 years ago by singpolyma

Version: 7.6.17.7

comment:2 Changed 5 years ago by singpolyma

There are reports that setting up moduleLayout in compiler/llvmGen/LlvmCodeGen/Ppr.hs for a platform will make the right triple be selected, even in cross-compiling mode.

This may be sufficient, and I am testing it for my target platform now.

comment:3 Changed 5 years ago by dterei

Blocking: 7610 added

comment:4 Changed 5 years ago by simonmar

difficulty: Unknown

This bug is somewhat false. The .ll file generated by my x86_64-to-arm cross compiler starts with:

target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32"
target triple = "arm-unknown-linux-gnueabi"

which is emitted by the code in LlvmCodeGen.Ppr.moduleLayout. If there's a bug here at all, it is that there are a fixed set of cases handled by moduleLayout, so to cross-compile for a new target you need to modify this code by hand.

comment:5 Changed 5 years ago by singpolyma

I agree. Any fix for this should be in moduleLayout

comment:6 Changed 5 years ago by dterei

Description: modified (diff)
Summary: Triple not passed to LLVM when cross-compilingLLVM only handles a hard-coded list of triples.

Yes, I've been meaning to update this bug. Doing now.

comment:7 Changed 5 years ago by dterei

Type: bugtask
Type of failure: GHC doesn't work at allOther

comment:8 Changed 4 years ago by igloo

Milestone: 7.8.1
Owner: set to dterei

David, I've assigned this to you as you're our LLVM guru. Please unassign it if you don't plan to look at it.

comment:9 Changed 3 years ago by thoughtpolice

Milestone: 7.8.37.10.1

Moving to 7.10.1

comment:10 Changed 3 years ago by dterei

Owner: dterei deleted

comment:11 Changed 3 years ago by thoughtpolice

Milestone: 7.10.17.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:12 Changed 2 years ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:13 Changed 23 months ago by erikd

Cc: erikd added

comment:14 Changed 20 months ago by bgamari

Resolution: wontfix
Status: newclosed

As far as I can tell this isn't a bug. As far as I know there is no way to avoid enumerating supported triplets like this. For instance, rustc has a very similar table.

Note: See TracTickets for help on using tickets.