Can LDC compile to supported legacy LLVM versions?

Nicholas Wilson iamthewilsonator at hotmail.com
Mon Jan 28 13:04:08 UTC 2019


On Monday, 28 January 2019 at 11:37:56 UTC, Dukc wrote:
> I have recenty updated my LDC to the most recent version 
> (1.14). The problem is that it compiles to LLVM code version 
> 7.0.1, but I need it to compile to LLVM 6.x.x or LLVM 5.x.x. 
> The last release note said that LLVM versions from 
> 3.something.something are supported, but does this mean only 
> linking to them, or also compiling to them?
>
> If it can be done, how? Thanks.

Do you mean bitcode, LLVM IR or something different? The LDC 
built against a given version of LLVM can link to bitcode/compile 
LLMV IR, of that version.

Lowest LLVM it can be compiled against is 3.9. LDC's releases are 
compiled against 7.0.1, but that doesn't stop you downloading a 
release of the desired LLVM version and compiling LDC against 
that.

All you need is a semi-recent CMake. Just git clone from our 
github and run cmake, you'll need to provide the location of the 
llvm-config binary as LLVM_CONFIG but thats it.


More information about the Digitalmars-d-learn mailing list