Un ./configure plein de promesses d'espoir, de paix et d'amour :
Target CPU is .................... i386
Target ABI is .................... elf
Target OS is ..................... openbsd
Compiler is called ............... pcc
Installing compiler into ......... /usr/local/bin
Installing pre-processor into .... /usr/local/libexec
Using assembler .................. <default>
Using linker ..................... <default>
Using include path ............... <default>
Using library path ............... <default>
Has TLS support .................. no
Has GCC compatibility ............ yes
Type of wchar_t is ............... UNSIGNED (4 bytes)
Une compilation qui prend moins de 60 secondes, et un binaire de 17Ko !
$ dir /usr/local/bin/pcc
712060 -rwxr-xr-x 1 root wheel - 18132 Dec 31 11:58 /usr/local/bin/pcc
$ file /usr/local/bin/pcc
/usr/local/bin/pcc: ELF 32-bit LSB executable, Intel 80386, version 1, for OpenBSD, dynamically linked (uses shared libs), stripped
Allez, testons
$ cat test.c
- include <stdio.h>
int main(void) { return printf("Hello, word !\n"); }
$ pcc test.c
$ gcc test.c
$ dir a.out-gcc a.out-pcc
14083625 -rwxr-x--- 1 dargor dargor - 6735 Dec 31 12:01 a.out-gcc
14083624 -rwxr-x--- 1 dargor dargor - 6738 Dec 31 12:00 a.out-pcc
$ file a.out-*
a.out-gcc: ELF 32-bit LSB executable, Intel 80386, version 1, for OpenBSD, dynamically linked (uses shared libs), not stripped
a.out-pcc: ELF 32-bit LSB executable, Intel 80386, version 1, for OpenBSD, dynamically linked (uses shared libs), not stripped
$ ./a.out-gcc
Hello, word !
$ ./a.out-pcc
Hello, word !
Plutôt encourageant (avec la version du cvs openbsd -current, la compilation foirait à cause des attributs de gcc)
$ gcc --version
gcc (GCC) 3.3.5 (propolice)
$ pcc --version
pcc 0.9.9 for i386-unknown-openbsd4.6, root@oblivion.jeuxvideo.com Thu Dec 31 11:57:34 CET 2009
Tentons maintenant un kernel
$ mkdir ~/tmp/bsd-pcc
$ cd ~/tmp/bsd-pcc
$ export CC=/usr/local/bin/pcc
$ config -s /usr/src/sys -b . /usr/src/sys/arch/`uname -m`/conf/GENERIC.MP
$ make clean && make depend
$ time make
Échec de compilation à cause d'un warning, que gcc laisse passer d'ailleurs... 
Modification du makefile pour virer -Werror, et on repart !
$ vim Makefile
$ make clean && make depend
$ time make
real 1m15.781s
user 1m0.250s
sys 0m12.790s
$ dir bsd
14086471 -rwxr-xr-x 1 dargor dargor - 8330128 Dec 31 12:15 bsd
$ file bsd
bsd: ELF 32-bit LSB executable, Intel 80386, version 1, statically linked, not stripped
Pareil avec gcc, juste pour le fun...
$ mkdir ~/tmp/bsd-gcc
$ cd ~/tmp/bsd-gcc
$ export CC=/usr/bin/gcc
$ config -s /usr/src/sys -b . /usr/src/sys/arch/`uname -m`/conf/GENERIC.MP
$ make clean && make depend
$ time make
real 3m17.274s
user 2m57.940s
sys 0m19.840s
$ dir bsd
14085181 -rwxr-xr-x 1 dargor dargor - 7520036 Dec 31 12:10 bsd
$ file bsd
bsd: ELF 32-bit LSB executable, Intel 80386, version 1, statically linked, not stripped
Plus qu'à rebooter avec notre beau kernel tout neuf, tout propre
$ su -
- cp -i /home/dargor/tmp/bsd-gcc/bsd /bsdgcc
- cp -i /home/dargor/tmp/bsd-pcc/bsd /bsdpcc
Adieu monde cruel...
(un reboot plus tard)
ÇA FONCTIONNE, ÇA FONCTIONNE !!
$ uname -a
OpenBSD oblivion.jeuxvideo.com 4.6 bsd#0 i386
Un ptit dmesg : http://athanatos.free.fr/OpenBSD/dmesg-pcc
pcc 