Egor Pasko wrote:
On the 0x245 day of Apache Harmony Geir Magnusson, Jr. wrote:
There's been some comment on the fact that I'm using GCC v4.x for the
em64t builds, requiring users of the snapshot to use libstdc++ v6.
Is this a real problem? Shouldn't we be using the newest major
version of gcc for our builds?
I found a relatively simple approach in [1] (but supposedly not
universal):
shell> ln -s `g++ -print-file-name=libstdc++.a`
shell> g++ -static-libgcc -L. -o example example.cpp
works on my em64t on a simple test. Modifying the build is quing to be
somewhat painful. Volunteers wecome!
[1] Linking libstdc++ statically
http://www.trilithium.com/johan/2005/06/static-libstdc/
I am afraid we'll hit the same problem with static linking on x86_64 as
we had with static libjpeg, libpng and liblcms. The libstdc++.a library
in most distributions is likely built without -fPIC because it is
required only for shared libraries.
While it is usually possible to create a shared library on x86 linking
it against static libraries built without -fPIC on x86, on x86_64 it
seems to just never work.
The solution for classlib natives which need libjpeg, libpng and liblcms
libraries could be to have our own specially compiled static libraries
which are built with -fPIC. But now if we'll need a special build of
gcc, it may be too much.
--
Gregory