[LLVMdev] Replace gcc with llvm-gcc
罗勇刚(Yonggang Luo)
luoyonggang at gmail.com
Tue Sep 15 09:07:06 PDT 2009
Just set llvm-ld as the default ld .
Such as LD = llvm-ld in makefile, if it's not working, then there is no solution
2009/9/15, zhunan <zhunansjtu at gmail.com>:
> I truly get the bytecode file for each souce file,but can I use
> llvm-link to link them into a whole-program one automatically through
> some scripts?
>
>
>>
>> Message: 27
>> Date: Tue, 15 Sep 2009 03:16:10 +0200
>> From: ?scar Fuentes <ofv at wanadoo.es>
>> Subject: Re: [LLVMdev] Replace gcc with llvm-gcc???
>> To: llvmdev at cs.uiuc.edu
>> Message-ID: <87vdjlnh2d.fsf at telefonica.net>
>> Content-Type: text/plain; charset=windows-1252
>>
>> zhunan <zhunansjtu at gmail.com> writes:
>>
>> > Recently I met a question when I want to replace gcc with llvm-gcc
>> > through configure script(command).
>> >
>> > For simply,described like that
>> >
>> > I typed as following
>> >
>> > 1.zhunan at sjtu:~/workplace/$ ./configure CC=llvm-gcc CFLAGS="-S
>> > -emit-llvm"
>> >
>> > configure will failed when it checks whether C compiler is working
>> >
>> > 2.zhunan at sjtu:~/workplace/$ ./configure CC=llvm-gcc CFLAGS="-c
>> > -emit-llvm"
>> >
>> > configure will failed when it checks the default output filename,just
>> > means the C compiler cannot create executables.
>> >
>> >
>> > I would like to know what's the matter with this replacing attempt?and
>> > any possibility to overcome the trouble?
>>
>> Your CFLAGS is telling llvm-gcc that it must not produce an object code
>> file nor an executable file, but something else (llvm assembler on your
>> first attempt and llvm bitcode on your second attempt).
>>
>> `configure' needs a fully working compiler toolset, which means that the
>> compiler must be able to produce executable files. Your CFLAGS setting
>> is preventing this.
>>
>> Execute `configure' with just CC=llvm-gcc and then try
>>
>> make CFLAGS="-emit-llvm"
>>
>> if you want LLVM bitcode or
>>
>> make CFLAGS="-S -emit-llvm"
>>
>> if you want LLVM assembler.
>>
>> `make' will fail at the linking phase, but you will have a set of LLVM
>> bitcode/assembler files for each of your C source files.
>>
>> If you simply want to replace gcc with llvm-gcc for building your
>> software, forget about CFLAGS and just do
>>
>> ./configure CC=llvm-gcc && make
>>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
--
从我的移动设备发送
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
More information about the llvm-dev
mailing list