[LLVMdev] Migrate Project Build system to LLVM BitCode

Sahoo, Swarup Kumar ssahoo2 at illinois.edu
Thu Jan 17 07:14:39 PST 2013


If you need to make it work using -O4, you will need to install GoldPlugin, since it needs to link the bitcode files. Otherwise you will get those ld linker errors.

And even if you use GoldPlugin, you will have to run your passes separately or incorporate your passes into the LTO module. It is probably not worth it since this Makefile seems simple.

-Swarup.

________________________________________
From: llvmdev-bounces at cs.uiuc.edu [llvmdev-bounces at cs.uiuc.edu] on behalf of Hassan, Ahmad [ahmad.hassan at sap.com]
Sent: Thursday, January 17, 2013 9:09 AM
To: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] Migrate Project Build system to LLVM BitCode

Hi Duncan,

> 4.gcc -g -O2 -o .libs/mergedexe  .libs/mergedbc.s  -pthread
> -Wl,--export-dynamic   .libs/lib1.a   -lssl -lcrypto -ldl -pthread .libs/lib2.so

>if you pass -O4 rather than -O2 to clang I think it will in essence do this all
>for you already.  It might even do the link time optimization for you at -O2
>even, I'm not sure.

No, if I use clang for producing executable then I get series of error both with O2 and O4:

error: input can't have .file dwarf directives when -g is used to generate dwarf debug info for assembly code
        .file   38 "/usr/include/x86_64-linux-gnu/sys/un.h"

If I remove '-g' then I get
/usr/bin/ld: /usr/local/bin/../lib/LLVMgold.so: error loading plugin
/usr/bin/ld: /usr/local/bin/../lib/LLVMgold.so: error in plugin cleanup (ignored)
clang: error: linker command failed with exit code 1

It works fine if I use 'gcc' in step 4 for produce executable.

Cheers,
Ahmad



Ciao, Duncan.

>
> Thanks.
>
> Ahmad
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>

_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list