clangbsd - bsdcan.org · what is this all about? i gcc 4.2.1/binutils 2.15 and no updates allowed i...

30
ClangBSD Roman Divacky, [email protected] May 1st, 2010 Roman Divacky, [email protected] ClangBSD

Upload: others

Post on 19-Oct-2019

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

ClangBSD

Roman Divacky, [email protected]

May 1st, 2010

Roman Divacky, [email protected] ClangBSD

Page 2: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is this all about?

Roman Divacky, [email protected] ClangBSD

Page 3: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is this all about?

I GCC 4.2.1/Binutils 2.15 and no updates allowed

I Old, buggy, unmaintainable

I Missing features - C++0x, newer CPUs support

I .... solution?

Roman Divacky, [email protected] ClangBSD

Page 4: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is Clang/LLVM?

Roman Divacky, [email protected] ClangBSD

Page 5: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is Clang/LLVM?

C/C++/ObjC compiler

Roman Divacky, [email protected] ClangBSD

Page 6: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is Clang/LLVM?

Mature

Roman Divacky, [email protected] ClangBSD

Page 7: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is Clang/LLVM?

Developer friendly

Roman Divacky, [email protected] ClangBSD

Page 8: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is Clang/LLVM?

BSDL-like licensed

Roman Divacky, [email protected] ClangBSD

Page 9: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is Clang/LLVM?

I Supports - X86, ARM, PowerPC, Mips, Sparc etc.

I Advanced optimizations (LTO, JIT etc.)

I Drop-in replacement for GCC

I Fast, understandable warnings, easy to contribute

I Used everywhere (ruby, php, python, MacOSX ...)

I Actively developed (Apple, Google, Cray, OSS ...)

Roman Divacky, [email protected] ClangBSD

Page 10: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is Clang/LLVM?

I compiler-rt

I llvm-mc

I static analysis

I libc++

Roman Divacky, [email protected] ClangBSD

Page 11: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is Clang/LLVM?

I http://clang.llvm.org

I http://llvm.org

I http://llvm.org/devmtg/2009-10/StateOfClang.pdf

I http://clang.llvm.org/performance.html

I http://llvm.org/Users.html

Roman Divacky, [email protected] ClangBSD

Page 12: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is Clang/LLVM?

DEMO

Roman Divacky, [email protected] ClangBSD

Page 13: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is Clang/LLVM?

Roman Divacky, [email protected] ClangBSD

Page 14: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is Clang/LLVM?

Roman Divacky, [email protected] ClangBSD

Page 15: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is Clang/LLVM?

kernel world clang/llvm

0

500

1000

1500

2000

2500

3000

3500

4000

Compile times

clanggcc

6,77 %

9,87 %

33,51 %

Roman Divacky, [email protected] ClangBSD

Page 16: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is ClangBSD?

Roman Divacky, [email protected] ClangBSD

Page 17: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is ClangBSD?

A lot of testing....

Roman Divacky, [email protected] ClangBSD

Page 18: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is ClangBSD?

...and analyzing/bugsubmitting

Roman Divacky, [email protected] ClangBSD

Page 19: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

What is ClangBSD?

I Clang/LLVM build system integrated into FreeBSD

I Small modifications to the buildsystem

I Aim at supporting all GCC-driver-compatible compilers

I Bug fixes and workarounds in the FreeBSD sources

Roman Divacky, [email protected] ClangBSD

Page 20: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

Status of ClangBSD

Roman Divacky, [email protected] ClangBSD

Page 21: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

Status of ClangBSD?

Compiles everything...

Roman Divacky, [email protected] ClangBSD

Page 22: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

Status of ClangBSD?

...on amd64 and i3861

1We even have FreeBSD printf extensions :)Roman Divacky, [email protected] ClangBSD

Page 23: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

Status of ClangBSD?

I AMD64 compiles and works just fine

I i386 miscompiles some pieces but fine otherwise

I ARM - good support but no FreeBSD interest

I Mips - Oleksander Tymoshenko, missing -mno-abicalls

I PowerPC - Nathan Whitehorn, missing va args handling

I Sparc64 - missing 64bit ABI support, work-in-progress

I IA64 - removed in the past, no effort here

Roman Divacky, [email protected] ClangBSD

Page 24: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

Status of ClangBSD?

I Code size problems (i386/boot2)

I Inline asm not 100% on X86 (libc, mplayer)

I Warnings all over the place

I Miscompilations

I Profiling missing

Roman Divacky, [email protected] ClangBSD

Page 25: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

Status of ClangBSD?

Difference to what will be integrated

I Clang as the default compiler

I contrib/llvm contains unecessary stuff

I Unfinished integration upstream (driver changes etc.)

I Makefile.inc1 needs to be polished

I Changes to src

Roman Divacky, [email protected] ClangBSD

Page 26: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

Status of ClangBSD?

Ports

I Ongoing effort (kwm, rene, andrius)

I Lots of hardcoded gcc stuff

I C99 vs C89

I Clang is more strict than GCC 4.2

Roman Divacky, [email protected] ClangBSD

Page 27: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

Future of ClangBSD

Roman Divacky, [email protected] ClangBSD

Page 28: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

Future of ClangBSD?

Integration!

Roman Divacky, [email protected] ClangBSD

Page 29: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

Future of ClangBSD?

I Runtime testing calls

I Internal discussion

I Import!

Roman Divacky, [email protected] ClangBSD

Page 30: ClangBSD - bsdcan.org · What is this all about? I GCC 4.2.1/Binutils 2.15 and no updates allowed I Old, buggy, unmaintainable I Missing features - C++0x, newer CPUs support

Questions?

Roman Divacky, [email protected] ClangBSD