Giter VIP home page Giter VIP logo

m68k-elf-toolchain's Introduction

m68k elf gcc

The GNU C-Compiler with Binutils and other useful tools for cross development

This is a Makefile based approach to build the toolchain to reduce the build time.

Right now these tools are build:

  • binutils
  • gcc with libs for C/C++/ObjC
  • vasm
  • vbcc
  • vlink
  • newlib

Short Guide

Prerequisites

Ubuntu

sudo apt install make git gcc g++ lhasa libgmp-dev libmpfr-dev libmpc-dev flex gettext texinfo

Windows with Cygwin

Install cygwin via setup.exe and add wget. Then open cygwin shell and run:

wget https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg
install apt-cyg /bin
apt-cyg install gcc-core gcc-g++ python git perl-Pod-Simple gperf patch automake make makedepend bison flex libncurses-devel python-devel gettext-devel libgmp-devel libmpc-devel libmpfr-devel

Windows with MSYS2/MinGW

Install then open the shell and run:

pacman -S vim git tar unzip bison texinfo gettext libtool autoconf automake gcc make wget patch rsync flex ncurses-devel

Download needed source files

git clone https://github.com/SteveMoody73/m68k-elf-toolchain
cd m68k-elf-toolchain
make update

Overview

make help

yields:

make help            display this help
make info            print prefix and other flags
make all             build and install all
make <target>        builds a target: binutils, gcc, vasm, vbcc, vlink, libgcc, newlib
make clean           remove the build folder
make clean-<target>  remove the target's build folder
make clean-prefix    remove all content from the prefix folder
make update          perform git pull for all targets
make update-<target> perform git pull for the given target
make info            display some info

display which targets can be build, you'll mostly use *make all *make clean *make clean-prefx

Prefix

The default prefix is /opt/m68k-elf. You may specify a different prefix by adding PREFIX=yourprefix to make command. E.g.

make all PREFIX=/opt/m68k

If building using MSYS2/MinGW windows paths can be specified as follows.

make all PREFIX=c:/m68k-elf

or

make all PREFIX=c:\\m68k-elf

Building

Simply run make all. Also add -j to speedup the build.

make clean
make clean-prefix
date; make all -j3 >&b.log; date

m68k-elf-toolchain's People

Contributors

stevemoody73 avatar

Stargazers

Paweł Wodnicki avatar  avatar  avatar Graeme Harker avatar  avatar Denjhang Liu avatar  avatar Joshua Bassett avatar Jeffrey H. Johnson avatar Cronomantic avatar Emma Maassen avatar Maciej Stankiewicz avatar  avatar Maki Kato avatar Kenneth avatar  avatar António Santos avatar  avatar

Watchers

James Cloos avatar António Santos avatar  avatar Kenneth avatar Fred Bayer avatar

m68k-elf-toolchain's Issues

binutils fails to build - RESOLVED

Trying to build this toolchain without success. Binutils simply don't build. I'm no expert on messing with this, but i end up with the following error:

make binutils...failed
less "log/make binutils.log"
Makefile:311: recipe for target 'build-Linux/binutils/_done' failed
make: *** [build-Linux/binutils/_done] Error 2

Ubuntu 18.04, 20.04 and 22.04 do the same (trying to build it using Docker)

Adding bison and rsync, and it compiles

newlib linking errors

Hi, first of all thank you very much for your work on GCC 12.2 based toolchain for m68k-elf target.

I have some strange errors (see below) on undefined references in "re-entry routines" on compiled libc.a from newlib.
Same issue occurs on two independent builds using GCC12.2 and m68k-elf and m68k-amiga-elf targets.
First install is a clean version based on your make and second install is my own bash shell script.

Any thoughts? Thanks for your help.

