SPARC 4.1.3 g++ & sharable libraries 
Author Message
 SPARC 4.1.3 g++ & sharable libraries

Arg!!! I'm defeated.  I've spent 2 1/2 days trying to create
a .so file on SPARC 4.1.3 using gnu c++ so that Oberon can
load it using dlopen and dlsym.  I haven't gotten past
home plate!  What are the compiler/linker switches to
create a sharable library?  I've tried g++ -r -shared
which generates an undefined global variable of _environ.
I'm not a unix hacker (though I've used it on an off for
many years).
   Any help would be appreciated.

-Doug Danforth
(nausiated by unix)

--
UME Voice, The speech recognition standard for Wall Street.



Sun, 25 May 1997 08:36:19 GMT  
 SPARC 4.1.3 g++ & sharable libraries


|> What are the compiler/linker switches to
|> create a sharable library?

The following has worked for me:

        g++ -c foo.c
        ld foo.o -o foo.so

I haven't tried to open it with dlopen, though.

|> UME Voice, The speech recognition standard for Wall Street.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,          | A citizen of NewZealandCorp, a       |
Christchurch, New Zealand          | wholly-owned subsidiary of Japan Inc.|



Sun, 25 May 1997 12:05:00 GMT  
 SPARC 4.1.3 g++ & sharable libraries

Quote:


>|> What are the compiler/linker switches to
>|> create a sharable library?

>The following has worked for me:

>    g++ -c foo.c
>    ld foo.o -o foo.so

>I haven't tried to open it with dlopen, though.

>Greg Ewing, Computer Science Dept, +--------------------------------------+
>University of Canterbury,      | A citizen of NewZealandCorp, a       |
>Christchurch, New Zealand      | wholly-owned subsidiary of Japan Inc.|


Greg,
   Well, I'll be...!  Indeed, the default settings
when compiled and linked as you suggest do produce
a "sparc demand paged sharable library executable non stripped".
As simple as possible but not simpler! (hmmm, so why is the
_shared switch provided?).
  I have successfully dlopen(ed) the file so produced and
dlsym(ed) a procedure (but only after remembering that
C++ uses decorated names, e.g. "load" becomes "_load__Fv").
  Thank you very much!  I am in your debt.

-Doug Danforth

--
UME Voice, The speech recognition standard for Wall Street.



Mon, 26 May 1997 07:47:13 GMT  
 SPARC 4.1.3 g++ & sharable libraries


|> so why is the  _shared switch provided?

Maybe for other systems where something different has
to be done to make a shared object.

The g++ we have here doesn't even recognise -shared
as an option.

Greg



Fri, 30 May 1997 12:40:21 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Shared library for Tcl/Tk using G++

2. GNAT & g++ linked together

3. ftp release of POSIX Threads library implementation for SPARC

4. Tk shared library needs -fPIC on NetBSD/SPARC

5. Example for accessing an sharable Libary

6. Making DOS Real Mode File System Sharable

7. Performance of Allegro Common Lisp 4.2 on Sparc 5 and Sparc 20

8. Serial Interface & SPARC Oberon

9. Modula2 compiler for Mac & Sparc

10. Scheme-to-C & SPARC

11. Libraries && Dynamic Linking

12. G++, why I should use it?

 

 
Powered by phpBB® Forum Software