Re: Compile FreeBSD kernel with gcc48

2012-11-14 Thread Alie Tan

 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=81
-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
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Compile FreeBSD kernel with gcc48

2012-11-11 Thread Garrett Cooper
On Sun, Nov 11, 2012 at 1:59 AM, Alie Tan a...@affle.com wrote:

 Hi,

 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

 Another question, is there any benchmark for LLVM/Clang vs gcc45, gcc46,
 gcc47 or gcc48?


Uh, probably won't work because of FreeBSD modifications to gcc not being
present in upstream IIRC...
-Garrett
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Compile FreeBSD kernel with gcc48

2012-11-11 Thread Andriy Gapon
on 11/11/2012 12:26 Garrett Cooper said the following:
 On Sun, Nov 11, 2012 at 1:59 AM, Alie Tan a...@affle.com wrote:
 
 Hi,

 Anyone have experience compiling FreeBSD kernel with gcc48

 I have tried it but no success with this in src.conf

It would be more productive to detail no success.

 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

 Another question, is there any benchmark for LLVM/Clang vs gcc45, gcc46,
 gcc47 or gcc48?

 
 Uh, probably won't work because of FreeBSD modifications to gcc not being
 present in upstream IIRC...

Which exact modifications do you have in mind?
I was able to compile the kernel with gcc46.

I used these settings:

CC= /usr/local/bin/gcc46
CXX=/usr/local/bin/g++46
AS= /usr/local/bin/as
LD= /usr/local/bin/ld
NO_WERROR=yes
WERROR=

CWARNFLAGS= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
-Wno-pointer-sign -D__FreeBSD_cc_version=81 \
-Wno-unused-function -Wno-inline

I guess that perhaps 'WERROR=' made the difference.
-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Compile FreeBSD kernel with gcc48

2012-11-11 Thread Garrett Cooper
On Sun, Nov 11, 2012 at 4:07 AM, Andriy Gapon a...@freebsd.org wrote:

 on 11/11/2012 12:26 Garrett Cooper said the following:
  On Sun, Nov 11, 2012 at 1:59 AM, Alie Tan a...@affle.com wrote:
 
  Hi,
 
  Anyone have experience compiling FreeBSD kernel with gcc48
 
  I have tried it but no success with this in src.conf

 It would be more productive to detail no success.

  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
 
  Another question, is there any benchmark for LLVM/Clang vs gcc45, gcc46,
  gcc47 or gcc48?
 
 
  Uh, probably won't work because of FreeBSD modifications to gcc not being
  present in upstream IIRC...

 Which exact modifications do you have in mind?
 I was able to compile the kernel with gcc46.

 I used these settings:

 CC= /usr/local/bin/gcc46
 CXX=/usr/local/bin/g++46
 AS= /usr/local/bin/as
 LD= /usr/local/bin/ld
 NO_WERROR=yes
 WERROR=

 CWARNFLAGS= -Wall -Wredundant-decls -Wnested-externs
 -Wstrict-prototypes \
 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
 -Wno-pointer-sign -D__FreeBSD_cc_version=81 \
 -Wno-unused-function -Wno-inline

 I guess that perhaps 'WERROR=' made the difference.


-fformat-extensions ?
-Garrett
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Compile FreeBSD kernel with gcc48

2012-11-11 Thread Andriy Gapon
on 11/11/2012 14:09 Garrett Cooper said the following:
 On Sun, Nov 11, 2012 at 4:07 AM, Andriy Gapon a...@freebsd.org
 mailto:a...@freebsd.org wrote:
 
 on 11/11/2012 12:26 Garrett Cooper said the following:
  On Sun, Nov 11, 2012 at 1:59 AM, Alie Tan a...@affle.com
 mailto:a...@affle.com wrote:
[snip]
  -Wno-format
[snip]
  NO_WERROR= 1
[snip]
 WERROR=
[snip]
 
 -fformat-extensions ?

The above should take care of it.

-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Compile FreeBSD kernel with gcc48

2012-11-11 Thread Dimitry Andric

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. ;-)
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org