Luís Marques via llvm-dev
2017-Jul-06 00:51 UTC
[llvm-dev] MSP430 code generation from LLVM IR
On Thu, Jul 6, 2017 at 1:35 AM, Nicholas Wilson < iamthewilsonator at hotmail.com> wrote:> Luís, try using the -no-integrated-as flag to execute the assembler for > you. > We should probably make that the default for MSP430. >Cool. When I did that on macOS, LDC generated a lot of complaints, possibly because it is assuming mach-o files. I tried changing from -mtriple=msp430 to -mtriple=msp430-unknown-elf, to no avail. E.g.: $ ldc2 -mtriple=msp430-unknown-elf -c -no-integrated-as qosd.d ldc-ad1c8f0.s:3:11: error: mach-o section specifier requires a segment whose length is between 1 and 16 characters .section .text._D4qosd3fooFZi,"axG", at progbits,_D4qosd3fooFZi,comdat ^ ldc-ad1c8f0.s:6:2: error: unknown directive .type _D4qosd3fooFZi, at function ^ ldc-ad1c8f0.s:8:2: error: invalid instruction mnemonic 'mov.w' mov.w #42, r14 ^~~~~ (...) I didn't try it in a Linux host. I imagine a lot of the errors will go away there (because it assumes ELF), but possibly not the ones about 'mov.w'. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170706/167445bc/attachment.html>
Tim Northover via llvm-dev
2017-Jul-06 01:19 UTC
[llvm-dev] MSP430 code generation from LLVM IR
On 5 July 2017 at 17:51, Luís Marques via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Cool. When I did that on macOS, LDC generated a lot of complaints, possibly > because it is assuming mach-o files. I tried changing from -mtriple=msp430 > to -mtriple=msp430-unknown-elf, to no avail. E.g.:Clang has a bunch of complicated logic to find the correct assembler if it's installed (in this case I'd expect "msp430-unknown-elf-as"). It's quite possible LDC doesn't have this since its main targets use the integrated-assembler. Your errors certainly look consistent with the macOS system "as" being called on ELF MSP430 output. I know that in Clang you can add "-###" so that Clang will tell you the exact commands it would run (or -v to both tell you and do it). I'd hope LDC has some equivalent. Cheers. Tim.
Luís Marques via llvm-dev
2017-Jul-06 01:24 UTC
[llvm-dev] MSP430 code generation from LLVM IR
On Thu, Jul 6, 2017 at 2:19 AM, Tim Northover <t.p.northover at gmail.com> wrote:> On 5 July 2017 at 17:51, Luís Marques via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > Cool. When I did that on macOS, LDC generated a lot of complaints, > possibly > > because it is assuming mach-o files. I tried changing from > -mtriple=msp430 > > to -mtriple=msp430-unknown-elf, to no avail. E.g.: > > Clang has a bunch of complicated logic to find the correct assembler > if it's installed (in this case I'd expect "msp430-unknown-elf-as"). > It's quite possible LDC doesn't have this since its main targets use > the integrated-assembler. Your errors certainly look consistent with > the macOS system "as" being called on ELF MSP430 output. >Yup, it's using /usr/bin/gcc as the assembler driver. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170706/0989efc3/attachment.html>
Apparently Analagous Threads
- MSP430 code generation from LLVM IR
- MSP430 code generation from LLVM IR
- [LLVMdev] link bytecode files into a native executable with debug info
- lli cannot execute the bc file for RISCV, Unable to find target for this triple
- error in building llvm with default options