Mixing shared libs for different architectures

Mixing shared libs for different architectures

Post by Kasper van Wo » Sat, 22 Jan 2000 04:00:00

I'm trying to use a shared library that has been compiled for the v8+
architecture and the UltraSPARC processor in an application that is
compiled for generic Sparc architectures:

  $ uname -a
  SunOS orion 5.6 Generic_105181-05 sun4u sparc SUNW,Ultra-5_10
  $ cc -V
  cc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2
  $ cc -c vis.il -xchip=ultra -xarch=v8plusa vis.c
  $ cc -G vis.o -o vis.so
  $ cc -c vistest.c
  $ cc vistest.o vis.so -o vistest
  $ file vistest
  vistest:        ELF 32-bit MSB executable SPARC Version 1, dynamically \
  linked, not stripped
  $ file vis.so
  vis.so:         ELF 32-bit MSB dynamic lib SPARC32PLUS Version 1, V8+ \
  Required, UltraSPARC1 Extensions Required, dynamically linked, not stripped

When I run this code on an Ultra 10, I get the following runtime error:

  $ ./vistest
  ./vistest: Exec format error. Wrong Architecture.

Why does run-time linker refuse to link the SPARC32PLUS library?
The only way I can get the code to execute, is to compile all other object
files and libraries that are linked in the application for SPARC32PLUS V8+
too (which I'd rather not do).

                             "Most people would rather die than think.
                              ...In fact, they do." --Bertrand Russell


1. Mixing c++ libs from different compilers

We're using AIX 4.1.4. We have some shared libraries that
were built with AIX C++ We are using C interfaces
to the libraries; that is, they have a C api.

We are using gnu gcc 2.8.1 as our compiler. While we can link
to the libraries, the C++ code they contain cores during object
creation in response to out first call.

Is there _any_ way to get this to work?


David R Clarke                  |  "Security for an OPEN World"
Product Development Group       |  For IT security solutions for
SAGUS Security Incorporated     |   the enterprise, visit
613-234-7300 Ext 237            |  http://www.sagus-security.com

2. Automatically nicing background jobs.

3. Mixing GCC (libg++) and X11 shared libs ?

4. transparent proxy on FreeBSD with squid and ipfw

5. linking (mixing shared libs and static archives)

6. FS Motorola ISDN $100

7. mixing g++ libs with CC libs?

8. a pipe problem

9. Help - shared libs lib****.so.4 lib***.so.5

10. Same program, different shared libs

11. Different Functions of Same Name in Different Libs

12. mixed-architecture Jumpstart

13. static lib works fine, but why not the shared lib version