Difference between revisions of "Sega Genesis (m68k, z80) GCC 9.3.0 cross-compiler instructions"
(→Build and install newlib gcc) |
(→Create directories) |
||
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:GCC]] | ||
+ | |||
== Introduction == | == Introduction == | ||
− | We'll build a GCC 9. | + | We'll build a GCC 9.3.0 targeting m68k (Sega Genesis). |
== Create directories == | == Create directories == | ||
cd $HOME | cd $HOME | ||
− | mkdir -p src obj/{binutils-build,gcc-build,newlib-build} | + | mkdir -p src obj/{binutils-build,gcc-build,gdb-build,newlib-build} |
− | == Get GCC and binutils == | + | == Get GCC, GDB and binutils == |
− | curl https://ftp.gnu.org/gnu/binutils/binutils-2. | + | curl https://ftp.gnu.org/gnu/binutils/binutils-2.34.tar.gz | tar -C $HOME/src -xf - |
− | curl https://ftp.gnu.org/gnu/gcc/gcc-9. | + | curl https://ftp.gnu.org/gnu/gdb/gdb-9.1.tar.gz | tar -C $HOME/src -xf - |
− | curl ftp://sourceware.org/pub/newlib/newlib-3. | + | curl https://ftp.gnu.org/gnu/gcc/gcc-9.3.0/gcc-9.3.0.tar.gz | tar -C $HOME/src -xf - |
+ | curl ftp://sourceware.org/pub/newlib/newlib-3.3.0.tar.gz | tar -C $HOME/src -xf - | ||
== Download prerequisites == | == Download prerequisites == | ||
− | cd $HOME/src/gcc-9. | + | cd $HOME/src/gcc-9.3.0 |
./contrib/download_prerequisites | ./contrib/download_prerequisites | ||
Line 22: | Line 25: | ||
cd $HOME/obj/binutils-build | cd $HOME/obj/binutils-build | ||
− | ../../src/binutils-2. | + | ../../src/binutils-2.34/configure --prefix $HOME/xgcc --bindir $HOME/bin --target m68k-elf --with-cpu=m68000 |
+ | make -j8 && make install | ||
+ | |||
+ | == Build and install gdb == | ||
+ | |||
+ | cd $HOME/obj/gdb-build | ||
+ | ../../src/gdb-9.1/configure --prefix $HOME/xgcc --bindir $HOME/bin --target m68k-elf --with-cpu=m68000 | ||
make -j8 && make install | make -j8 && make install | ||
Line 28: | Line 37: | ||
cd $HOME/obj/gcc-build | cd $HOME/obj/gcc-build | ||
− | ../../src/gcc-9. | + | ../../src/gcc-9.3.0/configure --prefix $HOME/xgcc --bindir $HOME/bin --target m68k-elf --with-cpu=m68000 --enable-languages=c --with-gnu-as --with-gnu-ld --without-headers --with-newlib |
− | make -j8 all-gcc install-gcc | + | make -j8 all-gcc && make install-gcc |
== Build and install newlib == | == Build and install newlib == | ||
cd $HOME/obj/newlib-build | cd $HOME/obj/newlib-build | ||
− | ../../src/newlib-3. | + | ../../src/newlib-3.3.0/configure --prefix $HOME/xgcc --bindir $HOME/bin --target m68k-elf --with-cpu=m68000 |
− | make -j8 all install | + | make -j8 all && make install |
== Build and install newlib gcc == | == Build and install newlib gcc == | ||
Line 41: | Line 50: | ||
rm -rf $HOME/obj/gcc-build && mkdir -p $HOME/obj/gcc-build | rm -rf $HOME/obj/gcc-build && mkdir -p $HOME/obj/gcc-build | ||
cd $HOME/obj/gcc-build | cd $HOME/obj/gcc-build | ||
− | ../../src/gcc-9. | + | ../../src/gcc-9.3.0/configure --prefix $HOME/xgcc --bindir $HOME/bin --target m68k-elf --with-cpu=m68000 --enable-languages=c --with-gnu-as --with-gnu-ld --with-newlib |
− | make -j8 all install | + | make -j8 all && make install |
== Build and install binutils for z80 == | == Build and install binutils for z80 == | ||
Line 48: | Line 57: | ||
rm -rf $HOME/obj/binutils-build && mkdir -p $HOME/obj/binutils-build | rm -rf $HOME/obj/binutils-build && mkdir -p $HOME/obj/binutils-build | ||
cd $HOME/obj/binutils-build | cd $HOME/obj/binutils-build | ||
− | ../../src/binutils-2. | + | ../../src/binutils-2.34/configure --prefix $HOME/xgcc --bindir $HOME/bin --target z80-coff |
make -j8 && make install | make -j8 && make install |
Latest revision as of 13:14, 17 March 2020
Contents
Introduction
We'll build a GCC 9.3.0 targeting m68k (Sega Genesis).
Create directories
cd $HOME mkdir -p src obj/{binutils-build,gcc-build,gdb-build,newlib-build}
Get GCC, GDB and binutils
curl https://ftp.gnu.org/gnu/binutils/binutils-2.34.tar.gz | tar -C $HOME/src -xf - curl https://ftp.gnu.org/gnu/gdb/gdb-9.1.tar.gz | tar -C $HOME/src -xf - curl https://ftp.gnu.org/gnu/gcc/gcc-9.3.0/gcc-9.3.0.tar.gz | tar -C $HOME/src -xf - curl ftp://sourceware.org/pub/newlib/newlib-3.3.0.tar.gz | tar -C $HOME/src -xf -
Download prerequisites
cd $HOME/src/gcc-9.3.0 ./contrib/download_prerequisites
Build and install binutils
cd $HOME/obj/binutils-build ../../src/binutils-2.34/configure --prefix $HOME/xgcc --bindir $HOME/bin --target m68k-elf --with-cpu=m68000 make -j8 && make install
Build and install gdb
cd $HOME/obj/gdb-build ../../src/gdb-9.1/configure --prefix $HOME/xgcc --bindir $HOME/bin --target m68k-elf --with-cpu=m68000 make -j8 && make install
Build and install bare metal gcc
cd $HOME/obj/gcc-build ../../src/gcc-9.3.0/configure --prefix $HOME/xgcc --bindir $HOME/bin --target m68k-elf --with-cpu=m68000 --enable-languages=c --with-gnu-as --with-gnu-ld --without-headers --with-newlib make -j8 all-gcc && make install-gcc
Build and install newlib
cd $HOME/obj/newlib-build ../../src/newlib-3.3.0/configure --prefix $HOME/xgcc --bindir $HOME/bin --target m68k-elf --with-cpu=m68000 make -j8 all && make install
Build and install newlib gcc
rm -rf $HOME/obj/gcc-build && mkdir -p $HOME/obj/gcc-build cd $HOME/obj/gcc-build ../../src/gcc-9.3.0/configure --prefix $HOME/xgcc --bindir $HOME/bin --target m68k-elf --with-cpu=m68000 --enable-languages=c --with-gnu-as --with-gnu-ld --with-newlib make -j8 all && make install
Build and install binutils for z80
rm -rf $HOME/obj/binutils-build && mkdir -p $HOME/obj/binutils-build cd $HOME/obj/binutils-build ../../src/binutils-2.34/configure --prefix $HOME/xgcc --bindir $HOME/bin --target z80-coff make -j8 && make install