home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!europa.asd.contel.com!emory!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!rpi!news.ans.net!newsgate.watson.ibm.com!yktnews!admin!minnie!gerth
- From: gerth@watson.ibm.com (John Gerth)
- Subject: Re: non-shared libraries
- Sender: news@watson.ibm.com (NNTP News Poster)
- Message-ID: <1992Nov18.033540.145069@watson.ibm.com>
- Date: Wed, 18 Nov 1992 03:35:40 GMT
- Distribution: usa
- Disclaimer: This posting represents the poster's views, not necessarily those of IBM
- References: <BxvqnJ.58@ansoft.com>
- Nntp-Posting-Host: minnie.watson.ibm.com
- Organization: IBM T.J. Watson Research Center
- Lines: 32
-
- You can (with some effort) create binaries which include
- the library code, it's just that the system is defaulted
- and optimized for shared libraries. The documentation for
- doing this is under 'ld' and has been somewhat improved
- in AIX 3.2 level of the man pages.
-
- The basic idea is to create your application in two passes.
- In the first pass you make a new .o which is your code plus
- the non-shared library code:
- ld -o nonshare.o -r -bnso ..... -lX11 -lXt ...
- Do not mention any of the libraries you do want shared in this step.
- In the second pass you run the new.o through with the shared libs:
- cc nonshare.o ...... -lm ...
-
- It is possible to link with non-shared libc, but it's slightly
- more complicated because of the way system calls are done (see
- the example in the man pages). However, it's probably not going
- to buy you much to use a non-shared libc since most of the
- basic commands reference it - I doubt much of standard AIX would
- work without it. Most unfortunately, this won't solve the
- running AIX 3.2 binary on AIX 3.1 because the system call
- lists for the kernel are not backwards compatible.
-
- I've used this technique to do things like create an X11R4 xterm
- which I could copy to AIX 3.1 systems where X is R3. It's usually
- straightforward but since any shared library can "import" things
- from other shared libraries, there are pitfalls. The "dump -H"
- command is a big help in tracing the dependency chain.
-
-
- --
- John Gerth gerth@watson.ibm.com (914) 784-7639
-