Sun Workshop 5.0, linking with libC and libCrun

Sun Workshop 5.0, linking with libC and libCrun

Post by Jeffrey Ladouceu » Mon, 24 Jul 2000 04:00:00



backround info: I'm building an application in standard compat=5 mode, Sun
Workshop 5.0
  I have a set of 3rd party libraries which were built with Sun Workshop 4.2
  These libraries depend in libC. My application depends on libCrun.

  Question: Does it make sense to link both libC and libCrun ?

  When I try and link both libC and libCrun, I get multiply defined symbols,
ie  _ex_register defined in
both libC and libCrun.

Thanks in advance.

Jeff

 
 
 

Sun Workshop 5.0, linking with libC and libCrun

Post by Thomas Deh » Mon, 24 Jul 2000 04:00:00



> backround info: I'm building an application in standard compat=5 mode, Sun
> Workshop 5.0
>   I have a set of 3rd party libraries which
> were built with Sun Workshop 4.2
>   These libraries depend in libC. My application depends on libCrun.

>   Question: Does it make sense to link both libC and libCrun ?

>   When I try and link both libC
> and libCrun, I get multiply defined symbols,
> ie  _ex_register defined in
> both libC and libCrun.

Linking together ARM (4.2 or -compat=4) C++ code
and ANSI/ISO (5.0 with -compat=4) C++ code will
usually *not* work, because of duplicate or
unresolved symbols at various places (the ABI is different).

The only way you could possibly get this to work is
- exception handling only either in the -compat=4 or the
  -compat=5 part of the code (otherwise
   duplicate symbols here, too)
- the interface between both parts is a pure C interface

Compare the C++ migration guide

Thomas

 
 
 

Sun Workshop 5.0, linking with libC and libCrun

Post by Jeffrey Ladouceu » Mon, 24 Jul 2000 04:00:00



Quote:> The only way you could possibly get this to work is
> - exception handling only either in the -compat=4 or the
>   -compat=5 part of the code (otherwise
>    duplicate symbols here, too)
> - the interface between both parts is a pure C interface

> Compare the C++ migration guide

Interface description:
Apllication code ( compat=5) invokes extern "C" functions ( which are built
in mode=4).
These extern "C" function are the only place where the 3rd party library
calls are invoked.

Exception handling:
Exeption handling is being used in both parts of the code.  But the extern
"C" functions never
throw an exception and they should catch all exceptions.  However, this is
what I don't
understand.  In the "C++ migration guide, section Mixing Old and New
Binaries" it specifies that
..."No C++ exceptions escape from or are passed into the library"

I believe this is satisfied since it is the extern "C" functions ( compat=4)
which catch the exception being
thrown by the 3rd party libraries. The extern "C" functions translate the
exception into a return code to
the application.

Esentially the C++ Migration Guide does not specify that exception handling
can only be used
in only one part of the code.  Is Sun documention wrong ?  Maybe I have to
use special linking
order. Something like:

link application_code.o -lCrun externCfunctions.o -l3rdPartyLibs.a -lC

Regards,

Jeff

 
 
 

Sun Workshop 5.0, linking with libC and libCrun

Post by Thomas Deh » Mon, 24 Jul 2000 04:00:00





> > The only way you could possibly get this to work is
> > - exception handling only either in the -compat=4 or the
> >   -compat=5 part of the code (otherwise
> >    duplicate symbols here, too)
> > - the interface between both parts is a pure C interface

> > Compare the C++ migration guide

> Interface description:
> Apllication code ( compat=5) invokes
> extern "C" functions ( which are built in mode=4).
> These extern "C" function are the only place where the 3rd party library
> calls are invoked.

Also no objects can be passed as parameters to those
functions etc. pp.

Quote:> Exception handling:
> Exeption handling is being used in both parts of the code.
> But the extern "C" functions never
> throw an exception and they should catch all exceptions.

This is insufficient.
-compat=4 and -compat=5 create internal symbols
for the exception handling some of which will have the same
names.

Quote:> Esentially the C++ Migration Guide does
> not specify that exception handling can only be used
> in only one part of the code.  Is Sun documention wrong ?

This issue is documented only incompletely
in the C++ Migration Guide from C++ 5.0,
but correctly somewhere in the C++ 5.1 documentation.

Thomas

 
 
 

1. Sun Workshop 5.0 CC generates runtime dependency on libCrun.so

Hi,

Background:
In two different sites, we are building the same C++ program. At each site,
the program is being built on a Solaris 5.6 machine, using the Sun Workshop
Pro C++ compiler, version 5.0. One of the resulting executables has a
dynamic dependency on libCrun.so, while the other doesn't. In both cases,
the same flags are being passed to the compiler when linking. There is no
explicit mention of libCrun (i.e. no -lCrun) on the link line.

Can anyone suggest what might be causing this dependency to occur in one
site and not the other?

Thanks,

James

2. Win98+Debian+LFS triple boot setup howto?

3. Sun WS C++ 5.0: broken libCrun?

4. test

5. Compilation Problem: solaris 5.7 and Sun Workshop 5.0

6. Incorrect CRC Packet

7. Sun workshop 5.0 and rogue wave??

8. Redirection Question

9. Sun Workshop 5.0 Developer Release licensing issue!

10. Sun Workshop 5.0

11. Need help to run SUN Workshop 5.0 beta (problems to run solaris license manager)

12. Sun Workshop 5.0

13. precompiled headers for sun workshop 5.0 / Namespaces / Merge IDLs