home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.sun.admin:9606 comp.unix.wizards:5284
- Path: sparky!uunet!olivea!charnel!rat!koko.csustan.edu!nic.csu.net!nic.csu.net!nntp
- From: oleg@gd.cs.csufresno.edu (Oleg Kibirev)
- Newsgroups: comp.sys.sun.admin,comp.unix.wizards
- Subject: Custom shlib - getting it straight
- Message-ID: <1992Dec19.021123.3592@nic.csu.net>
- Date: 19 Dec 92 10:11:21 GMT
- Sender: oleg@gd.cs.csufresno.edu
- Organization: Computer Science Departement of California State University in Fresno
- Lines: 41
- Nntp-Posting-Host: gd.cs.csufresno.edu
-
- While building custom shared libraries, I have noticed several interesting
- "undocumented features" left by Sun for unsuspecting customers. I have heard
- about more such features from other people as well. Can anyone explain any of
- this:
-
- - if libc.so.* is compiled without -ldl option, cc will get unresolved
- externals and ldd shows that /usr/lib/libdl.so.* is not included. However,
- compiled programs run just fine! As well as ones from 4.1.2 that don't know
- anything about libdl.
-
- If -ldl _is_ specified, existing programs appear to include libdl *twice*,
- doing to mmaps and apparently wasting some memory. From the other hand, newly
- compiled programs include libdl just one.
-
- Looks like the problem is with cc refusing to link in libdl if a nonstandard
- libc is present. A wrapper to cc that appends -lc -ldl to the end of options
- works just fine, but this doesn't explain why I have to do this. I posted this
- before, but never got an answer explaining why...
-
- - dbx crashes with "error reading shared library" message if anything
- nonstandard is present (even if .pic thing is just ld'ed without any changes).
- gdb works great in the same time. Is there a fix?
-
- - Occasionally, make will fail complaining that "ld returned error code 4" if
- running with custom library (again, no matter what it is). In these cases,
- BSD4.3 or GNU make works great. What did Sun do to it's version? What is ld's
- error code 4 anyway?
-
- - Is there a way to generate libc.sa.* when making a custom library?
-
- - I suspect that there are all-new problems when rebuilding 5lib version of
- libc. Anyone knows if it's true and how to fix it? I didn't get to it yet.
-
-
- Another, somewhat unrelated question... I have noticed that programs in
- system() call still have sh -c hanging around. Obviously, when a lot of copies
- of application in question are running, shells do no good to swap space. I was
- thinking about having system() prepend exec to the command line. However,
- looks like Sun's /bin/sh can't handle exec of a builtin gracefully. Do you
- know of any reasonably compatible sh that does? I could put it as
- /bin/sh.system...
-