From owner-freebsd-questions@FreeBSD.ORG Tue Apr 8 20:14:47 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DD681065670 for ; Tue, 8 Apr 2008 20:14:47 +0000 (UTC) (envelope-from the.real.david.allen@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.238]) by mx1.freebsd.org (Postfix) with ESMTP id C48698FC24 for ; Tue, 8 Apr 2008 20:14:46 +0000 (UTC) (envelope-from the.real.david.allen@gmail.com) Received: by wr-out-0506.google.com with SMTP id 50so1817173wra.13 for ; Tue, 08 Apr 2008 13:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=sPY+i77T13xqMdGh4mwea6yOUTNucpHyHkoN7rJsXrs=; b=D+95AEv1sFfKJyrUpZfmn32VGA5vRwlgyfix08+Oavd3ZaVtL1+svKho89oqISAjrTGXd6jnzHbj306XzagFX4Zbr11kGLAUlnBmD103LqwaLGZdMiBpD/TUU4dZ+w/XF6Uyq6cB31ZEDyY7E6w4J4Sn6z1X1yLHA6Oy7H889+4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=qidnLQ94n2GxelhKBxvHoP+AtK6lthbJJoTql5b46dA4kIQb++t/yaZfEnWoMmOIEOvuZLSeIn+V8KkvKuU4SLW/rSZ4WnMDTwv8pprpTInGfAS3v2kneMfrXw1cANpk7HapSO01nuEkJwcBaPFRfRJ3MKOc+CyHHSbxY92S0ZM= Received: by 10.141.22.1 with SMTP id z1mr2221358rvi.282.1207685685107; Tue, 08 Apr 2008 13:14:45 -0700 (PDT) Received: by 10.141.153.21 with HTTP; Tue, 8 Apr 2008 13:14:45 -0700 (PDT) Message-ID: <2daa8b4e0804081314o25b9773bn844734b674856e8c@mail.gmail.com> Date: Tue, 8 Apr 2008 13:14:45 -0700 From: "David Allen" To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Setting CPUTYPE and CFLAGS in make.conf X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2008 20:14:47 -0000 The advice I've read in several posts on the subject involve everything from setting one, setting both, to ignoring both, sometimes with the =? notation and sometimes without. And then, I've read comments that suggest when compiling the kernel, for example, both are ignored, and default values (tucked away somewhere) are always applied. IIRC, the handbook recommends at least setting CPUTYPE. My question isn't a holy grail type of quest for maximised performance, but concerns the meaning of those settings with respect to building world, building kernel and anything in ports. Put another way, I'm not a computer science major, but do have different systems that I compile for, and I'd like to have a better understand WTF I'm really doing. For example, what is the difference, if any, between a binary compiled with: CPUTYPE=opteron CFLAGS=-O -pipe compares with compiling it using: CPUTYPE=pentium3 CFLAGS= compares with compiling it using what I think are the universal defaults of: CPUTYPE= CFLAGS=-O2 -fno-strict-aliasing -pipe that get applied if the make.conf is blank? Can the resulting binary be run on each other's system? Or is it simply optimised to run on one, versus another? Or are those settings relevant to the compilation process only? Or to both the compilation process and the actual performance of the binary? Or should I be taking the dog for a nice long walk instead of watching scrolling compiler output? ;-) If someone could take a moment to explain in moderately technical terms what all the above means, or suggest a source for further reading, I'd be grateful.