← Back to team overview

kicad-developers team mailing list archive

Re: Re: libstdc++

 

jean-pierre.charras@... wrote:


Dick Hollenbeck a écrit :



Good point. But I was thinking that Jean Pierre was statically linking
in the wxWidgets libraries to the apps. If not, I don't see how he has
gotten as far as he has with these "universal x86 linux binaries".

Of course, wxWidgets is linked statically (and it is also patched)
Preinstalled wxWidgets versions (when exist) never work.
I tried to link statically libsupc++ (under Ubuntu 9.10 and GCC 4.4), and I was lucky! it worked:
1 - Locate libsupc++.a and add it to libs list
2 - use gcc instead of g++ to call the linker.

Note: I used my old makefiles to test that, because it was more easier to quickly test different link options.

I now must test binaries under different Linux distribs.



For the historical record, even though you Jean-Pierre may not need this:

for Ubuntu 9.10 x86_64, these statically linkable libraries, libstd++ and libsupc++, are in package libstd++6-4.4-dev


/usr/lib/gcc/x86_64-linux-gnu/4.4/libstdc++.a
/usr/lib/gcc/x86_64-linux-gnu/4.4/libsupc++.a


For 32 bit systems, replace the /x86_64-linux-gnu with i486-linux-gnu.


However, I wonder if you even need to know the path?


I thought I found an interesting posting here and linker command line described here:



http://www.codesynthesis.com/~boris/blog/2006/12/10/statically-linking-on-aix/



as this:

g++ -static-libgcc ... -Wl,-bstatic -lstdc++ -Wl,-bdynamic -lsupc++



HOWEVER, I don't think the original poster got the lsupc++ correctly as static. Should it not be:

g++ -static-libgcc ... -Wl,-Bstatic -lstdc++ -lsupc++ -Wl,-Bdynamic


Jean-Pierre, you really do not need your make files. All you need to do is capture the last line of each CMake command, by running it as

$ make VERBOSE=1

to see how g++ is being invoked to perform the link for each program binary. Then you can cut and paste that command into a shell script (along with any preceding directory change), and edit the script to do what is described above with respect to the two libraries.


This is not my can of worms, so I am going to back away now.

There are two solutions on the table, and either seems good and clear.


Dick







References