Ticket #1075 (closed todo: fixed)

Opened 5 years ago

Last modified 4 years ago

Add Configure probes for LLVM

Reported by: whiteknight Owned by: jkeenan
Priority: normal Milestone:
Component: configure Version: 1.6.0
Severity: medium Keywords: jit configure
Cc: Language:
Patch status: applied Platform: all

Description

The new JIT system will be based, at least initially, on LLVM. We are going to need a way in Configure.pl to either detect it automatically or to specify it on the commandline:

perl Configure.pl --jit=/path/to/llvm

I think very likely we are going to want to be able to detect other JIT engines as well, notably libJIT.

Once detected, we are probably going to want to define macros in the C source like PARROT_JIT_HAS_LLVM, or PARROT_JIT_HAS_LIBJIT.

Attachments

Change History

follow-up: ↓ 2   Changed 5 years ago by jkeenan

  • owner set to jkeenan
  • status changed from new to assigned

Have created detect_llvm branch in repository to conduct initial exploration of these issues.

kid51

in reply to: ↑ 1 ; follow-up: ↓ 4   Changed 5 years ago by jkeenan

Replying to jkeenan:

Have created detect_llvm branch in repository to conduct initial exploration of these issues.

I have made some progress on this in the detect_llvm branch; see attachment. I have created a configuration step auto::llvm which probes for LLVM by following the example provided at  Getting Started with the LLVM System. I have also added a test for this in t/steps. Both the step and the test DWIM on (a) my Linux/x86 box where LLVM has been installed (via Debian package) and (b) on my Darwin/PPC laptop where LLVM has not been installed.

Because the LLVM documentation indicates that the older version of its customized C compiler, llvm-gcc is considered obsolete, I made the decision to reject versions of llvm-gcc before major version 4.

Since we're not doing anything with LLVM yet, there's no rush to merge this patch into trunk. That can wait until Whiteknight and his merry band of JIToriosi decide what we will do with LLVM. Other functionality which we should probably explore before any merge would include:

* That page from llvm.org indicates that the final part of the probe, assembling the native assembly language file into a program, would be invoked differently on Solaris from other OSes: /opt/SUNWspro/bin/cc -xarch=v9 hello.s -o hello.native. This should be tested and incorporated into the step somehow. (Paging Andy D!)

* It should be tested on Win32, perhaps with  this binary.

* It should be tested on some box where LLVM has been built from source code.

Thank you very much.

kid51

  Changed 5 years ago by whiteknight

Thanks for setting this up kid51, it's going to be a big weight off when it's time to start putting a JIT system together. We'll take a look at it and merge it into trunk when we're ready to play with it.

in reply to: ↑ 2   Changed 5 years ago by doughera

Replying to jkeenan:

* That page from llvm.org indicates that the final part of the probe, assembling the native assembly language file into a program, would be invoked differently on Solaris from other OSes: /opt/SUNWspro/bin/cc -xarch=v9 hello.s -o hello.native. This should be tested and incorporated into the step somehow. (Paging Andy D!)

I don't know why they do that. It does appear to assume two things: First, that the user *has* Sun's optional commercial compiler installed, and second that the user wants to use 64bit mode (the -xarch=v9 flag). That might or might not matter, depending on how everything else was compiled. It may be that LLVM on SPARC only works in 64-bit mode. I have no idea. (Also note that Solaris also runs on x86 and x86_64 architectures, where the -xarch=v9 flag would definitely be wrong.)

Taking a quick look at the LLVM page  http://llvm.org/Features.html, it doesn't matter, since LLVM doesn't support JIT for SPARC anyway:

A Just-In-Time (JIT) code generation system, which currently supports X86, X86-64, PowerPC and PowerPC-64.

Summary: I'd say just ignore that advice for now. It would introduce complications that won't gain you anything. If the tests fail to detect LLVM on SPARC as a result, that will be fine, since it wouldn't work for JIT anyway.

  Changed 5 years ago by chromatic

  • milestone changed from 2.0 to 2.1

  Changed 5 years ago by allison

  • milestone 2.2 deleted

  Changed 4 years ago by jkeenan

  • patch set to applied

In #parrotsketch today, the sentiment was in favor of merging branches when they're ready. So I merged the detect_llvm branch into trunk at r4874.

Will keep ticket open for a few days to register any complaints.

Thank you very much.

kid51

  Changed 4 years ago by jkeenan

  • status changed from assigned to closed
  • resolution set to fixed

No complaints registered. Closing ticket.

Thank you very much.

kid51

Note: See TracTickets for help on using tickets.