willem@Compiler2:~/Dev/m68k-elf-toolchain/output$ bin/m68k-elf-gcc hello.c
/home/willem/Dev/m68k-elf-toolchain/output/lib/gcc/m68k-elf/10.4.1/../../../../m68k-elf/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000080000080
/home/willem/Dev/m68k-elf-toolchain/output/lib/gcc/m68k-elf/10.4.1/../../../../m68k-elf/bin/ld: /home/willem/Dev/m68k-elf-toolchain/output/lib/gcc/m68k-elf/10.4.1/../../../../m68k-elf/lib/libc.a(lib_a-sbrkr.o): in function _sbrk_r': /home/willem/Dev/m68k-elf-toolchain/projects/newlib-cygwin/newlib/libc/reent/sbrkr.c:51: undefined reference to sbrk'
/home/willem/Dev/m68k-elf-toolchain/output/lib/gcc/m68k-elf/10.4.1/../../../../m68k-elf/bin/ld: /home/willem/Dev/m68k-elf-toolchain/output/lib/gcc/m68k-elf/10.4.1/../../../../m68k-elf/lib/libc.a(lib_a-writer.o): in function _write_r': /home/willem/Dev/m68k-elf-toolchain/projects/newlib-cygwin/newlib/libc/reent/writer.c:49: undefined reference to write'
/home/willem/Dev/m68k-elf-toolchain/output/lib/gcc/m68k-elf/10.4.1/../../../../m68k-elf/bin/ld: /home/willem/Dev/m68k-elf-toolchain/output/lib/gcc/m68k-elf/10.4.1/../../../../m68k-elf/lib/libc.a(lib_a-closer.o): in function _close_r': /home/willem/Dev/m68k-elf-toolchain/projects/newlib-cygwin/newlib/libc/reent/closer.c:47: undefined reference to close'
/home/willem/Dev/m68k-elf-toolchain/output/lib/gcc/m68k-elf/10.4.1/../../../../m68k-elf/bin/ld: /home/willem/Dev/m68k-elf-toolchain/output/lib/gcc/m68k-elf/10.4.1/../../../../m68k-elf/lib/libc.a(lib_a-lseekr.o): in function _lseek_r': /home/willem/Dev/m68k-elf-toolchain/projects/newlib-cygwin/newlib/libc/reent/lseekr.c:49: undefined reference to lseek'
/home/willem/Dev/m68k-elf-toolchain/output/lib/gcc/m68k-elf/10.4.1/../../../../m68k-elf/bin/ld: /home/willem/Dev/m68k-elf-toolchain/output/lib/gcc/m68k-elf/10.4.1/../../../../m68k-elf/lib/libc.a(lib_a-readr.o): in function _read_r': /home/willem/Dev/m68k-elf-toolchain/projects/newlib-cygwin/newlib/libc/reent/readr.c:49: undefined reference to read'
/home/willem/Dev/m68k-elf-toolchain/output/lib/gcc/m68k-elf/10.4.1/../../../../m68k-elf/bin/ld: /home/willem/Dev/m68k-elf-toolchain/output/lib/gcc/m68k-elf/10.4.1/../../../../m68k-elf/lib/libc.a(lib_a-fstatr.o): in function _fstat_r': /home/willem/Dev/m68k-elf-toolchain/projects/newlib-cygwin/newlib/libc/reent/fstatr.c:55: undefined reference to fstat'
/home/willem/Dev/m68k-elf-toolchain/output/lib/gcc/m68k-elf/10.4.1/../../../../m68k-elf/bin/ld: /home/willem/Dev/m68k-elf-toolchain/output/lib/gcc/m68k-elf/10.4.1/../../../../m68k-elf/lib/libc.a(lib_a-isattyr.o): in function _isatty_r': /home/willem/Dev/m68k-elf-toolchain/projects/newlib-cygwin/newlib/libc/reent/isattyr.c:52: undefined reference to isatty'

Error on libstdc++

Needs to build newlib first, then libgcc.

This error is shown:

configure: WARNING: stdalign.h: proceeding with the compiler's result
checking for stdalign.h... no
checking for the value of EOF... configure: error: computing EOF failed
make[1]: *** [Makefile:10850: configure-target-libstdc++-v3] Error 1
make[1]: Leaving directory '/home/mattp/m68k-elf-toolchain/build-Linux/gcc'
make libgcc...failed

At the moment this manual process will fix it.

make update-newlib
Cloning into 'newlib-cygwin'...
remote: Enumerating objects: 7935, done.
remote: Counting objects: 100% (7935/7935), done.
remote: Compressing objects: 100% (5843/5843), done.
remote: Total 7935 (delta 3405), reused 3617 (delta 1992), pack-reused 0
Receiving objects: 100% (7935/7935), 15.60 MiB | 305.00 KiB/s, done.
Resolving deltas: 100% (3405/3405), done.
Already up-to-date.
mattp@mattp-VirtualBox:~/m68k-elf-toolchain$ make newlib
configure newlib...done
make newlib...done
install newlib...done
mattp@mattp-VirtualBox:~/m68k-elf-toolchain$ make libgcc
make libgcc...done
install libgcc...done
mattp@mattp-VirtualBox:~/m68k-elf-toolchain$ 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.