This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Compiling stdc++ with strong symbol versioning
- From: Michael Dehmlow <dehmlowm at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 21 May 2009 15:00:11 -0700 (PDT)
- Subject: Re: Compiling stdc++ with strong symbol versioning
- References: <23618767.post@talk.nabble.com>
Michael Dehmlow wrote:
>
> Hello I'm relatively new to gcc development and I'm having trouble with
> different versions of libstdc++.so being used at runtime. Basically I'm
> creating an api which is used by a third party application (labview) which
> uses libstdc++.so.5 my api needs to be compiled with libstdc++.so.6.
> basically when every I run something like this:
>
> std::string b = "bee";
> std::string c = "see";
>
> std::string a = b + c;
>
> I get runtime crash because as far as I can tell the b+c string is
> allocated with the 6 allocate symbol and deallocated with the 5 dealloc
> symbol.
>
> This issue is detailed in the following gcc bug:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21405
> The resolution appears to be detailed in
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24660
>
> As far as I can tell (PLEASE tell me if I'm mistaken) I need to recompile
> either my gcc compiler (version 4.1.2) or the stdlibc++.so.6 with the
> --enable-symvers=gnu-versioned-namespaces flag then recompile my
> application with the new compiler/ stdc++ library.
>
> So my question is how do I do this? Do I need to recompile just my stdc++
> library or my entire gcc compiler is this documented some where.
>
So I've tried to recompile gcc the following versions of gcc with the
--enable-symvers=gnu-versioned-namespace flag I've also tested
--enable-symvers=gnu-versioned-namespaces (with the s) there seems to be
confusion on which it actually is...
gcc-4.1.2
gcc-4.2.0
gcc-4.2.1
gcc-4.3.0
gcc-4.3.2
All failed with the following error:
configure: error: Unknown argument to enable/disable symvers
make[1]: *** [configure-target-libgomp] Error 1
With the exception of 4.12 which failed as follows:
configure: error: Unknown argument to enable/disable symvers
make[1]: *** [configure-target-libstdc++-v3] Error 1
I also was able to compile 3.3 which fixed my problem... accept that boost
threads appear not to support gcc-3.3.
So my only hope is the versioning of weak symbols.
According to http://gcc.gnu.org/ml/gcc-bugs/2008-05/msg00058.html this is
known to work in 4.2.4 and 4.1.2 BOTH of which I have tried and seen fail...
which leads me do believe I am doing somthing wrong perhaps any thoughts:
../gcc-4.1.2/configure --enable-symvers=gnu-versioned-namespace
--enable-Languages=c,c++
../gcc-4.1.2/configure --enable-symvers=gnu-versioned-namespaces
--enable-Languages=c,c++
../gcc-4.1.2/configure --enable-symvers=gnu-versioned-namespace
../gcc-4.1.2/configure -enable-symvers=gnu-versioned-namespaces
--
View this message in context: http://www.nabble.com/Compiling-stdc%2B%2B-with-strong-symbol-versioning-tp23618767p23660942.html
Sent from the gcc - Help mailing list archive at Nabble.com.