From owner-freebsd-ports@FreeBSD.ORG Fri Dec 17 11:27:30 2010 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDE89106566C for ; Fri, 17 Dec 2010 11:27:30 +0000 (UTC) (envelope-from villa.alberto@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5567B8FC19 for ; Fri, 17 Dec 2010 11:27:30 +0000 (UTC) Received: by wyf19 with SMTP id 19so492289wyf.13 for ; Fri, 17 Dec 2010 03:27:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:organization:to :subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id; bh=cyPPN3Kkd/HR+48bYLTmjFKeKwIdrPh46D4AeC9Fb2g=; b=wpR/a64Mu8dYAjNPUv6kOe+qlUOqjxykO4bDis73/6oYYQmp6j5v3ctHbwNuTbh7vW 49hODz3ZNZyVcqQzTlGnPFMcQbFhOld3//VqLpfVqb5GpB4DOzEnnL/hzrfZAmKyyBWm vOfZwYbSzW/ZSIxA0HuY4tc/PAZC6jjGXNdOM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:organization:to:subject:date:user-agent:mime-version :content-type:content-transfer-encoding:message-id; b=cGb1JN+N9jpjTaUeHPUEGRrEdKXOn0VrAigXtjDcQkzl7PlWHAFAGBbuUz9i9U7EGT MFYLrjs+7599QVBBDWgo6lTdwBpOqHc0Bh2U3Pv9isNoDBo9UxBlenftktbPKCaM1qgf QvsvfRf2qPFm0+t1z4gOmSOj+GVDYwl5YWwBo= Received: by 10.227.137.76 with SMTP id v12mr428361wbt.47.1292583819104; Fri, 17 Dec 2010 03:03:39 -0800 (PST) Received: from echo.hoth (host212-150-dynamic.52-82-r.retail.telecomitalia.it [82.52.150.212]) by mx.google.com with ESMTPS id 11sm121385wbi.18.2010.12.17.03.03.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 17 Dec 2010 03:03:38 -0800 (PST) Sender: Alberto Villa From: Alberto Villa Organization: The FreeBSD Project To: ports@freebsd.org, ehaupt@freebsd.org Date: Fri, 17 Dec 2010 12:03:30 +0100 User-Agent: KMail/1.13.5 (FreeBSD/9.0-CURRENT; KDE/4.5.4; amd64; ; ) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1550690.LUfWF1U4Tq"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201012171203.34851.avilla@freebsd.org> Cc: Subject: ccache: support other world compilers X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 11:27:30 -0000 --nextPart1550690.LUfWF1U4Tq Content-Type: multipart/mixed; boundary="Boundary-01=_CO0CNDap2hSP4zV" Content-Transfer-Encoding: 7bit --Boundary-01=_CO0CNDap2hSP4zV Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline hello! the attached patch allows ccache to use non-default compilers=20 (especially clang, as it's the only one which will actually work) to build= =20 world and kernel. ehaupt@ suggested to let ports@ review it it also updates documentation with the new instructions, and replaces=20 libtool15 with libtool a couple of notes: =2D the clang warnings about unused arguments are really harmless. read=20 more here: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010- June/009539.html =2D i replaced world-* with world/* (this would obviously require a note in= =20 UPDATING) because of this (/sys/boot/i386/boot2/Makefile and others): CC:=3D${CC:C/^(.*\/)?clang$/gcc/1} world-clang wouldn't be replaced with world-gcc, while world/clang is=20 successfully changed to world/gcc. in addition, this allows to have only=20 one script (world/ccache), and just create links to it (like world/clang,=20 world/llvm-gcc...) while i had no problems at building world with world/clang, i've not yet=20 tested the port installation, but i'll do it as soon as i have a free=20 tinderbox. meanwhile you can share your comments about the patch =2D-=20 Alberto Villa, FreeBSD committer http://people.FreeBSD.org/~avilla Anything free is worth what you pay for it. --Boundary-01=_CO0CNDap2hSP4zV Content-Type: text/x-patch; charset="ISO-8859-1"; name="ccache.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ccache.diff" Index: Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/pcvs/ports/devel/ccache/Makefile,v retrieving revision 1.57 diff -u -r1.57 Makefile =2D-- Makefile 30 Nov 2010 22:37:33 -0000 1.57 +++ Makefile 17 Dec 2010 10:44:02 -0000 @@ -7,6 +7,7 @@ =20 PORTNAME=3D ccache PORTVERSION=3D 3.1.3 +PORTREVISION=3D 1 CATEGORIES=3D devel MASTER_SITES=3D http://samba.org/ftp/ccache/ CRITICAL =20 @@ -26,7 +27,7 @@ .if !defined(WITHOUT_COMPILER_LINKS) HOWTO=3D ccache-howto-freebsd.txt CCLINKDIR=3D libexec/ccache =2DPLIST_DIRS=3D ${CCLINKDIR} +PLIST_DIRS=3D ${CCLINKDIR} ${CCLINKDIR}/world SUB_FILES=3D ${HOWTO} pkg-message .endif =20 @@ -42,10 +43,9 @@ .if defined(EXTRA_COMPILERS) CCACHE_COMPILERS+=3D ${EXTRA_COMPILERS} .endif =2DWORLD_COMPILERS=3D world-cc world-c++ PLIST_FILES+=3D ${CCACHE_COMPILERS:S|^|${CCLINKDIR}/|} \ =2D ${WORLD_COMPILERS:S|^|${CCLINKDIR}/|} =2DSUB_FILES+=3D ${WORLD_COMPILERS} + ${CCACHE_COMPILERS:S|^|${CCLINKDIR}/world/|} +SUB_FILES+=3D world-ccache SUB_LIST+=3D CCACHE_COMPILERS=3D"${CCACHE_COMPILERS}" \ CCLINKDIR=3D"${CCLINKDIR}" \ ICCPREFIX=3D"${LOCALBASE}/intel_cc_80/bin" \ @@ -69,12 +69,11 @@ ${INSTALL_PROGRAM} ${WRKSRC}/ccache ${PREFIX}/bin ${INSTALL_MAN} ${WRKSRC}/${MAN1} ${PREFIX}/man/man1 .if !defined(WITHOUT_COMPILER_LINKS) =2D @${MKDIR} ${PREFIX}/${CCLINKDIR} + @${MKDIR} ${PREFIX}/${CCLINKDIR}/world + ${INSTALL_SCRIPT} ${WRKDIR}/world-ccache ${PREFIX}/${CCLINKDIR}/world/cca= che .for link in ${CCACHE_COMPILERS} ${LN} -sf ${PREFIX}/bin/ccache ${PREFIX}/${CCLINKDIR}/${link} =2D.endfor =2D.for script in ${WORLD_COMPILERS} =2D ${INSTALL_SCRIPT} ${WRKDIR}/${script} ${PREFIX}/${CCLINKDIR} + ${LN} -sf ccache ${PREFIX}/${CCLINKDIR}/world/${link} .endfor .endif .if !defined(NOPORTDOCS) Index: files/ccache-howto-freebsd.txt.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/pcvs/ports/devel/ccache/files/ccache-howto-freebsd.txt.in,v retrieving revision 1.13 diff -u -r1.13 ccache-howto-freebsd.txt.in =2D-- files/ccache-howto-freebsd.txt.in 17 Nov 2010 18:41:35 -0000 1.13 +++ files/ccache-howto-freebsd.txt.in 17 Dec 2010 10:44:02 -0000 @@ -2,12 +2,14 @@ # $FreeBSD: ports/devel/ccache/files/ccache-howto-freebsd.txt.in,v 1.13 20= 10/11/17 18:41:35 ehaupt Exp $ # =20 =2DTo use ccache add the following to /etc/make.conf +To use ccache add the following to /etc/make.conf. +You can replace cc and c++ with the compilers of your choice. +(remember that only GCC and Clang can build world and kernel) =20 .if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*)) .if !defined(NOCCACHE) =2DCC:=3D${CC:C,^cc,%%PREFIX%%/%%CCLINKDIR%%/world-cc,1} =2DCXX:=3D${CXX:C,^c\+\+,%%PREFIX%%/%%CCLINKDIR%%/world-c++,1} +CC:=3D${CC:C,^cc,%%PREFIX%%/%%CCLINKDIR%%/world/cc,1} +CXX:=3D${CXX:C,^c\+\+,%%PREFIX%%/%%CCLINKDIR%%/world/c++,1} .endif .endif =20 @@ -47,12 +49,16 @@ Ccache has installed links for the following compilers %%CCACHE_COMPILERS%% in %%PREFIX%%/%%CCLINKDIR%% +and %%PREFIX%%/%%CCLINKDIR%%/world + +Clang will return a lot of 'unused argument' warnings: they are harmless. +Just add -Qunused-arguments to CFLAGS if you want to hide them. =20 !!! WARNING !!! Please make sure you have the compiler installed before you do this or your build will fail because it will not be able to find the compiler. =20 =2DAny time you change CC/CXX you need to reinstall devel/libtool15 or you= =20 +Any time you change CC/CXX you need to reinstall devel/libtool or you=20 will run in to problems. =20 -- Index: files/world-c++.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: files/world-c++.in diff -N files/world-c++.in =2D-- files/world-c++.in 31 Jul 2010 10:48:26 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,4 +0,0 @@ =2D#!/bin/sh =2Dunset CCACHE_PATH =2Dexport CCACHE_COMPILERCHECK=3Dcontent =2Dexec %%PREFIX%%/%%CCLINKDIR%%/c++ "$@" Index: files/world-cc.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: files/world-cc.in diff -N files/world-cc.in =2D-- files/world-cc.in 31 Jul 2010 10:48:26 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,4 +0,0 @@ =2D#!/bin/sh =2Dunset CCACHE_PATH =2Dexport CCACHE_COMPILERCHECK=3Dcontent =2Dexec %%PREFIX%%/%%CCLINKDIR%%/cc "$@" Index: files/world-ccache.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: files/world-ccache.in diff -N files/world-ccache.in =2D-- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/world-ccache.in 17 Dec 2010 10:44:02 -0000 @@ -0,0 +1,9 @@ +#!/bin/sh + +[ "${0##*/}" =3D "ccache" ] && +printf "Please, use one of the compiler links in\n%%PREFIX%%/%%CCLINKDIR%%= /world\nto invoke ccache\n" >&2 && +exit 1 + +unset CCACHE_PATH +export CCACHE_COMPILERCHECK=3Dcontent +exec %%PREFIX%%/%%CCLINKDIR%%/${0##*/} "$@" --Boundary-01=_CO0CNDap2hSP4zV-- --nextPart1550690.LUfWF1U4Tq Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iJwEAAECAAYFAk0LQ4YACgkQ3xiC6kQ1CovKDgQAhntRDNNoHYVOcOk7O/+VJM5A 6YW20gpvHdmDK2nCYMTYGmGhTcIryUyv6APqpsqJz9JT9sKCNz4e0jq5b7drbMRA TzNg08YN5SKo4lxGC4mRhri1ahfblvlwYvmROvkY/vHBQCyFnwgGhG2slCMm0Jj4 MmzR2CLRJ0qYNqNHFWM= =fu0X -----END PGP SIGNATURE----- --nextPart1550690.LUfWF1U4Tq--