From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Apr 4 04:20:04 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3A8B1065672 for ; Sat, 4 Apr 2009 04:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C89448FC23 for ; Sat, 4 Apr 2009 04:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n344K27F098534 for ; Sat, 4 Apr 2009 04:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n344K2dF098533; Sat, 4 Apr 2009 04:20:02 GMT (envelope-from gnats) Resent-Date: Sat, 4 Apr 2009 04:20:02 GMT Resent-Message-Id: <200904040420.n344K2dF098533@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mario Sergio Fujikawa Ferreira Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C16F1065670 for ; Sat, 4 Apr 2009 04:10:49 +0000 (UTC) (envelope-from lioux@uol.com.br) Received: from goat.gigo.com (ipv6.gigo.com [IPv6:2001:470:1:18::2]) by mx1.freebsd.org (Postfix) with ESMTP id 3FD568FC14 for ; Sat, 4 Apr 2009 04:10:49 +0000 (UTC) (envelope-from lioux@uol.com.br) Received: from localhost (localhost [127.0.0.1]) by goat.gigo.com (Postfix) with ESMTP id 323107BC0 for ; Fri, 3 Apr 2009 21:10:49 -0700 (PDT) Received: from goat.gigo.com ([127.0.0.1]) by localhost (vette.gigo.com [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id fq6CXNiOpFli for ; Fri, 3 Apr 2009 21:10:49 -0700 (PDT) Received: from 200.101.51.13 (201-2-13-194.bsace702.dsl.brasiltelecom.net.br [201.2.13.194]) by goat.gigo.com (Postfix) with ESMTPA id A672E77CC for ; Fri, 3 Apr 2009 21:10:48 -0700 (PDT) Received: (qmail 80660 invoked by uid 1001); 4 Apr 2009 01:10:30 -0300 Message-Id: <20090404041030.80630.qmail@exxodus.fedaykin.here> Date: 4 Apr 2009 01:10:30 -0300 From: Mario Sergio Fujikawa Ferreira To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: hideo@lastamericanempire.com Subject: ports/133356: [PATCH] mail/crm114: Add option to build with Profile-Guided Optimization X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 04:20:04 -0000 >Number: 133356 >Category: ports >Synopsis: [PATCH] mail/crm114: Add option to build with Profile-Guided Optimization >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Apr 04 04:20:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Mario Sergio Fujikawa Ferreira >Release: FreeBSD 7.2-PRERELEASE i386 >Organization: >Environment: System: FreeBSD exxodus.fedaykin.here 7.2-PRERELEASE FreeBSD 7.2-PRERELEASE #70: Sat Mar 21 09:29:39 BRT 2009 >Description: - Add WITH_PGO to build with Profile-Guided Optimization - Profile-Guided Optimization build support is off per default Port maintainer (hideo@lastamericanempire.com) is cc'd. Generated with FreeBSD Port Tools 0.77 - For information on Profile-Guided Optimization: http://en.wikipedia.org/wiki/Profile-guided_optimization ------- RECIPE 1) Compile everything with CFLAGS/LDFLAGS containing '-fprofile-generate'; 2) Run lots of test cases to generate profiling information; 3) Remove all binaries leaving only the profiling information behind; 4) Replace all instances of '-fprofile-generate' with '-fprofile-use'; 5) Re-compile everything using the profiling information. ------- >How-To-Repeat: >Fix: --- crm114-20080326_2.patch begins here --- Index: Makefile =================================================================== RCS file: /home/pcvs/ports/mail/crm114/Makefile,v retrieving revision 1.24 diff -d -u -u -r1.24 Makefile --- Makefile 13 Feb 2009 17:10:59 -0000 1.24 +++ Makefile 4 Apr 2009 04:04:40 -0000 @@ -27,8 +27,8 @@ USE_GETTEXT= yes USE_ICONV= yes -MAKE_ARGS= CC="${CC}" CFLAGS="${CFLAGS}" prefix="${PREFIX}" \ - LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \ +MAKE_ARGS= CC="${CC}" prefix="${PREFIX}" \ + LIBS="${LIBS}" \ INSTALL_PROGRAM="${INSTALL_PROGRAM}" CFLAGS+= -I${LOCALBASE}/include @@ -43,11 +43,30 @@ blacklist.mfp.example whitelist.mfp.example crm114-mode.el \ procmailrc.recipe +OPTIONS= PGO "Enable Profile-Guided Optimization" off + +.include + +.if defined(WITH_PGO) +MAKE_ARGS+= CFLAGS="${CFLAGS} -fprofile-use" \ + LDFLAGS="${LDFLAGS} -fprofile-use" +.else +MAKE_ARGS+= CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS}" +.endif + post-patch: @${REINPLACE_CMD} -Ee \ 's,^((LD|C)FLAGS),#\1,;;s,^(prefix=),#\1,;;s,^(.*-install),#\1,' \ ${WRKSRC}/Makefile +.if defined(WITH_PGO) +.if target(pre-build) +.error Makefile error since pre-build target has already been defined +.endif +pre-build: pgo +.endif + # Peter Jeremy recommended the use of b64decode and md5 20040302 post-install: @${REINPLACE_CMD} -Ee 's|^(.*/openssl base64 -d/)|#\1|' \ @@ -78,4 +97,19 @@ done .endif -.include +.if defined(WITH_PGO) +pgo: pgo-build pgo-run pgo-clean + +pgo-build: + @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} CFLAGS="${CFLAGS} -fprofile-generate" LDFLAGS="${LDFLAGS} -fprofile-generate" ${ALL_TARGET}) + +pgo-run: +# Check everything to generate profiling information. +# We will ignore any errors. + @-(cd ${BUILD_WRKSRC}; ${MAKE} megatest) + +pgo-clean: + @(cd ${BUILD_WRKSRC}; ${MAKE} clean) +.endif # if defined(WITH_PGO) + +.include --- crm114-20080326_2.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: