|[ << ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
vbcc is a highly optimizing portable and retargetable ISO C compiler. It supports ISO C according to ISO/IEC 9899:1989 and a subset of the new standard ISO/IEC 9899:1999 (C99).
It is split into a target-independent and a target-dependent part, and provides complete abstraction of host- and target-arithmetic. Therefore, it fully supports cross-compiling for 8, 16, 32 and 64bit architectures.
Embedded systems are supported by features like different pointer-sizes (e.g. differently sized function- and object-pointers or near- and far-pointers), ROM-able code, inline-assembly, bit-types, interrupt-handlers, section-attributes, stack-calculation and many others (depending on the backend).
vbcc provides a large set of aggressive high-level optimizations (see section Optimizations) as well as target-specific optimizations to produce faster or smaller code. Rather than restricting analysis and optimization to single functions or files, vbcc is able to optimize across functions and even modules. Target-independent optimizations include:
vbcc is copyright in 1995-2011 by Volker Barthelmann.
This archive may be redistributed without modifications and used for non-commercial purposes.
Distributing modified versions and commercial usage needs my written consent.
This copyright applies to vc, vbcc and vsc.
This archive may contain other tools (e.g. assemblers or linkers) which do not fall under this license. Please consult the corresponding documentation of these tools.
vbcc contains the preprocessor ucpp by Thomas Pornin. Included is the copyright notice of ucpp (note that this license does not apply to vbcc or any other part of this distribution):
/* * (c) Thomas Pornin 1999, 2000 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. The name of the authors may not be used to endorse or promote * products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */
The vbcc directory tree looks as follows:
Config files for the frontend.
Subdirectory containing all files specific to a certain target (e.g. m68k-amigaos or ppc-eabi).
VBCCto the vbcc directory. Depending on your shell this might be done e.g. by
setenv VBCC <prefix>/vbcc
setenv PATH <prefix>/vbcc/bin:"$PATH"
VBCCto the vbcc directory.
vbcc 0.8g there is an Amiga Installer, which lets
you install the binary and target archives with a simple mouse click.
vbcc for AmigaOS/MorphOS is divided into the following
Binaries for AmigaOS 2.x/3.x (680x0).
Binaries for AmigaOS 4.x (PowerPC).
Binaries for MorphOS (PowerPC).
Additional PPC-native binaries using the PowerUp kernel for AmigaOS 3.x.
Additional PPC-native binaries using the WarpOS kernel for AmigaOS 3.x.
Header files and libraries for AmigaOS/M68k.
Header files and libraries for AmigaOS 4.x.
Header files and libraries for MorphOS.
Header files and libraries for PowerUp.
Header files and libraries for WarpOS.
Usually you will install the binary archive for your host architecture of choice, then add as many target archives you need.
When installing manually it is recommended to add the following assigns to your ‘s:User-Startup’ file (only do the assignments required for the installed targets):
assign >NIL: vbcc: <path to vbcc directory> assign >NIL: C: vbcc:bin add assign >NIL: vincludeos3: vbcc:targets/m68k-amigaos/include assign >NIL: vincludeos3: <path to your AmigaOS3 header files> ADD assign >NIL: vlibos3: vbcc:targets/m68k-amigaos/lib assign >NIL: vincludeos4: vbcc:targets/ppc-amigaos/include assign >NIL: vincludeos4: <path to your AmigaOS4 header files> ADD assign >NIL: vlibos4: vbcc:targets/ppc-amigaos/lib assign >NIL: vincludemos: vbcc:targets/ppc-morphos/include assign >NIL: vincludemos: <path to your MorphOS header files> ADD assign >NIL: vlibmos: vbcc:targets/ppc-morphos/lib assign >NIL: vincludepup: vbcc:targets/ppc-powerup/include assign >NIL: vincludepup: <path to your AmigaOS3 header files> ADD assign >NIL: vlibpup: vbcc:targets/ppc-powerup/lib assign >NIL: vincludewos: vbcc:target/ppc-warpos/include assign >NIL: vincludewos: <path to your AmigaOS3 header files> ADD assign >NIL: vlibwos: vbcc:target/ppc-warpos/lib
Also, the stack-size has to be increased from the default, for those binaries which don’t do that automatically (e.g. AmigaOS4). 64KB is a sensible value, for very large projects higher values might be necessary.
For writing AmigaOS/MorphOS programs you will need the appropriate system header files. Please use NDK 3.9 or later for AmigaOS/68k, as the proto/inline headers have been created with it.
There are different configuration files provided in the ‘config’-subdirectory to choose different targets (i.e. the system you want to generate programs for) and hosts (i.e. the system you want the compiler an tools to run on). The general naming-scheme for these files ist <target>_<host>.
Available config files, when all targets are installed, are ‘aos68k’ (AmigaOS on M68k), ‘aosppc’ (AmigaOS4 on PPC using vclib), ‘newlib’ (AmigaOS4 on PPC using newlib), ‘morphos’ (PPC systems running MorphOS), ‘powerup’ (PPC boards using the PowerUp system), ‘warpos’ (PPC boards using the WarpOS system).
You can choose one of these systems using the ‘+’-option
vc +aos68k_powerup ...
will compile for AmigaOS/68k using the compiler running on PowerUp.
You may choose to create copies of some of these configuration files with simpler names. E.g. if you usually want the compiler to run on WarpOS you could copy ‘aos68k_warpos’ to ‘aos68k’, ‘warpos_warpos’ to ‘warpos’ and so on. Then you can just specify the target and your preferred host system will be chosen automatically.
Additionally, you may copy the configuration file for your preferred host/target-combination to ‘vc.config’. This configuration will be chosen by default if you do not specify anything.
By default, the target-only-specifications use 68k-native tools on AmigaOS 2.x/3.x, e.g. ‘+warpos’ will create code for WarpOS, but the compiler and tools will run on the 68k. The default ‘vc.config’ will then create code for 68k using tools running on 68k. Having installed the MorphOS-native binary archive instead, the default ‘vc.config’ will create PPC code for MorphOS using tools running on MorphOS.
Now you should be able to use vbcc. To compile and link the program ‘hello.c’, type
The file ‘hello.c’ will be compiled and linked to create the executable a.out in the current directory.
vc hello.c -o hello
will do the same, but the created executable will be called ‘hello’.
vc -c t1.c t2.c
will compile ‘t1.c’ and ‘t2.c’ without linking, creating the object files ‘t1.o’ and ‘t2.o’.
vc t1.o t2.o -o tt
will link them together and create the executable ‘tt’.
If your program uses floating point, you may have to link with a math-library. The details are dependent on the target, but usually ‘-lm’ will be suitable (for AmigaOS on m68k choose one of ‘-lmieee’, ‘-lm881’ or ‘-lm040’).
vc calc.c -o calc -lmieee
|[ << ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
This document was generated by vb on January 3, 2015 using texi2html 1.82.