From owner-svn-src-head@FreeBSD.ORG Tue Mar 17 15:16:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92755576; Tue, 17 Mar 2015 15:16:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 635F0BF8; Tue, 17 Mar 2015 15:16:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2HFGcgi046021; Tue, 17 Mar 2015 15:16:38 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2HFGbj9046017; Tue, 17 Mar 2015 15:16:37 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201503171516.t2HFGbj9046017@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 17 Mar 2015 15:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280179 - in head: . lib/atf/libatf-c++ share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2015 15:16:38 -0000 Author: bdrewery Date: Tue Mar 17 15:16:36 2015 New Revision: 280179 URL: https://svnweb.freebsd.org/changeset/base/280179 Log: Add LIB_CXX so that C++ libraries will use CXX to link. This fixes C++ libraries not implicitly linking in libc++. This is generally not an issue because the final linking with the compiled binary will involve CXX via PROG_CXX or other means. It is however inconsistent with libraries implicitly linking in libc and problematic for trying to build libraries with '-z defs' to ensure all direct dependencies are linked in. libatf-c++ is currently the only consumer of this new feature. Differential Revision: https://reviews.freebsd.org/D2039 Reviewed by: imp Discussed with: bapt MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 head/lib/atf/libatf-c++/Makefile head/share/mk/bsd.lib.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Mar 17 15:12:52 2015 (r280178) +++ head/Makefile.inc1 Tue Mar 17 15:16:36 2015 (r280179) @@ -1685,6 +1685,10 @@ gnu/lib/libstdc++__L: lib/msun__L gnu/lib/libsupc++__L: gnu/lib/libstdc++__L .endif +.if ${MK_LIBCPLUSPLUS} != "no" +_prebuild_libs+= lib/libc++ +.endif + lib/libgeom__L: lib/libexpat__L .if ${MK_LIBTHR} != "no" Modified: head/lib/atf/libatf-c++/Makefile ============================================================================== --- head/lib/atf/libatf-c++/Makefile Tue Mar 17 15:12:52 2015 (r280178) +++ head/lib/atf/libatf-c++/Makefile Tue Mar 17 15:16:36 2015 (r280179) @@ -28,7 +28,7 @@ .include .include -LIB= atf-c++ +LIB_CXX= atf-c++ PRIVATELIB= true SHLIB_MAJOR= 2 Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Tue Mar 17 15:12:52 2015 (r280178) +++ head/share/mk/bsd.lib.mk Tue Mar 17 15:16:36 2015 (r280179) @@ -4,6 +4,13 @@ .include +.if defined(LIB_CXX) +LIB= ${LIB_CXX} +_LD= ${CXX} +.else +_LD= ${CC} +.endif + # Set up the variables controlling shared libraries. After this section, # SHLIB_NAME will be defined only if we are to create a shared library. # SHLIB_LINK will be defined only if we are to create a link to it. @@ -217,7 +224,7 @@ ${SHLIB_NAME_FULL}: ${SOBJS} .if defined(SHLIB_LINK) @${INSTALL_SYMLINK} ${SHLIB_NAME} ${SHLIB_LINK} .endif - ${CC} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ + ${_LD} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ -o ${.TARGET} -Wl,-soname,${SONAME} \ `NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD} .if ${MK_CTF} != "no"