Difference between revisions of "Cross binutils vasm/vlink"
(creating vasm/vlink utils from scratch) |
(fixed typo for vasm CPU target option (it should read m68k instead of 68k)) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 20: | Line 20: | ||
#: <code>cd vasm</code> | #: <code>cd vasm</code> | ||
#* create vasm | #* create vasm | ||
− | #: for powerpc : <code>make -f Makefile CPU=ppc SYNTAX=std</code> | + | #: for powerpc: <code>make -f Makefile CPU=ppc SYNTAX=std</code> |
− | #: for m68k <code>make -f Makefile CPU= | + | #: for m68k <code>make -f Makefile CPU=m68k SYNTAX=std</code> |
+ | #: for x86 <code>make -f Makefile CPU=x86 SYNTAX=std</code> | ||
#* copy vasm executables to the release folder. | #* copy vasm executables to the release folder. | ||
#: for powerpc: <code>cp "vasmppc_std" "../release"</code> | #: for powerpc: <code>cp "vasmppc_std" "../release"</code> | ||
#: for m68k:<code>cp "vasmm68k_std" "../release"</code> | #: for m68k:<code>cp "vasmm68k_std" "../release"</code> | ||
− | #: for | + | #: for x86:<code>cp "vasmx86_std" "../release"</code> |
#* enter your work directory again | #* enter your work directory again | ||
#: <code>cd ..</code> | #: <code>cd ..</code> | ||
Line 47: | Line 48: | ||
install vasm assembler and vlink linker in your system | install vasm assembler and vlink linker in your system | ||
− | + | * copy and rename the assembler to <code>/usr/bin</code> with required target prefix: | |
− | + | *: for Amiga: m68k-amiga (e.g. <code>cp work/release/vasmppc_std /usr/bin/m68k-amiga-vasmppc_std</code>) | |
+ | *: for AmigaOS4: powerpc-amigaos (e.g. <code>cp work/release/vasmppc_std /usr/bin/powerpc-amigaos-vasmppc_std</code>) | ||
+ | *: <del>for Aros: i386-aros (e.g. <code>cp work/release/vasmppc_std /usr/bin/i386-aros-vasmppc_std</code>)</del> | ||
+ | *: for MorphOS: powerpc-morphos (e.g. <code>cp work/release/vasmppc_std /usr/bin/powerpc-morphos-vasmppc_std</code>) | ||
+ | * copy and rename the linker to <code>/usr/bin</code> with required target prefix: | ||
+ | *: for Amiga: m68k-amiga (e.g. <code>cp work/release/vlink /usr/bin/m68k-amiga-vlink</code>) | ||
+ | *: for AmigaOS4: powerpc-amigaos (e.g. <code>cp work/release/vlink /usr/bin/powerpc-amigaos-vlink</code>) | ||
+ | *: <del>for Aros: i386-aros (e.g. <code>cp work/release/vlink /usr/bin/i386-aros-vlink</code>)</del> | ||
+ | *: for MorphOS: powerpc-morphos (e.g. <code>cp work/release/vlink /usr/bin/powerpc-morphos-vlink</code>) | ||
− | + | Note that it is probably better/easier to use links for the specific targets and point that to the one single executable (that fits that target). | |
= Usage = | = Usage = | ||
− | The vasm/vlink combination with Free Pascal can | + | The vasm/vlink combination with Free Pascal can now be used by providing the additional command-line options -XV and -Avasm to the fpc commandline compiler. |
NOTE/WARNING: | NOTE/WARNING: | ||
− | + | It is not possible to mix vasm/vlink compiled units/objects with those generated by gnu binutils ld/as | |
− | + | In order to create the fpc cross-compiler use the additional make options: CROSSOPT="-XV -Avasm" |
Latest revision as of 21:50, 26 February 2023
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=m68k 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 required target prefix:- for Amiga: m68k-amiga (e.g.
cp work/release/vasmppc_std /usr/bin/m68k-amiga-vasmppc_std
) - for AmigaOS4: powerpc-amigaos (e.g.
cp work/release/vasmppc_std /usr/bin/powerpc-amigaos-vasmppc_std
) for Aros: i386-aros (e.g.cp work/release/vasmppc_std /usr/bin/i386-aros-vasmppc_std
)- for MorphOS: powerpc-morphos (e.g.
cp work/release/vasmppc_std /usr/bin/powerpc-morphos-vasmppc_std
)
- for Amiga: m68k-amiga (e.g.
- copy and rename the linker to
/usr/bin
with required target prefix:- for Amiga: m68k-amiga (e.g.
cp work/release/vlink /usr/bin/m68k-amiga-vlink
) - for AmigaOS4: powerpc-amigaos (e.g.
cp work/release/vlink /usr/bin/powerpc-amigaos-vlink
) for Aros: i386-aros (e.g.cp work/release/vlink /usr/bin/i386-aros-vlink
)- for MorphOS: powerpc-morphos (e.g.
cp work/release/vlink /usr/bin/powerpc-morphos-vlink
)
- for Amiga: m68k-amiga (e.g.
Note that it is probably better/easier to use links for the specific targets and point that to the one single executable (that fits that target).
Usage
The vasm/vlink combination with Free Pascal can now be used by providing the additional command-line options -XV and -Avasm to the fpc commandline compiler.
NOTE/WARNING: It is not possible to mix vasm/vlink compiled units/objects with those generated by gnu binutils ld/as
In order to create the fpc cross-compiler use the additional make options: CROSSOPT="-XV -Avasm"