This is my third iteration of compiler design and implementation.
The bcc compiler is heavily based on the predecessor benc.
The compiler generates assembly for the System V ABI, where applicable.
More documentation can be found in bcc(1).
Planned features can be read in the TODO file.
NOTE: if no configure script is available, please run
./autogen.sh
./configure
Common configure options:
| Option | Description |
|---|---|
| --help | see all available options |
| --prefix=PREFIX | installation path |
| --target=TARGET | target architecture |
| --enable-bcl | install the deprecated wrapper script bcl |
| --disable-fp | disable preliminary floating-point support |
| --disable-target-libbcc | don't build & install the compiler-support library |
| --with-cpu=CPU | select the default target CPU |
| --with-abi=ABI | select the default target ABI |
| --with-dl=PATH | overwrite the default path to the dynamic linker |
| --disable-bash-completions | disable the installation of bash-completions |
For debug builds use:
CFLAGS="-g -Og" ./configure
Just a simple
make
Just install to PREFIX (default: /usr/local)
sudo make install
Install to a different PREFIX:
make DESTDIR=... install
Testing can be performed with:
make check
If you have any issues, please paste the output.
The target can be specified as: cpu-vendor-os
Note: Due to not being able to compile any libc, please build the C library of your choice with a working C compiler (such as gcc) or use your pre-installed one. After you installed bcc, use the util/fix_crts.sh script to point the compiler to your pre-installed libc. This does not apply if you have a -elf target.
| CPU | Other Names | Notes |
|---|---|---|
| i386, i486, i586, i686 | x86-32, IA-32 | |
| x86_64 | amd64, EMT64 | Most tested |
| riscv32 | RISC-V (32 bit) | Untested |
| riscv64 | RISC-V (64 bit) | |
| arm, armv* | 32 bit little-endian ARMv4+ |
Alternative names for processor architectures can be added here.
| OS | Notes |
|---|---|
| linux* | Both musl libc and glibc work with the above-mentioned work-around. |
| elf | A standalone environment. |
Support for operating systems can be added here.
| libc | Notes |
|---|---|
| glibc | |
| musl |
Support for libc's can be added here and in the src/%arch/config.c files.
When porting, please also look into the include/config directory.
Feel free to create an Issue or a Pull Request.
Patches can also be send directly to [email protected].