======================================
vbcc 68k-amiga cross compiler to Linux
======================================
Fisrt you need to get sources to vbcc, vasm and vlink, config files and at
least m68k amiga target.
* wget http://www.ibaug.de/vbcc/vbcc.tar.gz
* wget http://sun.hasenbraten.de/vlink/release/vlink.tar.gz
* wget http://sun.hasenbraten.de/vasm/release/vasm.tar.gz
* wget http://mail.pb-owl.de/~frank/vbcc/2009-10-16/vbcc_unix_config.zip
* wget http://mail.pb-owl.de/~frank/vbcc/2009-10-16/vbcc_target_m68k-amigaos.lha
Extract packages and you have five directories called vasm, vbcc and vlink,
config and vbcc_target_m68k-amigaos.
* tar xzf vasm.tar.gz
* tar xzf vbcc.tar.gz
* tar xzf vlink.tar.gz
* unzip vbcc_unix_config.zip
- Zips are not very good with permissions.
+ chmod +x config
+ chmod +r config/*
* lha x vbcc_target_m68k-amigaos.lha
* ls
----
vbcc
----
* cd vbcc
* mkdir bin
Modify vbcc:s Makefile with your favorite text editor
"...
CC = gcc -g
LDFLAGS = -lm
..."
* make TARGET=m68k
- answer questions. For example x86 is little-endian and ppc is big-endian.
Defaults are ok with both 64-bit and 32-bit systems.
----
vasm
----
* cd ../vasm
* make CPU=m68k SYNTAX=mot
-----
vlink
-----
* cd ../vlink
"Note:When running a 64-bit architecture/compiler you have to change -DTYPES32BIT into -DTYPES64BIT in your Makefile." http://sun.hasenbraten.de/vlink/index.php?view=compile
* mkdir objects
* make
-------------------
Installing binaries
-------------------
/home/user/vbcc is here prefix of the vbcc. Change it something like
/usr/local/vbcc if you like.
* cd ..
* mkdir /home/user/vbcc
* cp -a vbcc/bin /home/user/vbcc/
* cp vasm/vasmm68k_mot vasm/vobjdump vlink/vlink /home/user/vbcc/bin/
* sed -i 's/\/usr\/local/\/home\/user/' config/aos68k
- replace /usr/local/ from every config file with 'prefix'. In this case
prefix is /home/user/.
* cp -r config /home/user/vbcc/
Then you need some targets from http://sun.hasenbraten.de/vbcc/index.php?view=main.
* mkdir /home/user/vbcc/targets
* cp -a vbcc_target_m68k-amigaos/targets/m68k-amigaos /home/user/vbcc/targets/
---------------------
Environment variables
---------------------
Create shell script or add end of your shell rc file following lines. Replace
with /home/user/
"...
setenv VBCC /vbcc
setenv PATH /vbcc/bin:"$PATH"
"
or
"
export VBCC=/vbcc
export PATH=/vbcc/bin:$PATH
"
At least with bash shell script should be executed with 'source' or '.' command
* "source vbcc-env.sh" or ". vbcc-env.sh"
-------
Testing
-------
Make sure environment variables are ok.
* echo $VBCC
* echo $PATH
Create test.c:
"
#include
int main (int argc, char **argv)
{
printf ("Test!!\n");
return 0;
}
"
..compile it
* vc +m68k test.c -o test
You might need headers from amiga developers cd and/or os3.9sdk headers from
To find out.
* cp -r /include /home/user/vbcc/
* cp -r /lib /home/user/vbcc/
Then you need to add paths to the $VBCC/config/aos68k. Just to every line add
-I/.../vbcc/include before original -I:s and -L/.../vbcc/lib before original
-L:s.
-----
POSIX
-----
To make vbcc & co. more POSIX compilant use PosixLib. aminet is your friend.
----------------------------------------------------------
How to decrease size of the binary when using only 68k asm
----------------------------------------------------------
There is startup.o dropped. It contains startup-code. So there is needed to
create new config.
for example aos68k-asm with content something like:
"""
-cc=vbccm68k -quiet %s -o= %s %s -O=%ld
-ccv=vbccm68k %s -o= %s %s -O=%ld
-as=vasmm68k_mot -quiet -Fhunk -phxass %s -o %s -I/home/user/vbcc/include-asm
-asv=vasmm68k_mot -Fhunk -phxass %s -o %s -I/home/user/vbcc/include-asm
-rm=rm -f %s
-rmv=rm %s
-ld=vlink -bamigahunk -x -Bstatic -Cvbcc -nostdlib -L/home/user/vbcc/targets/m68k-amigaos/lib/ %s %s -o %s
-l2=vlink -bamigahunk -x -Bstatic -Cvbcc -nostdlib %s %s -o %s
-ldv=vlink -bamigahunk -t -x -Bstatic -Cvbcc -nostdlib -L/home/user/vbcc/targets/m68k-amigaos/lib/ %s %s -o
-l2v=vlink -bamigahunk -t -x -Bstatic -Cvbcc -nostdlib %s %s -o %s
-ldnodb=-s -Rshort
-ul=-l%s
-cf=-F%s
-ml=500
"""
Use this only with 68k asm projects!
* vc +aos68k-asm test.s -o test
-----
Links
-----
* vbcc documentation [html]
* vasm documentation [html]
* vlink documentation [pdf]