Cross binutils vasm/vlink
How to create binutils (vasm, vlink) needed for FreePascal crosscompiling on a linux system.
These instructions apply for the targets Amiga (m68k), AmigaOS (ppc), MorphOS (ppc) and AROS (i386)
Requirements
- working linux with gcc (e.g. ubuntu: sudo apt install build-essentials)
- latest sources of vasm/vlink
Instructions
- create a working dir (e.g.
mkdir build
) - enter the directory (e.g.
cd build
) - create a directory that will store the results (e.g.
mkdir release
) - Vasm assembler: Retrieve sources, create and build
- retrieve the latest sources for vasm
- extract the sources for vasm
tar -xvzf "vasm.tar.gz"
- enter the vasm sources directory
cd vasm
- create vasm
- for powerpc:
make -f Makefile CPU=ppc SYNTAX=std
- for m68k
make -f Makefile CPU=68k SYNTAX=std
- for x86
make -f Makefile CPU=x86 SYNTAX=std
- copy vasm executables to the release folder.
- for powerpc:
cp "vasmppc_std" "../release"
- for m68k:
cp "vasmm68k_std" "../release"
- for x86:
cp "vasmx86_std" "../release"
- enter your work directory again
cd ..
- Vlink linker: Retrieve sources, create and build
- retrieve the latest sources for vasm
- extract the sources for vasm
tar -xvzf "vlink.tar.gz"
- enter the vlink sources directory
cd vlink
- create vlink
make -f Makefile
- copy vlink executable to the release folder.
cp "vlink" "../release"
- enter your work directory again
cd ..
The compiled tools do now reside in the work/release directory. Note that the vlink linker is only generated once because it supports all targets as mentioned.
Installation
install vasm assembler and vlink linker in your system
- copy and rename the assembler to /usr/bin with prefix powerpc-morphos (e.g. cp gas/as-new /usr/bin/powerpc-morphos-as)
- copy and rename the linker to /usr/bin with prefix powerpc-morphos (e.g. cp ld/ld-new /usr/bin/powerpc-morphos-ld)
editors note: add the missing platforms and use/correct the right naming scheme.
Usage
The vasm/vlink combination with Free Pascal can nor be used by providing the additional command-line options -XV and -Avasm to the fpc commandline compiler.
NOTE/WARNING: You can not mix vasm/vlink compiled units with those generated by gnu ld/as
in order to create the fpc cross-compiler use the additional make options: CROSSOPT="-XV -Avasm"