From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 23:43:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 514B58B7; Sun, 30 Mar 2014 23:43:31 +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 3DBA1A3A; Sun, 30 Mar 2014 23:43:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2UNhVYI046204; Sun, 30 Mar 2014 23:43:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UNhUgC046202; Sun, 30 Mar 2014 23:43:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403302343.s2UNhUgC046202@svn.freebsd.org> From: Warner Losh Date: Sun, 30 Mar 2014 23:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263953 - in head: . 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.17 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: Sun, 30 Mar 2014 23:43:31 -0000 Author: imp Date: Sun Mar 30 23:43:30 2014 New Revision: 263953 URL: http://svnweb.freebsd.org/changeset/base/263953 Log: There's no need to guess at the COMPILER_TYPE to pass it down. We guess wrong for buildkernel when CC=gcc49, say. Eliminate all the guessing. COMPILER_TYPE propigates properly on its own, if specified, and we guess it correctly otherwise lower in the build. Also, fix conditionals for armv6hf when using an external compiler chain. They were broken before, but unused. Also, prefer checking the compiler type over CLANG_IS_CC since the latter is only supposed to be used to determine what symlinks to install (more fixes to follow). Modified: head/Makefile.inc1 head/share/mk/bsd.prog.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Mar 30 22:25:01 2014 (r263952) +++ head/Makefile.inc1 Sun Mar 30 23:43:30 2014 (r263953) @@ -240,8 +240,7 @@ BMAKEENV= INSTALL="sh ${.CURDIR}/tools/i PATH=${BPATH}:${PATH} \ WORLDTMP=${WORLDTMP} \ VERSION="${VERSION}" \ - MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ - COMPILER_TYPE=${COMPILER_TYPE} + MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ DESTDIR= \ @@ -270,8 +269,7 @@ XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${BPATH}:${PATH} \ WORLDTMP=${WORLDTMP} \ - VERSION="${VERSION}" \ - COMPILER_TYPE=${COMPILER_TYPE} + VERSION="${VERSION}" KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \ ${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ DESTDIR= \ @@ -324,17 +322,6 @@ WMAKEENV+= CC="${XCC} ${XFLAGS}" CXX="${ AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \ OBJDUMP=${XOBJDUMP} RANLIB=${XRANLIB} STRINGS=${XSTRINGS} -.if ${XCC:T:Mgcc} == "gcc" -WMAKE_COMPILER_TYPE= gcc -.elif ${XCC:T:Mclang} == "clang" -WMAKE_COMPILER_TYPE= clang -.elif ${MK_CLANG_IS_CC} == "no" -WMAKE_COMPILER_TYPE= gcc -.else -WMAKE_COMPILER_TYPE= clang -.endif -IMAKE_COMPILER_TYPE= COMPILER_TYPE=${WMAKE_COMPILER_TYPE} - .if ${XCC:M/*} XFLAGS= --sysroot=${WORLDTMP} .if defined(CROSS_BINUTILS_PREFIX) @@ -347,21 +334,18 @@ XFLAGS+= -B${CROSS_BINUTILS_PREFIX} .else XFLAGS+= -B${WORLDTMP}/usr/bin .endif -.if ${TARGET_ARCH} != ${MACHINE_ARCH} && ${WMAKE_COMPILER_TYPE} == "clang" -.if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") && \ -${MK_ARM_EABI} != "no" +.if ${TARGET} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET_ARCH:M*eb*} == "" TARGET_ABI= gnueabi .elif ${TARGET_ARCH} == "armv6hf" TARGET_ABI= gnueabihf -.else -TARGET_ABI= unknown .endif +.endif +TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 XFLAGS+= -target ${TARGET_TRIPLE} .endif -.endif -WMAKEENV+= COMPILER_TYPE=${WMAKE_COMPILER_TYPE} WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 DESTDIR=${WORLDTMP} .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" @@ -409,10 +393,8 @@ LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTR PATH=${TMPPATH} \ LIBDIR=/usr/lib32 \ SHLIBDIR=/usr/lib32 \ - LIBPRIVATEDIR=/usr/lib32/private \ - COMPILER_TYPE=${WMAKE_COMPILER_TYPE} -LIB32WMAKEFLAGS+= \ - CC="${XCC} ${LIB32FLAGS}" \ + LIBPRIVATEDIR=/usr/lib32/private +LIB32WMAKEFLAGS+= CC="${XCC} ${LIB32FLAGS}" \ CXX="${XCXX} ${LIB32FLAGS}" \ DESTDIR=${LIB32TMP} \ -DCOMPAT_32BIT \ @@ -430,7 +412,7 @@ LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDES IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*} IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ - ${IMAKE_INSTALL} ${IMAKE_MTREE} ${IMAKE_COMPILER_TYPE} + ${IMAKE_INSTALL} ${IMAKE_MTREE} .if empty(.MAKEFLAGS:M-n) IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \ LD_LIBRARY_PATH=${INSTALLTMP} \ Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Sun Mar 30 22:25:01 2014 (r263952) +++ head/share/mk/bsd.prog.mk Sun Mar 30 23:43:30 2014 (r263953) @@ -173,7 +173,7 @@ _EXTRADEPEND: .else echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE} .if defined(PROG_CXX) && !defined(EARLY_BUILD) -.if ${MK_CLANG_IS_CC} != "no" && empty(CXXFLAGS:M-stdlib=libstdc++) +.if ${COMPILER_TYPE} == "clang" && empty(CXXFLAGS:M-stdlib=libstdc++) echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE} .else echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE}