lts with llvm 3.8 for ARM

Joakim via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Thu Mar 10 00:18:55 PST 2016


I've tried out native and cross-compiling for Android/ARM with 
the just-released llvm 3.8.  I ran into an error when compiling 
with any optimizations:

ldc2: CommandLine Error: Option 'arm-load-store-opt' registered 
more than once!                                                   
             LLVM ERROR: inconsistency in registered CommandLine 
options

I tracked it down to llvm's addPassesToEmitFile, which calls that 
optimization pass in two places, addPreRegAlloc and addPreSched2:

https://github.com/llvm-mirror/llvm/blob/master/lib/Target/ARM/ARMTargetMachine.cpp#L386

However, llvm 3.7 does the same, so it appears that llvm 3.8 
finally enforces that the same pass isn't inserted twice?

I'm able to work around the issue by disabling that pass, using 
--arm-load-store-opt=false.  All the same tests pass on 
Android/ARM after that.

Let me know if anyone else runs into the same issue with llvm 3.8 
for ARM.

Other tweaks:

- I was able to use Kai's longdouble patch to cross-compile, but 
I had to change ldc-real.h/cpp so that llvm::APFloat::mod only 
called a single argument.

- Dan's PR for std.internal.math.errorfunction 
(https://github.com/ldc-developers/phobos/pull/25) is not 
necessary with llvm 3.8, ie those tests pass without it.


More information about the digitalmars-d-ldc mailing list