From owner-freebsd-ports@FreeBSD.ORG Mon Jun 28 03:41:46 2010 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB589106566B for ; Mon, 28 Jun 2010 03:41:46 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3A73A8FC08 for ; Mon, 28 Jun 2010 03:41:45 +0000 (UTC) Received: by fxm13 with SMTP id 13so810150fxm.13 for ; Sun, 27 Jun 2010 20:41:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=pWrqXvFdKo9pkGnlVsWe545p3unHXjznmlXEWBynZCM=; b=d6DrK5Sb6Td0TownmT6KzYGXklL6oFSrnAJan49DUwydd8dOxyRDatpEHOGnNIdXiF wC7fu7NW989VAFMfCC08pHvIPig5FjoANMv8cjx0kcvLl3XgE6VYJLcCrdhLD3Q2tCme yN0/a8Esu3Sc2Bc+m1kiTgHba8HDDZToXmCrY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=LG9Lhasd2clv4/kua850YCg0k9LhrL1cOQS0Hs3R6efNUjKtRSxjOM10i+MFPihwmh M/HkuEmiAP0Q42GC/tKsErvhw8p+qUyYATzKVBgzx8SITxV/xd+M4HxgaI/EkFYtpyDm siNLAmDrpNRtaMLctFueistHOMYFFL3Ok3yZA= Received: by 10.223.26.206 with SMTP id f14mr3227873fac.96.1277696490192; Sun, 27 Jun 2010 20:41:30 -0700 (PDT) Received: from localhost (anonymizer2.torservers.net [173.244.197.210]) by mx.google.com with ESMTPS id y2sm44323599faj.15.2010.06.27.20.41.28 (version=SSLv3 cipher=RC4-MD5); Sun, 27 Jun 2010 20:41:29 -0700 (PDT) From: Anonymous To: Eitan Adler References: Date: Mon, 28 Jun 2010 07:41:22 +0400 In-Reply-To: (Eitan Adler's message of "Sun, 27 Jun 2010 23:09:47 -0400") Message-ID: <86pqzbbz8d.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd ports Subject: Re: flag to tell ports that you are only building for yourself 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: Mon, 28 Jun 2010 03:41:46 -0000 Eitan Adler writes: > I'd like to add a flag to tell ports that you are building only for > yourself that and optimizations that typically are not enabled could > be turned on. There is already MACHINE_CPU. Depending on CPUTYPE it's set to supported SIMD instructions. But it doesn't recognize CPUTYPE=native currently. Until conf/112997 is resolved you can add smth like this to make.conf CPUTYPE ?= native MACHINE_CPU != echo ${MACHINE_ARCH}; ${CC} -E -dM -v -march=${CPUTYPE} - &1 \ | awk '/SSE|MMX/ && !/MATH/ { FS="__"; gsub("_",".",$$2); print tolower($$2) }' Then you can start adding in your port (ex. for multimedia/mplayer) .if ${MACHINE_CPU:Mssse3} CONFIGURE_ARGS += --enable-ssse3 .else CONFIGURE_ARGS += --disable-ssse3 .endif > The first two that come to mind are -mtune=native and -march=native. _CPUCFLAGS are set by CPUTYPE. $ make -V CPUTYPE native $ make -V _CPUCFLAGS -march=native $ make -V MACHINE_CPU amd64 sse4.1 mmx sse2 ssse3 sse sse3 amd64 sse2 sse mmx Besides, gcc(1) says -march=cpu-type Generate instructions for the machine type cpu-type. The choices for cpu-type are the same as for -mtune. Moreover, specifying -march=cpu-type implies -mtune=cpu-type. -mcpu=cpu-type A deprecated synonym for -mtune. So, you don't need -mtune and -mcpu. > Ports would be able to add more flags as needed. This could allow > ports to optimize themselves to the architecture they on without > losing the ability to cross build or have build clusters. Any case where it would be useful besides -march/-mtune/-mmmx/-msse*?