Hi, all,
Today I started working on rebuilding Inkscape with static C++ libs. Here are the things I performed:
1) Rebuilt gcc with --enable-languages=c,c++ --disable-shared
This resulted in a libstdc++.la file like this: =========== SNIP ============== # libstdc++.la - a libtool library file # Generated by ltmain.sh - GNU libtool 1.4a-GCC3.0 (1.641.2.256 2001/05/28 20:09:07 with GCC-local changes) # # Please DO NOT delete this file! # It is necessary for linking the library.
# The name that we can dlopen(3). dlname=''
# Names of this library. library_names=''
# The name of the static archive. old_library='libstdc++.a'
# Libraries that this one depends upon. dependency_libs=' -lm -L/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.2 -L/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.2/../../.. -lgcc -lc'
# Version information for libstdc++. current=6 age=0 revision=2
# Is this an already installed library? installed=yes
# Files to dlopen/dlpreopen dlopen='' dlpreopen=''
# Directory that this library needs to be installed in: libdir='/usr/local/lib' ================ SNIP ===================
2. ) I built boehm-gc6.3 with:
--enable-static --disable-shared --enable-cplusplus
3.) I built libsigc++-2.06, glibmm-2.4.5, gtkmm-2.4.6 with: --enable-static --disable-shared
4.) I did a new ./configure, a 'make clean', and a 'make' It successfully produced an Inkscape with these dependencies:
[rjamison@...556... src]$ ldd ./inkscape linux-gate.so.1 => (0x00111000) libgtk-x11-2.0.so.0 => /usr/local/lib/libgtk-x11-2.0.so.0 (0x00b34000) libgdk-x11-2.0.so.0 => /usr/local/lib/libgdk-x11-2.0.so.0 (0x004df000) libatk-1.0.so.0 => /usr/local/lib/libatk-1.0.so.0 (0x00613000) libgdk_pixbuf-2.0.so.0 => /usr/local/lib/libgdk_pixbuf-2.0.so.0 (0x00ea5000) libpangoxft-1.0.so.0 => /usr/local/lib/libpangoxft-1.0.so.0 (0x00112000) libpangox-1.0.so.0 => /usr/local/lib/libpangox-1.0.so.0 (0x00437000) libpng.so.3 => /usr/local/lib/libpng.so.3 (0x00701000) libpopt.so.0 => /usr/lib/libpopt.so.0 (0x005bc000) libXft.so.2 => /usr/X11R6/lib/libXft.so.2 (0x00220000) libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x00117000) libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x001df000) libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x001e7000) libpangoft2-1.0.so.0 => /usr/local/lib/libpangoft2-1.0.so.0 (0x007c8000) libpango-1.0.so.0 => /usr/local/lib/libpango-1.0.so.0 (0x00232000) libgobject-2.0.so.0 => /usr/local/lib/libgobject-2.0.so.0 (0x0026a000) libgmodule-2.0.so.0 => /usr/local/lib/libgmodule-2.0.so.0 (0x0059c000) libdl.so.2 => /lib/libdl.so.2 (0x0020e000) libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x002a9000) libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00328000) libz.so.1 => /usr/lib/libz.so.1 (0x0038d000) libpthread.so.0 => /lib/tls/libpthread.so.0 (0x0039e000) libm.so.6 => /lib/tls/libm.so.6 (0x003b0000) libc.so.6 => /lib/tls/libc.so.6 (0x007ef000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00abf000) libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0x0021b000) libXinerama.so.1 => /usr/X11R6/lib/libXinerama.so.1 (0x025c6000) libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x003d3000) libexpat.so.0 => /usr/lib/libexpat.so.0 (0x003e1000)
...as you can see there are no C++ dependencies! Most of the others would be on every Linux machine. Some, like the X libs and Glib/Gtk, are dynamic-only, as they load other libs dynamically.
5.) Now here's a PROBLEM!!! Do we really use the C++ part of Boehm-GC? I would like to remove that dependency. Because when we make the gimpgrad.so plugin, our use of static libs gives us duplicate symbol errors. This is similar to Win32 DLL's, in that when you make a standalone shared object, everything must be defined explicitly, unlike in an executable. Can we remove libgccpp.a as a dependency? I think Mental has wrappers around the C part instead. Below is the link error with gimpgrad.so.
Anyway, that's how it goes so far. I hope others will give this a try.
Cheers!
Bob
=============== SNIP ===================== g++ -shared -nostdlib /usr/lib/crti.o /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.2/crtbeginS.o extension/plugin/.libs/gimpgrad.o -Wl,--whole-archive /usr/local/lib/libgc.a /usr/local/lib/libgccpp.a /usr/local/lib/libstdc++.a -Wl,--no-whole-archive -L/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.2 -L/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.2/../../.. -lm -lc -lgcc /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.2/crtendS.o /usr/lib/crtn.o -Wl,-soname -Wl,libgimpgrad.so.0 -o extension/plugin/.libs/libgimpgrad.so.0.0.0 /usr/local/lib/libstdc++.a(new_op.o)(.text._Znwj+0x0): In function `operator new(unsigned int)': ../../../../libstdc++-v3/libsupc++/new_op.cc:42: multiple definition of `operator new(unsigned int)' /usr/local/lib/libgccpp.a(gc_cpp.o)(.text+0x0):/home/rjamison/xmingw/gc6.3/gc_cpp.cc:29: first defined here /usr/bin/ld: Warning: size of symbol `operator new(unsigned int)' changed from 9 in /usr/local/lib/libgccpp.a(gc_cpp.o) to 127 in /usr/local/lib/libgccpp.a(gc_cpp.o) /usr/local/lib/libstdc++.a(new_opv.o)(.text._Znaj+0x0): In function `operator new[](unsigned int)': ../../../../libstdc++-v3/libsupc++/new_opv.cc:35: multiple definition of `operator new[](unsigned int)' /usr/local/lib/libgccpp.a(gc_cpp.o)(.text+0x20):/home/rjamison/xmingw/gc6.3/gc_cpp.cc:37: first defined here /usr/bin/ld: Warning: size of symbol `operator new[](unsigned int)' changed from 9 in /usr/local/lib/libgccpp.a(gc_cpp.o) to 40 in /usr/local/lib/libgccpp.a(gc_cpp.o) /usr/local/lib/libstdc++.a(del_op.o)(.text._ZdlPv+0x0): In function `operator delete(void*)': ../../../../libstdc++-v3/libsupc++/del_op.cc:38: multiple definition of `operator delete(void*)' /usr/local/lib/libgccpp.a(gc_cpp.o)(.text+0x10):/home/rjamison/xmingw/gc6.3/gc_cpp.cc:32: first defined here /usr/bin/ld: Warning: size of symbol `operator delete(void*)' changed from 9 in /usr/local/lib/libgccpp.a(gc_cpp.o) to 23 in /usr/local/lib/libgccpp.a(gc_cpp.o)/usr/local/lib/libstdc++.a(del_opv.o)(.text._ZdaPv+0x0): In function `operator delete[](void*)': ../../../../libstdc++-v3/libsupc++/del_opv.cc:35: multiple definition of `operator delete[](void*)' /usr/local/lib/libgccpp.a(gc_cpp.o)(.text+0x30):/home/rjamison/xmingw/gc6.3/gc_cpp.cc:40: first defined here /usr/bin/ld: Warning: size of symbol `operator delete[](void*)' changed from 9 in /usr/local/lib/libgccpp.a(gc_cpp.o) to 19 in /usr/local/lib/libgccpp.a(gc_cpp.o) collect2: ld returned 1 exit status make: *** [extension/plugin/libgimpgrad.la] Error 1 [
participants (1)
-
Bob Jamison