From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,670da90686135444 X-Google-Attributes: gidfee84,public From: mooney@dogbert.cc.ndsu.NoDak.edu (Tim Mooney) Subject: Re: Linking Statically & Dynamically with GCC Date: 2000/01/15 Message-ID: <85opbb$i6n$1@news.ndsu.nodak.edu>#1/1 X-Deja-AN: 572846360 Content-Transfer-Encoding: 7bit References: <85d6ah$esg$1@nnrp1.deja.com> Content-Type: text/plain; charset=US-ASCII X-Complaints-To: abuse@nodak.edu X-Trace: news.ndsu.nodak.edu 947906731 18647 134.129.106.23 (15 Jan 2000 03:25:31 GMT) Organization: North Dakota Higher Education Computing Network (NDHECN) Mime-Version: 1.0 NNTP-Posting-Date: 15 Jan 2000 03:25:31 GMT Newsgroups: comp.unix.osf.osf1 In article <85d6ah$esg$1@nnrp1.deja.com>, wrote: > I'm installing software on osf1 v4.0 that requires some libraries to be > linked statically and others dynamically. On other platforms (SunOS, > LINUX, and IRIX), I have successfully used the -Wl,-Bstatic and > -Wl,Bdynamic flags, but these flags are unrecognized on this platform. -Wl says "pass the following option to the linker". Tru64's linker doesn't grok `-Bstatic' or `-Bdynamic'. It does grok things like `-non_shared', `-no_so', et. al. See the `ld' man page. You probably need multiple occurrences of `-no_so' and `-no_archive' to arrange to have just certain library linked in statically. Tru64's linker doesn't have (unfortunately) a `-prefer_static' or `-archive_shared' option, a la HP-UX's linker. You may also need to pay special attention to the `-oldstyle_liblookup' flag. gcc and g++ have their own options to indicate you want to do static or shared linking. See the gcc info node for "Link Options". Passing (e.g.) -static to the compiler causes it to pass the appropriate flags to the linker for the platform it's on. If you're using gcc 2.95.1, I ran into what I think is a bug with how gcc passes options to programs it invokes on your behalf (such as ld). I don't know if that's been fixed in 2.95.2, but it caused some arguments to not be passed on correctly. Tim > Thanks in advance, > Karin -- Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu Information Technology Services (701) 231-1076 (Voice) Room 242-J1, IACC Building (701) 231-8541 (Fax) North Dakota State University, Fargo, ND 58105-5164