From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 2 20:45:58 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C524106566B; Wed, 2 Mar 2011 20:45:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 3679B8FC16; Wed, 2 Mar 2011 20:45:58 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:4df5:7675:40a8:361] (unknown [IPv6:2001:7b8:3a7:0:4df5:7675:40a8:361]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 56CD45C59; Wed, 2 Mar 2011 21:45:57 +0100 (CET) Message-ID: <4D6EAC8C.7010804@FreeBSD.org> Date: Wed, 02 Mar 2011 21:46:04 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.15pre) Gecko/20110227 Lanikai/3.1.9pre MIME-Version: 1.0 To: Kostik Belousov References: <4D69D639.1010505@yahoo.com.br> <4D6A8BC6.1030409@yahoo.com.br> <4D6E5FE5.3030306@yahoo.com.br> <20110302154024.GD78089@deviant.kiev.zoral.com.ua> In-Reply-To: <20110302154024.GD78089@deviant.kiev.zoral.com.ua> Content-Type: multipart/mixed; boundary="------------010902020307030105070700" Cc: Stanislav Sedov , freebsd-hackers@freebsd.org, Danilo Egea Subject: Re: libdispatch don't build on 8.2-RELEASE amd64 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2011 20:45:58 -0000 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 --------------010902020307030105070700--