罗勇刚(Yonggang Luo)
2013-Oct-19 14:58 UTC
[LLVMdev] Feature request for include llvm-mc in llvm.org/builds
2013/10/19 Rafael Espíndola <rafael.espindola at gmail.com>:> On 19 October 2013 06:01, 罗勇刚(Yonggang Luo) <luoyonggang at gmail.com> wrote: >> I found that access llvm-mc from clang driver is impossible, and I >> want to use llvm-mc to compile assembly files, how to do that? > > Try "clang -integrated-as -c test.s"Thank you very much, I use the following command compiled successfully: clang -integrated-as -c -v --target=i686-pc-mingw sqrt.s The output format is file format ELF32-i386, i wanna to know is there a way to output COFF format along with target=i686-pc-mingw. because I want to compile to following asm file for both linux/gcc and windows/visual C++. .global sqrt .type sqrt, at function sqrt: fldl 4(%esp) fsqrt fstsw %ax sub $12,%esp fld %st(0) fstpt (%esp) mov (%esp),%ecx and $0x7ff,%ecx cmp $0x400,%ecx jnz 1f and $0x200,%eax sub $0x100,%eax sub %eax,(%esp) fstp %st(0) fldt (%esp) 1: add $12,%esp fstpl 4(%esp) fldl 4(%esp) ret> > Cheers, > Rafael-- 此致 礼 罗勇刚 Yours sincerely, Yonggang Luo
Reid Kleckner
2013-Oct-21 18:23 UTC
[LLVMdev] Feature request for include llvm-mc in llvm.org/builds
I can confirm I get the same behavior, and that's a real bug. If you use --target=i686-pc-win32, you get COFF, and that should be a good workaround for now. There must be a conditional somewhere that isn't handling mingw correctly. On Sat, Oct 19, 2013 at 7:58 AM, 罗勇刚(Yonggang Luo) <luoyonggang at gmail.com>wrote:> 2013/10/19 Rafael Espíndola <rafael.espindola at gmail.com>: > > On 19 October 2013 06:01, 罗勇刚(Yonggang Luo) <luoyonggang at gmail.com> > wrote: > >> I found that access llvm-mc from clang driver is impossible, and I > >> want to use llvm-mc to compile assembly files, how to do that? > > > > Try "clang -integrated-as -c test.s" > > Thank you very much, I use the following command compiled successfully: > clang -integrated-as -c -v --target=i686-pc-mingw sqrt.s > > > The output format is file format ELF32-i386, i wanna to know > is there a way to output COFF format along with target=i686-pc-mingw. > because I want to compile to following asm file for both linux/gcc and > windows/visual C++. > > .global sqrt > .type sqrt, at function > sqrt: fldl 4(%esp) > fsqrt > fstsw %ax > sub $12,%esp > fld %st(0) > fstpt (%esp) > mov (%esp),%ecx > and $0x7ff,%ecx > cmp $0x400,%ecx > jnz 1f > and $0x200,%eax > sub $0x100,%eax > sub %eax,(%esp) > fstp %st(0) > fldt (%esp) > 1: add $12,%esp > fstpl 4(%esp) > fldl 4(%esp) > ret > > > > > Cheers, > > Rafael > > > > -- > 此致 > 礼 > 罗勇刚 > Yours > sincerely, > Yonggang Luo > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131021/c1bc27b9/attachment.html>
Reid Kleckner
2013-Oct-21 18:43 UTC
[LLVMdev] Feature request for include llvm-mc in llvm.org/builds
Ah, so clang only understands the spelling mingw32, not mingw. That'll give you COFF. :) On Mon, Oct 21, 2013 at 11:23 AM, Reid Kleckner <rnk at google.com> wrote:> I can confirm I get the same behavior, and that's a real bug. If you use > --target=i686-pc-win32, you get COFF, and that should be a good workaround > for now. There must be a conditional somewhere that isn't handling mingw > correctly. > > > On Sat, Oct 19, 2013 at 7:58 AM, 罗勇刚(Yonggang Luo) <luoyonggang at gmail.com>wrote: > >> 2013/10/19 Rafael Espíndola <rafael.espindola at gmail.com>: >> > On 19 October 2013 06:01, 罗勇刚(Yonggang Luo) <luoyonggang at gmail.com> >> wrote: >> >> I found that access llvm-mc from clang driver is impossible, and I >> >> want to use llvm-mc to compile assembly files, how to do that? >> > >> > Try "clang -integrated-as -c test.s" >> >> Thank you very much, I use the following command compiled successfully: >> clang -integrated-as -c -v --target=i686-pc-mingw sqrt.s >> >> >> The output format is file format ELF32-i386, i wanna to know >> is there a way to output COFF format along with target=i686-pc-mingw. >> because I want to compile to following asm file for both linux/gcc and >> windows/visual C++. >> >> .global sqrt >> .type sqrt, at function >> sqrt: fldl 4(%esp) >> fsqrt >> fstsw %ax >> sub $12,%esp >> fld %st(0) >> fstpt (%esp) >> mov (%esp),%ecx >> and $0x7ff,%ecx >> cmp $0x400,%ecx >> jnz 1f >> and $0x200,%eax >> sub $0x100,%eax >> sub %eax,(%esp) >> fstp %st(0) >> fldt (%esp) >> 1: add $12,%esp >> fstpl 4(%esp) >> fldl 4(%esp) >> ret >> >> > >> > Cheers, >> > Rafael >> >> >> >> -- >> 此致 >> 礼 >> 罗勇刚 >> Yours >> sincerely, >> Yonggang Luo >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131021/0c1eb922/attachment.html>
Apparently Analagous Threads
- [LLVMdev] Feature request for include llvm-mc in llvm.org/builds
- [LLVMdev] Feature request for include llvm-mc in llvm.org/builds
- [LLVMdev] How to use clang -intergrated-as to compile cross-(os/target) assembly file.
- [LLVMdev] Feature request for include llvm-mc in llvm.org/builds
- [LLVMdev] Feature request for include llvm-mc in llvm.org/builds