Cross MorphOS binutils
Jump to navigation
Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
How to create binutils (as, ld) needed for FreePascal crosscompiling to MorphOS on a linux system.
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!