Re: default cflags to compile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 13 Dec 2005, Nuno Lopes mused:
>> On Mon, 12 Dec 2005, Nuno Lopes stipulated:
>>> Update: I've tried to compile some sample sources, but linking has failed with:
>>
>> Yeah, linking two libraries using incompatible versions of libstdc++
>> will be tricky, requiring linking against *both* copies using -Bgroup.
>> (It's best to experiment using little testbed shared libraries exporting
>> symbols of the same name, printing out different things from each shared
>> library, until you grasp how -Bgroup works. It can be counterintuitive.)
> 
> But I supposed that compiling it with proper -fabi-version would do the trick..

If you do that *and* point the libstdc++.so symlink to libstdc++.so.5, you
should be OK. (I didn't think of that. Oops.)

>> To describe this as `unsupported and risky' would be like describing the
>> ocean as `slightly damp' or the recent oil fire in Hertfordshire as `a
>> little warm'. Your *safe* options are to get Sony to provide a later
>> version of this library --- or, better, a version with a C interface, so
>> that you can be sure that no libstdc++ objects leak out of it --- or to
>> stick with GCC 3.3.x.
> 
>:) I couldn't find much documentation about it either.

That's because it's so unsupported that I know of I think three
occasions when it's been done.

>> (If the Sony library only *has* a C interface, the -Bgroup trick should
>> work, I think.)
> 
> Nop, sony's lib is C++ only. We even have to extend some classes that are provided by them.

OK, in that case you'd have almost no chance of making that work. Oh well,
it was an awful kludge anyway.

> So, resuming:
> 1. compile libstdc++ from gcc 3.3.6 (can I compile the lib alone?)
> 2. compile gcc & libstdc++ from gcc 4
> 3. link sony's lib with 1. (how?)
> 4. link our code with 2. (how?)
> 5. link both 3. and 4. with the -Bgroup trick together (how?)
> 
> BTW, and what if I replace the libstdc++ that comes with gcc 4 with
> gcc 3.3's lib? Shouldn't it work?

If you repoint the .so (no need to do anything with the .so.[56] files
themselves) and use the right -fabi-version, everything should just
work, I hope. (I didn't think of that, even though in hindsight it's
bloody obvious. Ah well. It's *much* more likely to work than messing
with -Bgroup.)

-- 
`I must caution that dipping fingers into molten lead
 presents several serious dangers.' --- Jearl Walker

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux