Opened 2 years ago

Last modified 5 months ago

#7608 new task

LLVM only handles a hard-coded list of triples.

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

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 (11)

comment:1 Changed 2 years ago by singpolyma

  • Version changed from 7.6.1 to 7.7

comment:2 Changed 2 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 2 years ago by dterei

  • Blocking 7610 added

comment:4 Changed 2 years ago by simonmar

  • difficulty set to 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 2 years ago by singpolyma

I agree. Any fix for this should be in moduleLayout

comment:6 Changed 2 years ago by dterei

  • Description modified (diff)
  • Summary changed from Triple not passed to LLVM when cross-compiling to LLVM only handles a hard-coded list of triples.

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

comment:7 Changed 2 years ago by dterei

  • Type changed from bug to task
  • Type of failure changed from GHC doesn't work at all to Other

comment:8 Changed 2 years ago by igloo

  • Milestone set to 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 13 months ago by thoughtpolice

  • Milestone changed from 7.8.3 to 7.10.1

Moving to 7.10.1

comment:10 Changed 6 months ago by dterei

  • Owner dterei deleted

comment:11 Changed 5 months ago by thoughtpolice

  • Milestone changed from 7.10.1 to 7.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.

Note: See TracTickets for help on using tickets.