From owner-freebsd-java Sun Dec 23 12:58: 4 2001 Delivered-To: freebsd-java@freebsd.org Received: from www.blender.nl (nan.iae.nl [212.61.24.44]) by hub.freebsd.org (Postfix) with ESMTP id 72D2737B419 for ; Sun, 23 Dec 2001 12:58:01 -0800 (PST) Received: (from hans@localhost) by www.blender.nl (8.9.3/8.9.3) id VAA10405 for freebsd-java@FreeBSD.ORG; Sun, 23 Dec 2001 21:58:00 +0100 (CET) Date: Sun, 23 Dec 2001 21:58:00 +0100 (CET) From: Hans Lambermont Message-Id: <200112232058.VAA10405@www.blender.nl> To: freebsd-java@FreeBSD.ORG Subject: RE: JNI, -pthread vs -lc_r Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Joe wrote: > Hans Lambermont writes: > > Linking a JNI .so with only -pthread seems insufficient. I get: > > Exception in thread "main" java.lang.UnsatisfiedLinkError: > > libblenderssr.so: > > /usr/X11R6/lib/libGL.so.1: Undefined symbol "pthread_getspecific" > > What exactly do you mean by "linking a JNI .so"? Are you trying to > produce a .so file or are you trying to produce an executable image? > Are you using an existing .so produced by the port or are you trying to > create your own? It makes a huge difference in the answer. Sorry that I was not clear. I created my own .so file and access it from java by using the JNI. When not using java, running the program (with the c main() still present) the program runs fine (linking with -pthread). When creating the shared object however (and removing the c main() function), -pthread is not enough at runtime. -lc_r is also required. My question is 'why is this ?'. -- Hans To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message