From owner-freebsd-current@FreeBSD.ORG Sun Nov 11 12:27:36 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34D9E324 for ; Sun, 11 Nov 2012 12:27:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id DECC58FC08 for ; Sun, 11 Nov 2012 12:27:35 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:9d32:5200:f533:2e10] (unknown [IPv6:2001:7b8:3a7:0:9d32:5200:f533:2e10]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id C22115C59; Sun, 11 Nov 2012 13:27:27 +0100 (CET) Message-ID: <509F99AE.7020706@FreeBSD.org> Date: Sun, 11 Nov 2012 13:27:26 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alie Tan Subject: Re: Compile FreeBSD kernel with gcc48 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2012 12:27:36 -0000 On 2012-11-11 10:59, Alie Tan wrote: > Anyone have experience compiling FreeBSD kernel with gcc48 > > I have tried it but no success with this in src.conf > > C= /usr/local/bin/gcc48 > CXX= /usr/local/bin/g++48 > CWARNFLAGS= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > \-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual > \-Wno-pointer-sign -D__FreeBSD_cc_version=0 \-Wno-unused-function > -Wno-inline -Wno-format \-Wno-uninitialized -Wno-array-bounds > -Wno-missing-prototypes > NO_WERROR= 1 Last time I tried, I could get it to build with a gcc 4.8 snapshot, but it failed to boot. I did not investigate a great deal, but it looked a lot like some sort of optimization bug. Note that gcc 4.8 is still experimental, so problems like this can be expected. However, with gcc 4.7.1, which is a released version, the kernel did build, and even boot. With that kernel booted, I timed how long a "make -j8 buildworld" took, compared to booting with kernels compiled by gcc in base (v4.2.1) and clang in base (v3.2), on different optimization settings. The raw results are here: http://www.andric.com/freebsd/perftest/perftest-kernel-2012-09-25b.txt Summary: - Kernels compiled with clang 3.2 at -O2 are ~8% faster in system time than kernels compiled with gcc 4.2.1 at -O2. - Kernels compiled with clang 3.2 at -O2 perform equally to kernels compiled with gcc 4.7 at -O2, there is no significant difference. - Kernels compiled with gcc 4.7 at -O3 have a slight advantage in system time (~3.6%) against kernels compiled with clang 3.2 at -O2. (I did not test a kernel compiled with clang 3.2 at -O3.) > Another question, is there any benchmark for LLVM/Clang vs gcc45, gcc46, > gcc47 or gcc48? As said, I only tested clang 3.2 against gcc 4.2 from base, and gcc 4.7.1 (hand-built, since the version from ports is inexplicably some random snapshot, not a released version). If anybody is extremely interested in more results, they should sponsor some fast hardware, and donate it to the FreeBSD Project. ;-)