AMIGA alive

AMIGA alive

Thursday, August 3, 2017

vbcc - Volker Barthelmann's C compiler

The great compilers on AmigaOS (and for AmigaOS) like SAS/C and gcc (ADE/geekgadgets) are getting some serious competition by the name of vbcc, which is an acronym for "Volker Barthelmann's C compiler".

What makes vbcc great?

It...

...is cross-platform / portable
...can cross-compile for different targets
...is very fast
...produces small binaries
...has a clear concept, working default configurations, and is easily installed
...is actively developed with modern standards in mind
...still supports AmigaOS1.3 and plain 68000

Portability & cross-compilation targets

vbcc's portability seems to be near-perfect. It runs on almost all AmigaOS flavours (m68k/Classic, PPC/WarpOS/PowerUP, PPC/AmigaOS4, MorphOS), as well as on Atari, Linux, Mac and Windows, and can compile for almost all AmigaOS flavours, and different Atari operating systems. Building vbcc under Linux works like a charm, if you know what you're doing you can set up a cross-compiler environment in just minutes.

(Note that there's also a version for AROS, but it looks like it's outdated / incomplete / development has stopped. (?))
 

Installation

Binary and target archives are provided via e.g. AmiNet:
http://aminet.net/search?query=vbcc

Installation on Amiga can be done via the included Installer-script, which also copies a target's configuration files to vbcc's directory. The whole process is nothing magical, and can be easily applied to e.g. Linux. Very good.

Speed

Debugging software written by other authors, and porting software from other systems requires an insane amount of compiler re-runs. Combined with a large project this results in noticeable, sometimes painful time wasted just hitting cursor-up, return and waiting.

Compiling a "helloworld.c" type program (1.5KB of printf()s and the likes) with vbcc is about three times as fast as with gcc.

(Cross-compiling on your gigahertz-multicore Linux box is ridiculously fast, compared to Amiga-speeds. A 66KB sized sourcecode file with some includes and a few precompiled objects attached compiles in what can legitimately be described as no time.)

Size of binaries created by vbcc

A quick check gave these results:
1568 bytes of source code, helloworld.c type, #include <stdio.h>
gcc binary without ixemul.library usage (libnix): 25580 bytes
gcc binary (with ixemul.library usage): 18636 bytes
vbcc binary (vbcc's vc.lib): 4868 bytes

Porting programs written for SAS/C or gcc

vbcc sits somewhere in between: it has good built-in support for AmigaOS, but lacks some of SAS/C's features, and currently has limited support for GNU/POSIX. You may want to add some own inventions. If you add new header files and/or libraries for compatibility (e.g. from gcc/ADE/geekgadgets or libnix), you will run into (resolvable) conflicts. While SAS/C and ADE/geekgadgets provide additional developer tools (e.g. make) required in the build process, vbcc is (basically) just a compiler.

Cross-compiling binaries for AmigaOS on other operating systems

As has been said before, installation is simple, and almost identical on all host systems, and so is cross-compiling. Under Linux, two changes were required to make vbcc-Linux compile a previous vbcc-AmigaOS project: add compiler config option "+aos68k", and add Linux include path to NDK_3.9/Include/include_h directory to config file "aos68k" to Linux paths.

Impressive!

Overall, the impression left by vbcc is utterly positive. There are a few flaws, e.g. some error messages could be more precise, gcc's __FUNCTION__ and __LINE__ macros or a substitute would be very helpful, and AROS host and target modules would really be nice, but it works fine on different platforms including classic AmigaOS, is easy to use, creates quality code, is fast, etc. pp. and best of all it all comes with superb cross-platform capabilities: the concept of exchangable host and target modules is an invaluable tool for cross-Amiga-platform development, and may help unify the scattered Amiga landscape.

Huge THANK YOU to Volker Barthelmann and co-authors (vasm, vlink), and iComp GmbH for sponsoring vbcc m68k-AmigaOS!


Sources:
http://sun.hasenbraten.de/vbcc/
http://blitterstudio.com/setting-up-an-amiga-cross-compiler/
http://blitterstudio.com/setting-up-an-amiga-cross-compiler-windows/

No comments:

Post a Comment