On 03/14/2012 03:46 PM, Volker Simonis wrote:
> I know this is an age-old thread, but I've just stumbled over this issue
> and thought I write my two pence down as well in case anybody else
> will ever have a similar problem:
>
> In general I agree that it is advisable to dynamically link libgcc, but one
> real problem it creates is the fact that it prevents you from building on an
> old OS version with a new version of GCC.
>
> This was exactly the problem I was running into: I built on SuSE 9 with
> a self-compiled GCC 4.1. There's no problem with the HotSpot which is
> still statically linked to libgcc as mentioned by Martin, but once the JDK
> loads for example libfontconfig.so it will crash, because libfontconfig.so
> is dynamically linked against the newer libgcc from GCC 4.1 which is not
> available on SuSE 9.
>
> So for JDK8 we should at least align the way how we link libgcc between
> all the shared libraries of the JDK (either way:).

Yes, but the right answer is not to statically link against libgcc.
A mismatch between libgcc and glibc can lead to some horridly hard to
debug problems in exception handling, for example.

The simple rule is to use your system compiler; and if you don't,
you'll need to copy libgcc onto machines you want to run on.  Even
then, there might be problems if the libc on the machine you want to
run on isn't compatible with the libgcc you've built.  We try our
utmost to make odd mixtures work, but there are limits to what is
possible.

Andrew.

Reply via email to