Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Feb 2001 20:18:25 +0200
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        John Indra <john@office.naver.co.id>
Cc:        FUJISHIMA Satsuki <sf@FreeBSD.org>, freebsd-current@FreeBSD.org, kevlo@FreeBSD.org, ports@FreeBSD.org, asami@FreeBSD.org
Subject:   Re: -lc_r against shared library (Re: Failed to build kdesupport2 port)
Message-ID:  <3A8C1D70.E59D0CEA@FreeBSD.org>
References:  <20010215110428.A31614@office.naver.co.id> <86n1bop2vs.wl@cheerful.com> <3A8BD0E7.BA197AB0@FreeBSD.org> <20010215230135.A34077@office.naver.co.id>

next in thread | previous in thread | raw e-mail | index | archive | help
John Indra wrote:

> On Thu, Feb 15, 2001 at 02:51:51PM +0200, Maxim Sobolev wrote:
>
> >> CONFIGURE_ARGS= "LIBS=-pthread"
> >> to kdesupport2/Makefile would help.
> >>
> >> There are some way to ``fix'' this problem:
> >> c) Use -lc_r instead of -pthread.
> >>    As -pthread will be depreciated, we should use -lc_r for FreeBSD
> >>    5.0 and later, shouldn't we?
> >
> >Yes, it looks like a most appropriate solution to me. If you read -ports,
> >recently I proposed to add a small patch for the bsd.port.mk to help with
> >transition process, but have not heard anything back from PW yet.
>
> Either I do it the wrong way, or you are not paying attention to my
> first message thoroughly. I HAVE applied your patch to my
> /usr/ports/Mk/bsd.port.mk! But still, I failed to build kdesupport2
>
> So, here's the summary of what I have done:
> 1. Reformat hard drive (cause I have a broken -CURRENT caused by FILE struct
> changes)
> 2. Install from current.freebsd.org a -CURRENT snapshot of 20000210
> 3. cvsup the latest ports tree
> 4. Applied Maxim Sobolev patch against my /usr/ports/Mk/bsd.port.mk
> The patch is:
>
> --- bsd.port.mk 2001/02/08 19:09:54     1.2
> +++ bsd.port.mk 2001/02/08 19:15:50
> @@ -948,6 +948,14 @@
>  MAKEFILE?=             Makefile
>  MAKE_ENV+=             PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} MOTIFLIB="${MOTIFLIB}" LIBDIR="${LIBDIR}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}"
>
> +.if ${OSVERSION} < 500000
> +PTHREAD_CFLAGS=        -D_THREAD_SAFE
> +PTHREAD_LIBS=          "-pthread"
> +.else
> +PTHREAD_CFLAGS=        ""
> +PTHREAD_LIBS=          "-lc_r"
> +.endif
> +
>  .if exists(/usr/bin/fetch)
>  # avoid -A for 2.2 -- it's not ported to that branch
>  .if ${OSVERSION} < 300000
>
> Correct isn't it?
>
> 5. Start building my ports
> 6. Everything from XFree86-4.0.2_6 to qt-2.2.4 build and installed just fine
> 7. kdesupport2 started bombing error messages
>
> So, if after all of this I SHOULD have not undergone any errors, then the
> mistakes is on me, please forgive me for wasting your time and bandwith.
>
> I am only seeking for some enlightenment.

You have totally misunderstood the purpose of my patch. The patch *isn't* intended as a quick fix for the recent -lc_r/-pthread weirdness, but instead it would provide
porting team with infrastructure necessary to start converting existing ports to the new world order. In a nutshell, -pthread should be replaced with ${PTHREAD_LIBS} and
-D_THREAD_SAFE with ${PTHREAD_CFLAGS} in all Makefiles from the ports collection. In addition all places where -pthread hardcoded in patches should also be identified and
adjusted to respect ${PTHREAD_LIBS} and ${PTHREAD_CFLAGS}.

-Maxim





To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A8C1D70.E59D0CEA>