From owner-freebsd-current@FreeBSD.ORG Thu Nov 15 02:46:07 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 A4580314 for ; Thu, 15 Nov 2012 02:46:07 +0000 (UTC) (envelope-from alie@affle.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4EC618FC12 for ; Thu, 15 Nov 2012 02:46:06 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fo13so1576633vcb.13 for ; Wed, 14 Nov 2012 18:46:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :x-gm-message-state; bh=uQSCorq3dP1xZvEYoihW8XJp3sw5Fnjb748QkVuzLJ0=; b=olJgFvoB8oKs01ZbVCZYIAPMNcVGnBeDGXW9NA+h20HyzUo0xHDv8ghLMs7Y+mV/60 k8D2On6bi5qfc+lBohfNVEGpC0nCuRAlFPK8U5ZpINlTpFMfh2bEvnq9Hc2Dq3atjg5d QMnRqap21gmsHvFx7sxH1vc+LkgwXDBuaH3D91NemcbD7dKr0YAyIoRIgIb0YQbHcPKY ThgGkDZkOGazl5wbu3yTMtVD14e5JXiiqje5DEO5BX14BxJG3Ub09WaS5ofkuQ3jGAE1 m7Jb9cmc/Tskh6O5WgY9X00U50deEUSj1mwcgFIaBsVIKfHMsMVe7I/ZZRUIOhKqqWbC KFFQ== MIME-Version: 1.0 Received: by 10.221.0.212 with SMTP id nn20mr13988910vcb.32.1352947566084; Wed, 14 Nov 2012 18:46:06 -0800 (PST) Received: by 10.58.178.234 with HTTP; Wed, 14 Nov 2012 18:46:05 -0800 (PST) Date: Thu, 15 Nov 2012 10:46:05 +0800 Message-ID: Subject: Re: Compile FreeBSD kernel with gcc48 From: Alie Tan To: freebsd-current@freebsd.org X-Gm-Message-State: ALoCoQnPdTdVwCr4NNoueOESCngwlb//Uky9CZaxITdi8RqOtLmSeQUIuOVySX3WiwftnESI73D+ Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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: Thu, 15 Nov 2012 02:46:07 -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. ;-) No idea why since there is no compilation error. It stops at this point: /usr/local/bin/gcc48 -O2 -pipe -O3 -fno-strict-aliasing -pipe -funroll-loops -I/usr/src/lib/libc/include -I/usr/src/lib/libc/../../include -I/usr/src/lib/libc/amd64 -DNLS -D__DBINTERFACE_PRIVATE -I/usr/src/lib/libc/../../contrib/gdtoa -DINET6 -I/usr/obj/usr/src/lib/libc -I/usr/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/src/lib/libc/../../contrib/tzcode/stdtime -I/usr/src/lib/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DNS_CACHING -DSYMBOL_VERSIONING -std=gnu99 -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wno-pointer-sign -D__FreeBSD_cc_version=800001 -Wno-unused-function -Wno-inline -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c nslexer.c -o nslexer.o In file included from /usr/src/lib/libc/net/nslexer.l:49:0: /usr/src/lib/libc/../../include/nsswitch.h:236:14: warning: redundant redeclaration of '_nsyylineno' [-Wredundant-decls] extern int _nsyylineno; And waited for couple of hours still hanging at that point with gcc48 Regards, Alie T