Changeset 656b789 in mainline


Ignore:
Timestamp:
2009-03-16T22:58:11Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
be6038b
Parents:
f36c061
Message:

resurrect big endian support for mips32: switch from mips-sgi-irix5 toolchain to mips-linux-gnu
the kernel is working alright, the user space has some bugs yet

Files:
1 added
1 deleted
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • boot/arch/mips32/loader/Makefile

    rf36c061 r656b789  
    3737endif
    3838
    39 ifeq ($(IMAGE),binary)
    40         LD_IN = binary
    41 endif
    42 
    43 ifeq ($(IMAGE),ecoff)
    44         LD_IN = ecoff
    45 endif
    46 
    47 BFD_NAME = elf32-tradlittlemips
    4839BFD_ARCH = mips
    4940TARGET = mipsel-linux-gnu
    5041TOOLCHAIN_DIR = $(CROSS_PREFIX)/mipsel/bin
     42
     43ifeq ($(MACHINE),lgxemul)
     44        BFD_NAME = elf32-tradlittlemips
     45        BFD = ecoff-littlemips
     46endif
     47ifeq ($(MACHINE),bgxemul)
     48        BFD_NAME = elf32-tradbigmips
     49        BFD = ecoff-bigmips
     50        TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips/bin
     51        TARGET = mips-linux-gnu
     52endif
     53ifeq ($(MACHINE),msim)
     54        BFD_NAME = elf32-tradlittlemips
     55        BFD = binary
     56endif
    5157
    5258ifeq ($(COMPILER),gcc_native)
     
    8490        $(USPACEDIR)/srv/devmap/devmap \
    8591        $(USPACEDIR)/srv/rd/rd \
    86         $(USPACEDIR)/srv/vfs/vfs 
     92        $(USPACEDIR)/srv/vfs/vfs
    8793ifeq ($(RDFMT),tmpfs)
    8894        COMPONENTS += $(USPACEDIR)/srv/fs/tmpfs/tmpfs
     
    115121-include Makefile.depend
    116122
    117 image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS)
    118         $(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) -o $@
     123image.boot: image.raw
     124        $(OBJCOPY) -O $(BFD) $< $@
     125
     126image.raw: depend _components.h _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS)
     127        $(LD) -no-check-sections -N -T _link.ld -o $@ $(COMPONENT_OBJECTS) initrd.o $(OBJECTS)
    119128
    120129depend:
     
    128137                rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
    129138        done
    130         -rm -f _components.h _components.c _link.ld _link.ld.in $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) initrd.img image.boot Makefile.depend
     139        -rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) initrd.img image.raw image.boot Makefile.depend
    131140
    132141_components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) $(RD_SRVS) $(RD_APPS) _link.ld.in
     
    147156        ../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 16384 "unsigned int" $(COMPONENTS) ./initrd.img
    148157
    149 _link.ld.in: _link.ld.in.$(LD_IN)
    150         cp $< $@
    151 
    152158%.o: %.S
    153159        $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
  • boot/arch/mips32/loader/_link.ld.in

    rf36c061 r656b789  
    1 OUTPUT_FORMAT("binary")
    2 ENTRY(start)
    3  
     1ENTRY(start)
     2
    43SECTIONS {
    54        .boot 0xbfc00000: AT (0) {
     
    98                *(.rodata);
    109                *(.rodata.*);
    11                 *(.data);               /* initialized data */
     10                *(.data);       /* initialized data */
    1211                *(.sdata);
    1312                *(.sdata2);
    1413                *(.sbss);
    1514                *(.scommon);
    16                 *(.bss);                /* uninitialized static variables */   
    17                 *(COMMON);              /* global variables */
     15                *(.bss);        /* uninitialized static variables */
     16                *(COMMON);      /* global variables */
    1817                *(.reginfo);
    1918[[COMPONENTS]]
  • contrib/toolchain/toolchain.mipseb32.sh

    rf36c061 r656b789  
    2020fi
    2121
    22 BINUTILS_VERSION="2.19"
    23 GCC_VERSION="4.3.2"
     22BINUTILS_VERSION="2.19.1"
     23GCC_VERSION="4.3.3"
    2424
    2525BINUTILS="binutils-${BINUTILS_VERSION}.tar.gz"
     
    3333PLATFORM="mips"
    3434WORKDIR=`pwd`
    35 TARGET="${PLATFORM}-sgi-irix5"
     35TARGET="${PLATFORM}-linux-gnu"
    3636PREFIX="${CROSS_PREFIX}/${PLATFORM}"
    3737BINUTILSDIR="${WORKDIR}/binutils-${BINUTILS_VERSION}"
     
    8585cd "${BINUTILSDIR}"
    8686check_error $? "Change directory failed."
    87 patch -p1 <<EOF
    88 diff -Naur binutils-2.19.orig/bfd/elfxx-mips.c binutils-2.19/bfd/elfxx-mips.c
    89 --- binutils-2.19.orig/bfd/elfxx-mips.c 2008-08-18 20:14:04.000000000 +0200
    90 +++ binutils-2.19/bfd/elfxx-mips.c      2009-01-18 18:14:47.292011299 +0100
    91 @@ -1409,7 +1409,7 @@
    92     function, or 0 if we can't decide which function that is.  */
    93  
    94  static unsigned long
    95 -mips16_stub_symndx (asection *sec, const Elf_Internal_Rela *relocs,
    96 +mips16_stub_symndx (asection *sec __attribute__((unused)), const Elf_Internal_Rela *relocs,
    97                     const Elf_Internal_Rela *relend)
    98  {
    99    const Elf_Internal_Rela *rel;
    100 EOF
    101 check_error $? "Error patching binutils"
    10287./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" "--disable-nls"
    10388check_error $? "Error configuring binutils."
  • kernel/arch/mips32/Makefile.inc

    rf36c061 r656b789  
    3131
    3232BFD_ARCH = mips
     33BFD = binary
    3334TARGET = mipsel-linux-gnu
    3435TOOLCHAIN_DIR = $(CROSS_PREFIX)/mipsel
    3536
    36 GCC_CFLAGS += -mno-abicalls -G 0 -fno-zero-initialized-in-bss
     37GCC_CFLAGS += -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mips3
    3738
    3839DEFS += -D__32_BITS__
     
    4344ifeq ($(MACHINE),lgxemul)
    4445        BFD_NAME = elf32-tradlittlemips
    45         BFD = binary
    46         GCC_CFLAGS += -mips3
    4746endif
    4847ifeq ($(MACHINE),bgxemul)
    49         BFD_NAME = elf32-bigmips
    50         BFD = ecoff-bigmips
     48        BFD_NAME = elf32-tradbigmips
    5149        TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips
    52         TARGET = mips-sgi-irix5
    53         GCC_CFLAGS += -EB -DBIG_ENDIAN -mips3
     50        TARGET = mips-linux-gnu
     51        GCC_CFLAGS += -DBIG_ENDIAN
    5452endif
    5553ifeq ($(MACHINE),msim)
    5654        BFD_NAME = elf32-tradlittlemips
    57         BFD = binary
    58         GCC_CFLAGS += -mhard-float -mips3
     55        GCC_CFLAGS += -mhard-float
    5956endif
    6057
  • uspace/lib/libc/arch/mips32eb/Makefile.inc

    rf36c061 r656b789  
    3030#
    3131
    32 TARGET = mips-sgi-irix5
     32TARGET = mips-linux-gnu
    3333TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips/bin
    34 CFLAGS += -mips3 
     34CFLAGS += -mips3
    3535
    3636ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
     
    4141
    4242BFD_ARCH = mips
    43 BFD_NAME = elf32-big
     43BFD_NAME = elf32-tradbigmips
Note: See TracChangeset for help on using the changeset viewer.