What you need to build the kernel, and user binaries ---------------------------------------------------- binutils 2.8.1 -------------- 1.To build elf binutils to compile the kernel: ---------------------------------------------- configure --prefix=/home/gcc --target=m68k-unknown-linux --nfp Change MAKEINFO in Makefile to /bin/true, if you don't have makeinfo make make install 2.To build coff-pic binutils to compile user binaries: ------------------------------------------------------ configure --prefix=/home/gcc --target=m68k-pic-coff Change MAKEINFO in Makefile to /bin/true, if you don't have makeinfo make make install gcc-2.7.2.2 ----------- 1.To build elf gcc to compile the kernel: ----------------------------------------- You have to undefine mc68020 multiplications in longlong.h, or it will generate 68020+ mul and divs (line 428: #if defined(__mc68020).. should become #if 0... configure --prefix=/home/gcc --target=m68k-unknown-linux --with-gnu-as --with-gnu-ld --local-prefix=/home/gcc --nfp Patch the generated Makefile as follows: --- Makefile.orig Tue Feb 24 12:39:23 1998 +++ Makefile Tue Feb 24 12:38:29 1998 @@ -36,7 +36,7 @@ # Selection of languages to be made. # This is overridden by configure. -LANGUAGES = c objective-c proto c++ +LANGUAGES = c ALLOCA = ALLOCA_FLAGS = @@ -48,7 +48,7 @@ # to the stage2 and stage3 compilations # XCFLAGS is used for most compilations but not when using the GCC just built. XCFLAGS = -CFLAGS = -g +CFLAGS = BOOT_CFLAGS = -O $(CFLAGS) # These exists to be overridden by the x-* and t-* files, respectively. X_CFLAGS = @@ -57,7 +57,7 @@ X_CPPFLAGS = T_CPPFLAGS = -CC = cc +CC = gcc BISON = bison BISONFLAGS = LEX = flex @@ -71,7 +71,7 @@ # These permit overriding just for certain files. INSTALL_PROGRAM = $(INSTALL) INSTALL_DATA = $(INSTALL) -MAKEINFO = makeinfo +MAKEINFO = /bin/true TEXI2DVI = texi2dvi # For GNUmake: let us decide what gets passed to recursive makes. MAKEOVERRIDES = @@ -122,7 +122,7 @@ # The GCC to use for compiling libgcc2.a, enquire, and libgcc1-test. # Usually the one we just built. # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS). -GCC_FOR_TARGET = ./xgcc -B./ +GCC_FOR_TARGET = ./xgcc -msoft-float -mc68000 -Wa,-mc68000 -B./ # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET. # It omits XCFLAGS, and specifies -B./. @@ -233,11 +233,18 @@ # Specify the rule for actually making libgcc1.a. # The value may be empty; that means to do absolutely nothing # with or for libgcc1.a. -LIBGCC1 = libgcc1.a +LIBGCC1 = libgcc1-asm.a # Specify the rule for making libgcc1.a for a cross-compiler. # The default rule assumes that libgcc1.a is supplied by the user. -CROSS_LIBGCC1 = libgcc1.cross +CROSS_LIBGCC1 = libgcc1-asm.a +LIB1ASMSRC = m68k/lb1sf68.asm +LIB1ASMFUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \ + _double _float _floatex \ + _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \ + _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2 + + # Specify the rule for actually making libgcc2.a. LIBGCC2 = libgcc2.a @@ -395,8 +402,8 @@ # sed inserts variable overrides after the following line. ####target overrides # Don't make libgcc1.a -LIBGCC1 = -CROSS_LIBGCC1 = +#LIBGCC1 = +#CROSS_LIBGCC1 = # On Linux we can print long double ENQUIRE_CFLAGS = -DNO_MEM -O0 ####host overrides @@ -610,11 +617,12 @@ _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2 # Library members defined in libgcc2.c. +LIB2TRICKY = _floatdixf LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \ _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 \ _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \ _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \ - _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \ + _fixxfdi _fixunsxfdi _fixunsxfsi \ _fixtfdi _fixunstfdi _floatditf \ __gcc_bcmp _varargs _eprintf _op_new _op_vnew _new_handler _op_delete \ _op_vdel _bb _shtab _clear_cache _trampoline __main _exit _ctors _eh \ @@ -1093,6 +1101,15 @@ $(AR) $(AR_FLAGS) tmplibgcc1.a $${name}$(objext); \ rm -f $${name}$(objext); \ done + for name in _truncdfsf2 _extendsfdf2 _fixdfsi _fixsfsi _floatsidf _floatsisf; \ + do \ + echo $${name}; \ + $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} libgcc1.c; \ + if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ + mv libgcc1$(objext) $${name}$(objext); \ + $(AR) $(AR_FLAGS) tmplibgcc1.a $${name}$(objext); \ + rm -f $${name}$(objext); \ + done -rm -f libgcc1.S mv tmplibgcc1.a libgcc1-asm.a @@ -1138,7 +1155,7 @@ do \ echo $${name}; \ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \ - $(srcdir)/libgcc2.c -o $${name}$(objext); \ + $(srcdir)/libgcc2.c -I/usr/include -o $${name}$(objext); \ if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}$(objext); \ rm -f $${name}$(objext); \ 1.To build a pic-coff gcc to compile user binaries: --------------------------------------------------- configure --prefix=/home/gcc --target=m68k-pic-coff --with-gnu-as --with-gnu-ld --local-prefix=/home/gcc --nfp make make install --------------------------- Paul Coene