Skip to Content.
Sympa Menu

svadev - Re: [svadev] Link error with fmemsafety and boost

svadev AT lists.siebelschool.illinois.edu

Subject: Svadev mailing list

List archive

Re: [svadev] Link error with fmemsafety and boost


Chronological Thread 
  • From: John Criswell <criswell AT illinois.edu>
  • To: Matthew Wala <wala1 AT illinois.edu>
  • Cc: svadev AT cs.uiuc.edu
  • Subject: Re: [svadev] Link error with fmemsafety and boost
  • Date: Thu, 08 Sep 2011 22:12:25 -0600
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev>
  • List-id: <svadev.cs.uiuc.edu>
  • Organization: University of Illinois at Urbana-Champaign

On 9/8/2011 9:01 PM, Matthew Wala wrote:
It seems that something relating to the change you made breaks clang
for me whenever I try to compile a non-c++ file with -fmemsafety.

Can you send me test.c? I'll try to take a look at it first thing tomorrow morning.

-- John T.


$ llvm/projects/safecode/Release+Asserts/bin/clang -fmemsafety
-emit-llvm -S test.c
0 clang 0x0000000001c9bf3f
1 clang 0x0000000001c9cc57
2 libpthread.so.0 0x00007fbfb5c02c50
3 clang 0x00000000011051a6
llvm::RegisterRuntimeInitializer::insertInitializerIntoGlobalCtorList(llvm::Module&)
+ 870
4 clang 0x00000000011052d4
llvm::RegisterRuntimeInitializer::runOnModule(llvm::Module&) + 36
5 clang 0x0000000001bd5d97
llvm::MPPassManager::runOnModule(llvm::Module&) + 551
6 clang 0x0000000001bd5efb
llvm::PassManagerImpl::run(llvm::Module&) + 187
7 clang 0x00000000007dc642
clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 2466
8 clang 0x00000000007da48e
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) +
270
9 clang 0x0000000000930fbd clang::ParseAST(clang::Sema&, bool) +
365
10 clang 0x00000000007d8fa4 clang::CodeGenAction::ExecuteAction() +
68
11 clang 0x00000000006bad95
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 373
12 clang 0x000000000069feba
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1386
13 clang 0x000000000069434e cc1_main(char const**, char
const**, char const*, void*) + 862
14 clang 0x000000000069ece3 main + 7827
15 libc.so.6 0x00007fbfb4ec9e5d __libc_start_main + 253
16 clang 0x0000000000693e19
Stack dump:
0. Program arguments:
/home/vadve/wala1/llvm/projects/safecode/Release+Asserts/bin/clang
-cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -disable-free
-main-file-name test.c -mrelocation-model static -mdisable-fp-elim
-masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64
-target-linker-version 2.17.50.0.6 -momit-leaf-frame-pointer
-coverage-file test.s -resource-dir
/home/vadve/wala1/llvm/projects/safecode/Release+Asserts/bin/../lib/clang/3.0
-ferror-limit 19 -fmessage-length 168 -fmemsafety
-fdiagnostics-show-option -fcolor-diagnostics -o test.s -x c test.c
1. <eof> parser at end of file
2. Per-module optimization passes
3. Running pass 'Register runtime initializer into programs' on module
'test.c'.
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal 2 (use -v to
see invocation)
clang: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all
diagnostic information.
clang: note: diagnostic msg: Preprocessed source(s) are located at:
clang: note: diagnostic msg: /tmp/test-04h2Cz.i


On Thu, Sep 8, 2011 at 2:24 PM, John
Criswell<criswell AT illinois.edu>
wrote:
Dear Paul,

I figured out what the problem was and fixed it. You can get the fix by
updating from the public subversion repository.

As an FYI, I filed this as a bug (PR 10894).

Please let me know if it still causes problems.

-- John T.


On 9/8/11 10:24 AM, Paul Bombach wrote:

Hello:

I'm having problems linking multiple modules that include any boost
algorithm headers. In particular, when I have two modules that include
<boost/algorithm/string.hpp> in more than one module, I get the following
link error.

clang version 3.0 (:
http://llvm.org/svn/llvm-project/safecode/trunk/tools/clang)
Target: x86_64-apple-darwin11.0.0
Thread model: posix
clang: warning: argument unused during compilation: '-fmemsafety'
"/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld" -demangle
-dynamic -arch x86_64 -macosx_version_min 10.7.0 -o fmem.exe -lcrt1.10.6.o
-L/Users/pmb/Projects/safecode/lib fmem.o subroutine.o -lsc_dbg_rt
-lpoolalloc_bitmap -lstdc++ -lstdc++ -lSystem
ld: duplicate symbol ___unnamed_1 in subroutine.o and fmem.o for
architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)

The compilation and linking commands that I use are:

#!/bin/bash
PATH=$SAFECODEDIR/bin
/usr/local/llvm/bin/clang++ -g
-I/Volumes/Workspaces/2.5alpha2-memsafe/crs/3rd-party/include -fmemsafety -c
fmem.cpp -o fmem.o
/usr/local/llvm/bin/clang++ -g
-I/Volumes/Workspaces/2.5alpha2-memsafe/crs/3rd-party/include -fmemsafety -c
subroutine.cpp -o subroutine.o
/usr/local/llvm/bin/clang++ -v -o fmem.exe -fmemsafety fmem.o
subroutine.o -L$SAFECODEDIR/lib -lsc_dbg_rt -lpoolalloc_bitmap -lstdc++

I've attached the modules fmem.cpp and subroutine.cpp that are causing the
problems. Thanks in advance for any help.

pmb







_______________________________________________
svadev mailing list
svadev AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/svadev


_______________________________________________
svadev mailing list
svadev AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/svadev







Archive powered by MHonArc 2.6.16.

Top of Page