libdispatch don't build on 8.2-RELEASE amd64

Dimitry Andric dim at FreeBSD.org
Wed Mar 2 20:45:58 UTC 2011


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.
-------------- next part --------------
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>


More information about the freebsd-hackers mailing list