[cfe-dev] What's the supported language for clang driver?

罗勇刚(Yonggang Luo) luoyonggang at gmail.com
Fri Oct 18 19:34:27 PDT 2013


H:\CI\bld\compilers\musl\src\math\i386>clang -v
clang version 3.4 (trunk)
Target: i686-pc-win32
Thread model: posix

H:\CI\bld\compilers\musl\src\math\i386>clang -c sqrt.s
sqrt.s:2:7: error: expected absolute expression
.type sqrt, at function
      ^

H:\CI\bld\compilers\musl\src\math\i386>type sqrt.s
.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

H:\CI\bld\compilers\musl\src\math\i386>




2013/10/19 Hans Wennborg <hans at chromium.org>:
> Does something like this work:
>
>   clang -c sqrt.s
>
> Clang should detect the file type based on the extension and assemble it.
>
>  - Hans
>
> On Fri, Oct 18, 2013 at 11:30 AM, 罗勇刚(Yonggang Luo)
> <luoyonggang at gmail.com> wrote:
>> to be exact, I want to do this but failed:
>> H:\CI\bld\compilers\musl\src\math\x86_64>clang sqrt.s /Xassembler -filetype=obj
>> -triple i686-pc-win32
>> clang.exe: error: unknown argument: '-filetype=obj'
>> clang.exe: error: unknown argument: '-triple'
>> clang.exe: error: no such file or directory: '/Xassembler'
>> clang.exe: error: no such file or directory: 'i686-pc-win32'
>>
>> 2013/10/19 罗勇刚(Yonggang Luo) <luoyonggang at gmail.com>:
>>> def x : JoinedOrSeparate<["-"], "x">, Flags<[DriverOption,CC1Option]>,
>>>   HelpText<"Treat subsequent input files as having type <language>">,
>>>   MetaVarName<"<language>">;
>>>
>>>
>>> Is there a list for this.
>>>
>>> I want to compile a gas style x86 assembly file to COFF object file by
>>> the driver clang, how to do that.
>>>
>>> --
>>>          此致
>>>>>> 罗勇刚
>>> Yours
>>>     sincerely,
>>> Yonggang Luo
>>
>>
>>
>> --
>>          此致
>>>> 罗勇刚
>> Yours
>>     sincerely,
>> Yonggang Luo
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



-- 
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo




More information about the cfe-dev mailing list