Skip to Content.
Sympa Menu

svadev - Re: [svadev] SAFECode's whole-program analysis features

svadev AT lists.siebelschool.illinois.edu

Subject: Svadev mailing list

List archive

Re: [svadev] SAFECode's whole-program analysis features


Chronological Thread 
  • From: John Criswell <criswell AT illinois.edu>
  • To: Fábio Resner <fabiusks AT gmail.com>
  • Cc: svadev AT cs.uiuc.edu
  • Subject: Re: [svadev] SAFECode's whole-program analysis features
  • Date: Tue, 8 May 2012 13:50:48 -0500
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev>
  • List-id: <svadev.cs.uiuc.edu>
  • Organization: University of Illinois

On 5/8/12 9:21 AM, Fábio Resner wrote: Yes I've already changed all the parameters but it keeps giving me the same error.

What I have in my /llvm/projects/safecode/Debug/lib is:

And just to be clear, you using -L/llvm/projects/safecode/Debug/lib on yoru clang command line, right?

You're also using the -use-gold-plugin option when you link the final executable, right?



clang                  libclangAnalysis.a    libclangDriver.a        libclangParse.a          libclangStaticAnalyzerCheckers.a  libdebuginstr.a         libLTO.so              libsc-support.a
libabc.a               libclangARCMigrate.a  libclangFrontend.a      libclangRewrite.a        libclangStaticAnalyzerCore.a      libformatstrings.a      liboob.a               libsoftbound.a
libaddchecks.a         libclangAST.a         libclangFrontendTool.a  libclangSema.a           libclangStaticAnalyzerFrontend.a  libgdtoa.a              liboptchecks.a         libsoftbound_rt.a
libbaggyboundscheck.a  libclangBasic.a       libclangIndex.a         libclangSerialization.a  libconvert.a                      libLLVMDataStructure.a  libpoolalloc_bitmap.a
libclang.a             libclangCodeGen.a     libclangLex.a           libclang.so              libcstdlib.a                      libLTO.a                libsc_dbg_rt.a

is this correct?

That looks correct.

One other thing you might need to do to use libLTO would be to copy LLVMgold.so from llvm/<build_type>/lib to safecode<build_type>/lib.  For some reason, I had to do this after a "make clean;" I don't think it's necessary if you do a "make install" to create an installed version of clang.

Otherwise, I'm not sure what the problem is.  Can you extract the contents of libsc_dbg_rt.a and run the file command on the .o files?  There's a small chance that something weird is happening like trying to link 32-bit libraries with a 64-bit executable or something weird like that.

Speaking of which, I assume you're compiling for x86_64?

-- John T.



On Tue, May 8, 2012 at 11:18 AM, John Criswell <criswell AT illinois.edu> wrote:
On 5/8/12 9:15 AM, Fábio Resner wrote:
Hi,

I'm having some trouble now while trying to compile with:

clang -flto -use-gold-plugin -fmemsafety -o file file1.o file2.o ... -L$PREFIX/lib

$PREFIX should be replaced with <place where you built SAFECode>/<build_type>/lib

For example, on my system with a Debug build, it's /home/criswell/box/x86/llvm/projects/safecode/Debug/lib.

-- John T.



/usr/bin/ld: error: cannot find -lsc_dbg_rt
/usr/bin/ld: error: cannot find -lpoolalloc_bitmap
/usr/bin/ld: error: cannot find -lgdtoa
lto-llvm.o-2wLqPD:ld-temp.o:function main: error: undefined reference to 'poolargvregister'
lto-llvm.o-2wLqPD:ld-temp.o:function main: error: undefined reference to 'pool_register_stack_debug'
lto-llvm.o-2wLqPD:ld-temp.o:function main: error: undefined reference to 'boundscheckui_debug'
lto-llvm.o-2wLqPD:ld-temp.o:function main: error: undefined reference to 'poolcheckui_debug'
lto-llvm.o-2wLqPD:ld-temp.o:function main: error: undefined reference to 'pool_register_debug'
lto-llvm.o-2wLqPD:ld-temp.o:function main: error: undefined reference to 'exactcheck2_debug'
lto-llvm.o-2wLqPD:ld-temp.o:function main: error: undefined reference to 'fastlscheck_debug'
lto-llvm.o-2wLqPD:ld-temp.o:function main: error: undefined reference to 'boundscheckui_debug'
lto-llvm.o-2wLqPD:ld-temp.o:function main: error: undefined reference to 'poolcheckui_debug'
lto-llvm.o-2wLqPD:ld-temp.o:function main: error: undefined reference to 'exactcheck2_debug'
lto-llvm.o-2wLqPD:ld-temp.o:function main: error: undefined reference to 'fastlscheck_debug'
lto-llvm.o-2wLqPD:ld-temp.o:function pool_ctor: error: undefined reference to 'pool_init_runtime'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

where ld is the ld-new.
How do I get those libraries installed?

Thanks,

On Mon, May 7, 2012 at 5:30 PM, Fábio Resner <fabiusks AT gmail.com> wrote:
It's working.

I've done the process again with the newest version of Bison and it runs fine.
Maybe I've done something with the old version which is running into problems.

Thanks,


On Mon, May 7, 2012 at 4:26 PM, Fábio Resner <fabiusks AT gmail.com> wrote:
No problems hehe,

maybe I'm doing something wrong!
And if it is really some kind of issue I'll report later!

Thanks,


On Mon, May 7, 2012 at 4:14 PM, John Criswell <criswell AT illinois.edu> wrote:
On 5/7/12 2:08 PM, Fábio Resner wrote: I'm pretty sure that I've done everything like the gold-plugin document,

but anyways I'll try the hole process again from the beginning and if I get to the same error
I'll try to post to llvmdev.

Thanks for your support!

Sorry I couldn't solve the gold problem.

-- John T.



On Mon, May 7, 2012 at 3:56 PM, John Criswell <criswell AT illinois.edu> wrote:
On 5/7/12 1:35 PM, Fábio Resner wrote:
Now I'm having problems while running $make all-gold

Here is the error message:

cc1plus: warnings being treated as errors
In file included from ../../src/gold/_expression_.cc:33:
../../src/gold/script-c.h:221: error: ‘yylex’ initialized and declared ‘extern’
../../src/gold/script-c.h:221: error: ‘YYSTYPE’ was not declared in this scope
../../src/gold/script-c.h:221: error: expected primary-_expression_ before ‘,’ token
../../src/gold/script-c.h:221: error: expected primary-_expression_ before ‘void’
../../src/gold/script-c.h:221: error: initializer _expression_ list treated as compound _expression_
make[3]: *** [_expression_.o] Error 1
make[3]: Leaving directory `/home/fabio/safecode/binutils/build/gold'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/fabio/safecode/binutils/build/gold'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/fabio/safecode/binutils/build/gold'
make: *** [all-gold] Error 2


I'm not sure what's wrong.  Did you use --enable-gold and --enable-plugins on the configure command line?

I think you should ask on llvmdev what might be wrong.  I can't tell what else might be the problem (as I don't recall having seen this error message before).

-- John T.



--
Fabio Resner.




--
Fabio Resner.



--
Fabio Resner.



--
Fabio Resner.




--
Fabio Resner.




Archive powered by MHonArc 2.6.16.

Top of Page