From owner-freebsd-ports Fri Sep 10 2:30:16 1999 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 60A2E14A15 for ; Fri, 10 Sep 1999 02:30:11 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id CAA89926; Fri, 10 Sep 1999 02:30:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Fri, 10 Sep 1999 02:30:02 -0700 (PDT) Message-Id: <199909100930.CAA89926@freefall.freebsd.org> To: freebsd-ports@FreeBSD.org Cc: From: Thomas Gellekum Subject: Re: ports/13677: Misc. Ports fix ups. Reply-To: Thomas Gellekum Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR ports/13677; it has been noted by GNATS. From: Thomas Gellekum To: Jeremy Lea Cc: FreeBSD-gnats-submit@FreeBSD.ORG, nectar@FreeBSD.ORG Subject: Re: ports/13677: Misc. Ports fix ups. Date: 10 Sep 1999 11:28:18 +0200 Jeremy Lea writes: > Hi, > > On Fri, Sep 10, 1999 at 10:02:58AM +0200, Thomas Gellekum wrote: > > Since -pthread is a linker flag, not a compiler flag, I'd prefer: ^^^^^^^^^^^^^^^^^^^^^^^^^ > > Does this help you with py-gnome, whatever the problem is? > > The problem was that python would hang during one or other phase of the > build of py-gnome. It was caused by being compiled with > '-D_THREAD_SAFE' but not being linked with '-pthread', since gcc not ld > was being used for linking, so the patch above would have the same > effect... I'm afraid I don't understand what you're saying here. The relevant definitions in /usr/local/lib/python1.5/config/Makefile are: CC= cc OPT= -O -pipe -D_THREAD_SAFE LDFLAGS= -pthread LDSHARED= gcc -shared ${LDFLAGS} CCSHARED= -fpic LINKFORSHARED= -Xlinker -export-dynamic # $(PURIFY) is empty LINKCC= $(PURIFY) $(CC) CFLAGS= $(OPT) -I$(INCLDIR) -I$(CONFIGINCLDIR) $(DEFS) link: $(MAINOBJ) $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) $(MAINOBJ) \ $(LDLIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST) mv python$(EXE) ../python$(EXE) # example for a shared module mpzmodule.o: $(srcdir)/mpzmodule.c; $(CC) $(CCSHARED) -I$(GMP) -I$(GMP)/mpn/generic $(CFLAGS) -c $(srcdir)/mpzmodule.c mpzmodule$(SO): mpzmodule.o; $(LDSHARED) mpzmodule.o -lgmp -o mpzmodule$(SO) `-D_THREAD_SAFE' is added to ${OPT} only when python is built with thread support. `-pthread' is added to the linker flags at the same time. I don't see how python (the interpreter) can be compiled with `-D_THREAD_SAFE' but not linked against libc_r and _only_ libc_r. Mixing libc and libc_r does not work. ld(1) is never used explicitly (except in FreeBSD-2.x.x for ${LDSHARED}). Of course, C extensions to python, like py-gnome, should take care to pick up the correct flags for the interpreter they're using. > The problem might have only been temporary (it was on -CURRENT) and > might not happen with all the fixes in libc_r... But it's being > compiled with the wrong flags anyway, so it needs to be fixed. See above. `-pthread' in CFLAGS should not do anything. Maybe Jacques can enlighten me here about py-gnome. I never touched that. tg To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message