[comp.sources.wanted] gcc with shared libraries support on suns ?

axel@guug.de (Axel Bauer) (02/26/91)

hello there...

is there a version of gcc and g++ with shared library support available
for suns ?

				greetings, axel



-- 
  Axel Bauer, axel@guug.de

 And what have you got at the end of the day ?
 What have you got to take away ? 

fischer@iesd.auc.dk (Lars P. Fischer) (03/01/91)

Axel> is there a version of gcc and g++ with shared library support available
Axel> for suns ?

For GCC, do the following:

	cd ...../gnu/lib	# where you keep gnu-ld and friends
	ln -s /bin/ld gcc-dynld

Now, call gcc with

	gcc -bdyn file.c -o file

The trick here is that -bxxx makes gcc search for lib files (cpp, ld,
etc) with names gcc-xxxXX before gcc-XX.

For G++ you are, as yet, out of luck, as Sun's linker does not grok
the binaries produced by G++.

If you do not use G++, you can install Sun's linker as gcc-ld. If you
wan't to use G++ and still avoid the -bdyn stuff, you can make G++
look for file with prefix "g++-" instead of "gcc-". To do this, look
for lines like
  -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-\"
in the Makefile and change to
  -DSTANDARD_EXEC_PREFIX=\"$(libdir)/g++-\"
This way, changing the linker for GCC will not affect G++. Note that
you will the have to store files like gcc-cpp twice or make g++-cpp a
link to gcc-cpp.

Currently, I am considering changing the setup, so that the linker
for gcc-1.39 is stored in .../gnu/lib/gcc-1.39/ld and so on. This
would allow me to have several versions of GCC and, especially, G++,
installed at a time. Unfortunately, you have to change the Makefile in
quite a number of places for this to work.

/Lars
--
Lars Fischer,  fischer@iesd.auc.dk   | Beauty is a French phonetic corruption
CS Dept., Univ. of Aalborg, DENMARK. |                   - FZ