From owner-svn-src-head@freebsd.org Tue Aug 23 15:20:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC95EBC3EE4; Tue, 23 Aug 2016 15:20:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 83AB11551; Tue, 23 Aug 2016 15:20:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NFKWA7029333; Tue, 23 Aug 2016 15:20:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NFKWIA029332; Tue, 23 Aug 2016 15:20:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608231520.u7NFKWIA029332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 23 Aug 2016 15:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304681 - head 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.22 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, 23 Aug 2016 15:20:33 -0000 Author: bdrewery Date: Tue Aug 23 15:20:32 2016 New Revision: 304681 URL: https://svnweb.freebsd.org/changeset/base/304681 Log: Always pass in -target and --sysroot flags for the build. The internal bootstrap compiler has a default sysroot set by TOOLS_PREFIX and target set by TARGET/TARGET_ARCH. However, there are several needs to always pass an explicit --sysroot and -target. - External compiler needs sysroot and target flags. - External ld needs sysroot. - To be clear about the use of a sysroot when using the internal compiler. - Easier debugging. - Allowing WITH_SYSTEM_COMPILER+WITH_META_MODE to work together due to the flip-flopping build command when sometimes using external and sometimes using internal. - Allow using no lld which has support for default paths. The default sysroot in the bootstrap compiler is not changed. The buildenv compiler will still work with its default and will also include -target/--sysroot from CC in the environment. MFC after: 3 days Discussed with: emaste, brooks (BSDCam) Reviewed by: emaste Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Aug 23 13:53:38 2016 (r304680) +++ head/Makefile.inc1 Tue Aug 23 15:20:32 2016 (r304681) @@ -550,8 +550,18 @@ CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="$ BFLAGS+= -B${CROSS_BINUTILS_PREFIX} .endif -# External compiler needs sysroot and target flags. -.if ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no" + +# The internal bootstrap compiler has a default sysroot set by TOOLS_PREFIX +# and target set by TARGET/TARGET_ARCH. However, there are several needs to +# always pass an explicit --sysroot and -target. +# - External compiler needs sysroot and target flags. +# - External ld needs sysroot. +# - To be clear about the use of a sysroot when using the internal compiler. +# - Easier debugging. +# - Allowing WITH_SYSTEM_COMPILER+WITH_META_MODE to work together due to +# the flip-flopping build command when sometimes using external and +# sometimes using internal. +# - Allow using lld which has no support for default paths. .if !defined(CROSS_BINUTILS_PREFIX) || !exists(${CROSS_BINUTILS_PREFIX}) BFLAGS+= -B${WORLDTMP}/usr/bin .endif @@ -579,7 +589,6 @@ TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x8 XCFLAGS+= -target ${TARGET_TRIPLE} .endif XCFLAGS+= --sysroot=${WORLDTMP} -.endif # ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no" .if !empty(BFLAGS) XCFLAGS+= ${BFLAGS}