AccelerateHS / accelerate-llvm

LLVM backend for Accelerate
http://www.acceleratehs.org
Other
155 stars 50 forks source link

Fail compilation early and with a proper message on unsupported archi… #93

Closed ppetr closed 1 year ago

ppetr commented 1 year ago

…tectures.

Attempting to compile the project on non-x86 architecture fails with the error message below. Which is quite difficult to understand without examining the source code.

[ 6 of 35] Compiling Data.Array.Accelerate.LLVM.Native.Link.ELF ( .stack-work/dist/arm-linux/Cabal-2.4.0.1/build/Data/Array/Accelerate/LLVM/Native/Link/ELF.hs, .stack-work/dist/arm-linux/Cabal-2.4.0.1/build/Data/Array/Accelerate/LLVM/Native/Link/ELF.o )

/tmp/stack-1d292616/accelerate-llvm-native-1.3.0.0/src/Data/Array/Accelerate/LLVM/Native/Link/ELF.chs:216:1: error:
    The type signature for ‘processRelocation’
      lacks an accompanying binding
    |
216 |           dst = seg_p `plusPtr` sec_addr
    | ^^^^^^^^^^^^^^^^^

/tmp/stack-1d292616/accelerate-llvm-native-1.3.0.0/src/Data/Array/Accelerate/LLVM/Native/Link/ELF.chs:431:25: error:
    Not in scope: type constructor or class ‘RelocationType’
    Perhaps you meant one of these:
      ‘Relocation’ (line 426), ‘SectionType’ (line 290)
    |
431 |     , r_type        :: !RelocationType
    |                         ^^^^^^^^^^^^^^

Description

Motivation and context

How has this been tested?

Types of changes

Checklist:

ppetr commented 1 year ago

Friendly ping? Since the added error message is architecturally dependent, I don't think there is a good way to unit-test it (I of course validated it manually locally).

tmcdonell commented 1 year ago

Hey @ppetr, sorry I didn't get to this. I think this is not necessary anymore since we switched the linking setup, and it works on x86-64 as well as aarch64 (i.e. Apple Silicon) now. But thank you for your work and patience!