Skip to Content.
Sympa Menu

svadev - [svadev] fmemsafety option and optimization level

svadev AT lists.siebelschool.illinois.edu

Subject: Svadev mailing list

List archive

[svadev] fmemsafety option and optimization level


Chronological Thread 
  • From: Krzysztof Cieniuch <cieniuch77 AT gmail.com>
  • To: svadev AT cs.uiuc.edu
  • Subject: [svadev] fmemsafety option and optimization level
  • Date: Thu, 18 Jul 2013 17:35:45 +0100
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev/>
  • List-id: <svadev.cs.uiuc.edu>

Hi,

I'm using CentOS 6.3, clang version 3.2 with latest ld checked out from cvs
I followed instructions on wiki and installed clang with lto (gold plugin)

I'm having troubles compiling this simple program:

#include<string>
#include<map>
#include<iostream>

using namespace std;
int main(int argc,char** argv){
map<string,int> themap;
string test(argv[0]);

themap["key1"]=1;
cout << test << endl;

return 0;
}

clang++ -g -O2 -flto -use-gold-plugin -fmemsafety -o main main.cc -L /opt/SAFECode/lib

FIXME: Ignoring global of size zero: @_ZNSs4_Rep20_S_empty_rep_storageE = external global [0 x i64]
lto-llvm.o-O8q9Q2:ld-temp.o:TargetList: error: undefined reference to 'std::string::_S_compare(unsigned long, unsigned long)'
lto-llvm.o-O8q9Q2:ld-temp.o:TargetList1: error: undefined reference to 'std::string::_S_compare(unsigned long, unsigned long)'

If I remove -O2 option it links fine.
What's strange if you comment out line: themap["key1"]=1; it will compile.
What even more strange :-) if you comment out: cout << test << endl; instead it will also compile any ideas ?
Is this bug in clang ld or libstdc++ on centos 6.3 or combination of all.

Thanks
Krzysztof




Archive powered by MHonArc 2.6.16.

Top of Page