HOWTO build m68k-linux toolchain -------------------------------- These instructions document how to build an m68k-linux tool chain. 1. Packages used: binutils-2.20.1.tar.bz2 gcc-4.5.1.tar.bz2 glibc-2.3.6.tar.bz2 linux-2.6.35.tar.gz 2. binutils-2.20.1 tar xvjf binutils-2.20.1.tar.bz2 cd binutils-2.20.1 mkdir m68k-linux cd m68k-linux ../configure --target=m68k-linux make sudo make install sudo chmod 777 /usr/local/m68k-linux 3. linux-2.6.35 -- install headers tar xvzf linux-2.6.35.tar.gz cd linux-2.6.35 make ARCH=m68k menuconfig make ARCH=m68k headers_install 4. glibc-2.3.6 -- install headers tar xvjf glibc-2.3.6.tar.bz2 cd glibc-2.3.6 rm -rf nptl tar xvzf glibc-linuxthreads-2.3.6.tar.gz vi configure - edit line 3920 to be "2.1[3-9]*|2.2[0-9]*)" vi configure - edit line 3981 to be "2.1[3-9]*|2.2[0-9]*)" mkdir m68k-linux cd m68k-linux ../configure --host=m68k-linux --build=i686-pc-linux-gnu \ --with-headers=/linux-2.6.35/usr/include \ --enable-add-ons --enable-shared --prefix=/usr/local/m68k-linux make install-headers > /usr/local/m68k-linux/include/gnu/stubs.h > /usr/local/m68k-linux/include/bits/stdio_lim.h 5. gcc-4.5.1 tar xvjf gcc-4.5.1.tar.bz2 cd gcc-4.5.1 vi gcc/config/m68k/t-m68k - comment out line 3, so it becomes '#M68K_MLIB_CPU += && (CPU !~ "^mcf")' mkdir m68k-linux cd m68k-linux ../configure --target=m68k-linux --disable-shared --disable-threads \ --disable-libmudflap --disable-libssp --disable-libgomp \ --prefix=/usr/local --with-headers=/linux-2.6.35/usr/include \ --enable-multilib --with-system-zlib --enable-languages=c make sudo make install 6. glibc-2.3.6 tar xvzf glibc-2.3.6.tar.gz cd glibc-2.3.6 rm -rf nptl tar xvzf glibc-linuxthreads-2.3.6.tar.gz vi configure - edit line 3920 to be "2.1[3-9]*|2.2[0-9]*)" vi configure - edit line 3981 to be "2.1[3-9]*|2.2[0-9]*)" vi csu/Makefile - line 244 should be: echo "\"Available extensions:\\\n\""; vi elf/Makefile - line 288 should be: -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' vi Makeconfig - remove any usage occurrances of -lgcc_eh vi sysdeps/generic/unwind-dw2.c - add new line at 174 "#if 0" - add new line at 250 "#endif" - add new line at 1013 "#if 0" - add new line at 1065 "#endif" vi sysdeps/generic/framestate.c - add new line at 28 "#if 0" - add new line at 54 "#endif" mkdir m68k-linux cd m68k-linux CC="m68k-linux-gcc -fgnu89-inline" \ AS="m68k-linux-as -fgnu89-inline" \ ../configure --host=m68k-linux --build=i686-pc-linux-gnu \ --with-headers=/linux-2.6.35/usr/include \ --enable-add-ons --enable-shared --prefix=/usr/local/m68k-linux make sudo make install vi /usr/local/m68k-linux/include/sys/stat.h - add in a new line 391, "#if 0" - add in a new line 415, "#endif" 7. gcc-4.5.1 (c++, etc) tar xvjf gcc-4.5.1.tar.bz2 cd gcc-4.5.1 mkdir m68k-linux cd m68k-linux ../configure --target=m68k-linux --disable-shared \ --prefix=/usr/local --with-headers=/linux-2.6.35/usr/include \ --enable-multilib --with-system-zlib make sudo make install 8. cd / find /usr/local/m68k-linux -name CVS -type d | xargs rm -rf find /usr/local/m68k-linux | xargs chown root find /usr/local/m68k-linux | xargs chgrp root strip /usr/local/m68k-linux/bin/* strip /usr/local/bin/m68k-linux-* tar cvzf /tmp/m68k-linux-tools-xxxxxxxx.tar.gz \ /usr/local/m68k-linux \ /usr/local/lib/gcc/m68k-linux \ /usr/local/libexec/gcc/m68k-linux \ /usr/local/bin/m68k-linux-*