libstdc++.la empty

For any others that are struggling to use libtool with the included GNU build tools in Solaris 10:

It appears as though someone left out a proper libstdc++.la in /usr/sfw/lib and /usr/sfw/lib/64.

Try these:

/usr/sfw/lib/libstdc++.la

-

# 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 deletethis file!

# It is necessaryfor linking the library.

# The name that we can dlopen(3).

dlname='libstdc++.so.6'

# Names ofthis library.

library_names='libstdc++.so.6.0.3 libstdc++.so.6 libstdc++.so'

# The name of thestatic archive.

old_library='libstdc++.a'

# Libraries thatthis one depends upon.

dependency_libs='-lc -lm -L/usr/sfw/lib -lgcc_s'

# Version informationfor libstdc++.

current=6

age=0

revision=3

# Isthis an already installed library?

installed=yes

# Files to dlopen/dlpreopen

dlopen=''

dlpreopen=''

# Directory thatthis library needs to be installed in:

libdir='/usr/sfw/lib'

-

and

/usr/sfw/lib/64/libstdc++.la

-

# 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 deletethis file!

# It is necessaryfor linking the library.

# The name that we can dlopen(3).

dlname='libstdc++.so.6'

# Names ofthis library.

library_names='libstdc++.so.6.0.3 libstdc++.so.6 libstdc++.so'

# The name of thestatic archive.

old_library='libstdc++.a'

# Libraries thatthis one depends upon.

dependency_libs='-L/lib/64 -lc -lm -L/usr/sfw/lib/64 -lgcc_s'

# Version informationfor libstdc++.

current=6

age=0

revision=3

# Isthis an already installed library?

installed=yes

# Files to dlopen/dlpreopen

dlopen=''

dlpreopen=''

# Directory thatthis library needs to be installed in:

libdir='/usr/sfw/lib/64'

-

Remove the leading and trailing "-".

/kristofer

[3164 byte] By [Kristofer.Spinka] at [2007-11-26 0:45:50]
# 1
Thank you for this posting!!!
geonjay at 2007-7-5 19:41:10 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 2
Thankyou. That did the job perfectly on my Solaris 10 release install on Sparc.Cheers,Chris Miles http://chrismiles.info/
chrismiles at 2007-7-5 19:41:11 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 3
Thanks. This is also needed when bootstrapping OpenPKG (www.openpkg.org)
snejk at 2007-7-5 19:41:11 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 4
excellent; thanks. I'm now able to build pcre on sol-10-u1-ga-x86 too.
stwerboglitznib at 2007-7-5 19:41:11 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 5
How can i use this?Do I edit a file named libstdc++.la and put it in /usr/sfw/lib ?
cheung at 2007-7-5 19:41:11 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 6
Dear Kristofer,I am getting error "libstdc++.la' is not a valid libtool archive"kindly help me getting over this erroThanksHarshal
harshalrokade at 2007-7-5 19:41:11 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 7

The best solution for this problem would be not to have the /usr/sfw directory (and software in related directories) automatically installed. Users should be allowed to _not_ install /usr/sfw. However, there is a serious problem with Solaris 10 that some of the core utilities (i.e., pkgadd/pkgrm for two, are dynamically linked to GNU software, libopenssl.so and libgcc_s.so) such that its installation is required. These utilities should definitely not be dependent on 3rd party software, or if they are, should be statically linked, so that other versions of these packages could be installed without conflicts. There is no reason to have multiple versions of 3rd party sotfware installed to satisfy core O/S utility dependencies.

joele54 at 2007-7-5 19:41:11 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 8
Thanks a ton for this! Much appreciated.
fsharp at 2007-7-5 19:41:11 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 9

Question: how can I use this workaround without root privileges? I.e., I've put the libstc++.la file in ~/lib, but I'm having a tough time getting libtool to look there. I tried putting ~/lib first in LD_LIBRARY_PATH, to no avail. I wasn't able to figure out where to hard-code something into the libtool script that wouldn't break its search for other .la files.

Any help appreciated--I'm trying to compile mysql 5.0 on solaris 10.

Thanks!

--Rob

libtool: link: `/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/../../..//libstdc++.la' is not a valid

libtool archive

*** Error code 1

make: Fatal error: Command failed for target `udf_example.la'

fishstik at 2007-7-5 19:41:11 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 10

OK, after reading the configure script help output again, I tried this before running "./configure --prefix=...", and the compile of mysql 5.0 worked flawlessly:

$ export LDFLAGS='-L~/lib'

Thanks again--this thread definitely got me thinking in the right direction!

--Rob

fishstik at 2007-7-5 19:41:11 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 11
awesome, thanks for this. Just like stwerboglitznib above, I can build pcre.
nahun at 2007-7-5 19:41:11 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 12

I don't believe this is correct. pkgadd/pkgrm are not linked against any libraries in /usr/sfw.

I've check ldd on my system and they don't show up.

What your probably seeing is that libraries that are picked up the dynamic linker can induce further dependencies.

So whats probaly happening is that theres a library in /usr/sfw/lib with the same name as a standard library and that sfw version of the library has dependencies on libgcc_s.so.

So if you add /usr/sfw/lib to your ldd library path and then do a ldd, the ldd will suddenly show dependencies on /usr/sfw/lib that arent really there...

robertcohen at 2007-7-5 19:41:11 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 13
Whoops, my bad.pkgadd is linked against /usr/sfw/lib/libssl.so.0.9.7 and /usr/sfw/lib/libcrypto.so.0.9.7but on my system, libgcc_s.so doesnt show up in the depencies.Anyway just linking against anything in /usr/sfw/lib is a problem that should be corrected.
robertcohen at 2007-7-5 19:41:11 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 14
<quote>## Please DO NOT delete this file!# It is necessary for linking the library.<unquote>good joke !
dietermontanezb at 2007-7-5 19:41:11 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 15
FYI, I've requested a patch from sun on this for both sparc and intel.
jvines999a at 2007-7-21 14:36:59 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 16
patches 123647-01 (sparc) and 123648-01 (intel).
jvines999a at 2007-7-21 14:37:00 > top of Java-index,Solaris Operating System,Solaris 10 Features...