[llvm-dev] MSP430 code generation from LLVM IR

Anton Korobeynikov via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 5 17:25:04 PDT 2017


There is no direct object emission support in MSP430 backend. clang
executed assembler under the hood.

On Thu, Jul 6, 2017 at 2:50 AM, Luís Marques via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Hello,
>
> While trying to find out why the LDC compiler refuses to generate object
> code for MSP430 targets (but generates MSP430 assembly or LLVM IR/bitcode),
> I came across the following apparent inconsistency.
>
> This works:
>
> $ clang --target=msp430 -c test.c
>
> This doesn't work:
>
> $ clang --target=msp430 -S -emit-llvm test.c
> $ llc -filetype=obj test.ll
> /opt/msp430/bin/llc: target does not support generation of this file type!
>
> That sequence works fine for x86.
>
> Could someone help shed some light into this discrepancy? (Maybe it will
> also help me figure out why LDC refuses to directly generate MSP430 object
> files [1]).
>
> Thanks,
> Luís
>
> [1] $ ldc2 -mtriple=msp430 -c test.d
> no support for asm output
> UNREACHABLE executed at ../driver/toobj.cpp:130!
> 0  ldc2                     0x0000000107e19c9c
> llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 60
> 1  ldc2                     0x0000000107e1a1e9
> PrintStackTraceSignalHandler(void*) + 25
> 2  ldc2                     0x0000000107e16139
> llvm::sys::RunSignalHandlers() + 425
> 3  ldc2                     0x0000000107e1a642 SignalHandler(int) + 354
> 4  libsystem_platform.dylib 0x00007fffa0ad5b3a _sigtramp + 26
> 5  libsystem_platform.dylib 0x0000000000000003 _sigtramp + 1599251683
> 6  libsystem_c.dylib        0x00007fffa095a420 abort + 129
> 7  ldc2                     0x0000000107d246c0 LLVMInstallFatalErrorHandler
> + 0
> 8  ldc2                     0x0000000105efd2a7
> codegenModule(llvm::TargetMachine&, llvm::Module&, llvm::raw_fd_ostream&,
> llvm::TargetMachine::CodeGenFileType) + 391
> 9  ldc2                     0x0000000105f00ab9 (anonymous
> namespace)::writeObjectFile(llvm::Module*, char const*) + 377
> 10 ldc2                     0x0000000105efcc05 writeModule(llvm::Module*,
> char const*) + 10517
> 11 ldc2                     0x0000000105ee6162
> ldc::CodeGenerator::writeAndFreeLLModule(char const*) + 1602
> 12 ldc2                     0x0000000105ee6a82
> ldc::CodeGenerator::finishLLModule(Module*) + 130
> 13 ldc2                     0x0000000105ee880c
> ldc::CodeGenerator::emit(Module*) + 1420
> 14 ldc2                     0x0000000105f36e4e
> codegenModules(Array<Module*>&) + 574
> 15 ldc2                     0x0000000105bf2a00 mars_mainBody(Array<char
> const*>&, Array<char const*>&) + 5120
> Abort trap: 6
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>



-- 
With best regards, Anton Korobeynikov
Department of Statistical Modelling, Saint Petersburg State University


More information about the llvm-dev mailing list