From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,5422ea1b26271bec,start X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-01-23 06:20:02 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!newsfeed.berkeley.edu!ucberkeley!logbridge.uoregon.edu!feed2.news.rcn.net!feed1.news.rcn.net!rcn!not-for-mail From: Albert Chin-A-Young Newsgroups: comp.unix.tru64 Subject: Oddness with cc -pthread and -lldap_r Date: 23 Jan 2001 14:19:17 GMT Organization: The Written Word, LLC Sender: Albert Chin-A-Young Message-ID: <94k3t5$mhe$1@bob.news.rcn.net> X-Trace: UmFuZG9tSVam47HZ6Gch+bjjMuFtPLcMmETAH8GX+kb1B6Wyk4rFyjGe1FbUXXxK X-Complaints-To: abuse@rcn.com NNTP-Posting-Date: 23 Jan 2001 14:19:17 GMT Keywords: openldap cc ld User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.18pre21 (i686)) Xref: supernews.google.com comp.unix.tru64:1538 I'm building OpenLDAP 2.0.7 on Tru64 UNIX 5.0A. Something odd is going on: $ cc -V /usr/bin/cc (cc) Tru64 UNIX Compiler Driver 5.0 Compaq C V6.1-020 on Compaq Tru64 UNIX V5.0A (Rev. 1094) /usr/lib/cmplrs/cc/ld: /usr/lib/cmplrs/cc/ftoc: $ cat b.c #include int main (void) { pid_t foo; } $ cc b.c -lldap_r -pthread [At this point, it doesn't matter if libldap_r is available because we're interested in how ld is being called. We replace /bin/ld with a shell script to spit out the options ld was called with.] ld -g0 -O1 -call_shared /usr/lib/cmplrs/cc/crt0.o b.o -qlldap_r _r -lldap_r -lpthread -lexc -lc [yes, there is a CR after -qlldap_r and notice the lone "-r"!] $ cc b.c -pthread ld -g0 -O1 -call_shared /usr/lib/cmplrs/cc/crt0.o b.o -lpthread -lexc -lc [no CR problems!] $ cc b.c -lfoo_r -pthread ld -g0 -O1 -call_shared /usr/lib/cmplrs/cc/crt0.o b.o \ -qlfoo_r_r -lfoo_r -lpthread -lexc -lc [no CR problems!] So, what is going on? What is special about "-lldap_r". -- albert chin (china at thewrittenword dot com)