Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Mar 2011 21:46:04 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Kostik Belousov <kostikbel@gmail.com>
Cc:        Stanislav Sedov <stas@FreeBSD.org>, freebsd-hackers@freebsd.org, Danilo Egea <daniloegea@yahoo.com.br>
Subject:   Re: libdispatch don't build on 8.2-RELEASE amd64
Message-ID:  <4D6EAC8C.7010804@FreeBSD.org>
In-Reply-To: <20110302154024.GD78089@deviant.kiev.zoral.com.ua>
References:  <4D69D639.1010505@yahoo.com.br> <4D6A8BC6.1030409@yahoo.com.br>	<4D6E5FE5.3030306@yahoo.com.br> <20110302154024.GD78089@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------010902020307030105070700
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

On 2011-03-02 16:40, Kostik Belousov wrote:
> Rather, it is binutils 2.15 silently creating broken library.
> 2.21 refuses to do it.
>
> Some object used to create the final dso was not built with -fPIC.

This is actually a problem of clang, in combination with libdispatch's
configure script.  It tries to detect support for __private_extern__,
which is an Apple extension that serves the same goal on Darwin as the
visibility("hidden") attribute.  If the test program does not compile,
it just defines __private_extern__ as visibility("hidden") instead, if
the toolchain supports that attribute.

However, clang has a problem that it accepts the __private_extern__
attribute even on non-Darwin OSes, while *not* marking the symbol
hidden.  This will lead to the link error you are seeing here.

Can you please try the attached patch, which is a bit of a hack, but
works for now?  Meanwhile, I'll prod the clang developers to disable
recognition of __private_extern__ on non-Darwin platforms.

--------------010902020307030105070700
Content-Type: text/plain;
 name="clang-devel-libdispatch-1.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="clang-devel-libdispatch-1.diff"

Index: devel/libdispatch/Makefile
===================================================================
RCS file: /home/mirror/ncvs/ports/devel/libdispatch/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- devel/libdispatch/Makefile	15 Dec 2009 21:06:37 -0000	1.10
+++ devel/libdispatch/Makefile	2 Mar 2011 20:26:28 -0000
@@ -86,8 +86,7 @@
 RUN_DEPENDS+=	clang:${PORTSDIR}/devel/llvm-devel \
 		${LOCALBASE}/lib/libBlocksRuntime.so:${PORTSDIR}/devel/compiler-rt
 CONFIGURE_ARGS+=	--with-blocks-runtime=/usr/local/lib
-CONFIGURE_ENV+=	CC="clang"
-MAKE_ENV+=	CC="clang"
+CONFIGURE_ENV+=	CC="clang" dispatch_cv_private_extern="no"
 .endif
 
 .include <bsd.port.post.mk>

--------------010902020307030105070700--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D6EAC8C.7010804>