Difference between revisions of "Cross MorphOS binutils"
Jump to navigation
Jump to search
(short manual how to create cross binutils for morphos on linux) |
(vlink/vasm link) |
||
Line 1: | Line 1: | ||
− | How to create binutils (as, ld) needed for FreePascal crosscompiling to MorphOS on a linux system. | + | How to create gnu binutils (as, ld) needed for FreePascal crosscompiling to MorphOS on a linux system.<br /> |
+ | (for vasm/vlink check [[Cross binutils vasm/vlink]]) | ||
One needs: | One needs: |
Latest revision as of 23:02, 16 May 2020
How to create gnu binutils (as, ld) needed for FreePascal crosscompiling to MorphOS on a linux system.
(for vasm/vlink check Cross binutils vasm/vlink)
One needs:
- working linux with gcc (e.g. ubuntu:
sudo apt install build-essentials
) - flex, bison (e.g. ubuntu:
sudo apt install flex bison
) - xz-utils (e.g. ubuntu:
sudo apt install xz-utils
) - latest sdk source from MorphOS source page (e.g. sdk-source-20200422)
- unpack the source (e.g.
tar -xJf sdk-source-20200422.tar.xz
)
- we only need the
sdk-source/binutils
folder, therefore its possible to only unpack that directory (e.g. when using GUI tools to unpack)
- we only need the
- enter the
sdk-source/binutils
folder (e.g.cd sdk-source/binutils
) - unpack the
binutils-x.xx.tar.xz
inside (e.g.tar -xJf binutils-2.34.tar.xz
) - apply the patch for the same version number with
patch -p0 <./binutils-x.xx-morphos.diff
(e.g.patch -p0 <./binutils-2.34-morphos.diff
)- make sure you have the same version number of diff file as the directory
- create a new directory build (e.g.
mkdir build
) - enter that directory (e.g.
cd build
) - configure the morphos binutils (e.g.
../binutils-2.34/configure CFLAGS="-DMORPHOS_TARGET" --target=ppc-morphos --enable-plugins=no --disable-initfini-array
) - compile the cross binutils for morphos (e.g.
make
) - you will find the compiled tools in the build directory, we are most interested in directories "gas" the assembler and "ld" the linker
- 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
)
Finished!