From owner-freebsd-hackers Thu Aug 23 16:17:44 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp011.mail.yahoo.com (smtp011.mail.yahoo.com [216.136.173.31]) by hub.freebsd.org (Postfix) with SMTP id 2E9E537B405 for ; Thu, 23 Aug 2001 16:17:34 -0700 (PDT) (envelope-from kc5vdj@yahoo.com) Received: from mkc-65-28-47-209.kc.rr.com (HELO yahoo.com) (65.28.47.209) by smtp.mail.vip.sc5.yahoo.com with SMTP; 23 Aug 2001 23:17:32 -0000 X-Apparently-From: Message-ID: <3B858F0B.5050300@yahoo.com> Date: Thu, 23 Aug 2001 18:17:31 -0500 From: Jim Bryant Reply-To: kc5vdj@yahoo.com User-Agent: Mozilla/5.0 (X11; U; Linux i386; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1 X-Accept-Language: en-us MIME-Version: 1.0 To: dpetrou@cs.cmu.edu Cc: Mikko Tyolajarvi , freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: wacky warnings linking multithreaded code References: <20010823150044.E24447@amant.pdl.cs.cmu.edu> <200108232105.f7NL50119378@mikko.dynas.se> <20010823171156.G24447@amant.pdl.cs.cmu.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG if you have the linux-pthreads port installed, remove it. things will compile properly afterwards. linux-pthreads really needs a different library name and include file names... i lay odds that this known conflict is your problem. David Petrou wrote: >>cc -pthread test.c >> > > i tried that too. that works for test.c, which doesn't reference > anything, but in more complex programs, it dies. i wish i knew why. > check this out: > > this is the command to link testgthread from the glib library without > -lc_r and without -pthread: > ---------------------------------------------------------------------- > amant 1/619 cs.cmu.edu/project/pdl-19/glib-1.2.10/gthread> gmake > /bin/sh ../libtool --mode=link gcc -g -O2 -Wall -D_THREAD_SAFE -D_REENTRANT -o testgthread testgthread.o ../libglib.la libgthread.la > gcc -g -O2 -Wall -D_THREAD_SAFE -D_REENTRANT -o .libs/testgthread testgthread.o ../.libs/libglib.so .libs/libgthread.so -Wl,--rpath -Wl,/usr/local/lib > testgthread.o: In function `new_thread': > /afs/cs.cmu.edu/project/pdl-19/glib-1.2.10/gthread/testgthread.c(.text+0x3227): undefined reference to `pthread_attr_init' > /afs/cs.cmu.edu/project/pdl-19/glib-1.2.10/gthread/testgthread.c(.text+0x3233): undefined reference to `pthread_create' > testgthread.o: In function `private_constructor': > /afs/cs.cmu.edu/project/pdl-19/glib-1.2.10/gthread/testgthread.c:139: undefined reference to `pthread_self' > testgthread.o: In function `test_private': > /afs/cs.cmu.edu/project/pdl-19/glib-1.2.10/gthread/testgthread.c(.text+0x3511): undefined reference to `pthread_join' > .libs/libgthread.so: undefined reference to `pthread_cond_signal' > .libs/libgthread.so: undefined reference to `pthread_getspecific' > .libs/libgthread.so: undefined reference to `pthread_cond_broadcast' > .libs/libgthread.so: undefined reference to `pthread_key_create' > .libs/libgthread.so: undefined reference to `pthread_cond_init' > .libs/libgthread.so: undefined reference to `pthread_mutex_unlock' > .libs/libgthread.so: undefined reference to `pthread_mutex_destroy' > .libs/libgthread.so: undefined reference to `pthread_mutex_lock' > .libs/libgthread.so: undefined reference to `pthread_cond_wait' > .libs/libgthread.so: undefined reference to `pthread_mutex_trylock' > .libs/libgthread.so: undefined reference to `pthread_cond_destroy' > .libs/libgthread.so: undefined reference to `pthread_mutex_init' > .libs/libgthread.so: undefined reference to `pthread_cond_timedwait' > .libs/libgthread.so: undefined reference to `pthread_setspecific' > gmake: *** [testgthread] Error 1 > ---------------------------------------------------------------------- > > now with -pthread: > ---------------------------------------------------------------------- > amant 1/621 cs.cmu.edu/project/pdl-19/glib-1.2.10/gthread> /bin/sh ../libtool --mode=link gcc -g -O2 -Wall -D_THREAD_SAFE -D_REENTRANT -o testgthread testgthread.o ../libglib.la libgthread.la -pthread > gcc -g -O2 -Wall -D_THREAD_SAFE -D_REENTRANT -o .libs/testgthread testgthread.o ../.libs/libglib.so .libs/libgthread.so -pthread -Wl,--rpath -Wl,/usr/local/lib > /usr/lib/libc.so.4: WARNING! setkey(3) not present in the system! > /usr/lib/libc.so.4: warning: this program uses gets(), which is unsafe. > /usr/lib/libc.so.4: warning: mktemp() possibly used unsafely; consider using mkstemp() > /usr/lib/libc.so.4: WARNING! des_setkey(3) not present in the system! > /usr/lib/libc.so.4: WARNING! encrypt(3) not present in the system! > /usr/lib/libc.so.4: warning: tmpnam() possibly used unsafely; consider using mkstemp() > /usr/lib/libc.so.4: warning: this program uses f_prealloc(), which is stupid. > /usr/lib/libc.so.4: WARNING! des_cipher(3) not present in the system! > /usr/lib/libc.so.4: warning: tempnam() possibly used unsafely; consider using mkstemp() > creating testgthread > ---------------------------------------------------------------------- > > >> $.02, >> /Mikko >> > > any ideas? i know the warnings are generated from libc (just grep > around /usr/src/lib/libc). i can't find anything that references > those symbols. also, i must not be understanding -pthread, because i > thought it _replaced_ libc with libc_r. > > david > > p.s.: again, please remember to reply to me in addition to the lists. > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > > jim -- ET has one helluva sense of humor! He's always anal-probing right-wing schizos! _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message