🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #42909

gcc -static under Solaris2.4

#42909
From: Adam Cable
Date: Tue, 17 Oct 1995 00:00
32 lines
1674 bytes
Hi,


  Im trying to compile something to be static wtih gcc 2.7.0 in
a Solaris 2.4 enviroment.    What seems to be happening is that
libc.a wants to access nss_deffinder.o.  When I compile dynamically,
and check my program with ldd, it depends on libc.so and libdl.so.  So
I figure that nss_deffinder is in libdl and of course their is no
libdl.a.  So how do I compile something statically in gcc and
still bring in libdl.so?


  Here is basically what I am doing.

gcc -static -o a.out a.o b.o c.o

  Undefined                       first referenced
 symbol                             in file
dlclose                             /usr/lib/libc.a(nss_deffinder.o)
dlsym                               /usr/lib/libc.a(nss_deffinder.o)
dlopen                              /usr/lib/libc.a(nss_deffinder.o)

   I have tried doing the linking by hand and even using /usr/ucblib/libucb.a,
but it always seems to come down to libc.a and the lack of a libdl.a
 

  Any clues or ideas?

Thanks,

Adam Cable
cable@crl.nmsu.edu
Technical Details
Message-ID: <461ddo$t2f@bubba.NMSU.Edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,fea7103174cfcdbd,start
X-Google-Attributes: gid11318c,public
X-Google-Thread: 11035d,fea7103174cfcdbd,start
X-Google-Attributes: gid11035d,public
From: Adam Cable <cable@hyperia.nmsu.edu>
Subject: gcc -static under Solaris2.4
Date: 1995/10/17
Message-ID: <461ddo$t2f@bubba.NMSU.Edu>
X-Deja-AN: 117678250
distribution: inet
content-type: text/plain; charset=us-ascii
organization: Computing Research Lab/NMSU
x-url: news:gnu.gcc.help
mime-version: 1.0
newsgroups: gnu.gcc.help,comp.unix.solaris
x-mailer: Mozilla 1.1N (X11; I; SunOS 5.4 sun4m)