From 0b95ef93990a0fc6ca07e932e8b81d1250dc057e Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Wed, 8 Feb 2017 20:36:49 +0000 Subject: [PATCH] - fixed board file for ml402 - no lto git-svn-id: http://moon:8086/svn/mips@139 a8ebac50-d88d-4704-bea3-6648445a41b3 --- src/Makefile | 2 +- src/libsys/boards/ml402/board.c | 28 +++++++++++++++++++--------- src/link/link.ld | 2 +- toolchain/make.sh | 5 +++-- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/Makefile b/src/Makefile index cb18578..382b153 100644 --- a/src/Makefile +++ b/src/Makefile @@ -42,7 +42,7 @@ OBJCOPY=mips-elf-objcopy PROG-ml402 = $(addprefix $(BUILD_DIR)/, hello.elf testbench.elf test_irq.elf dhry.elf queens.elf stanford.elf paranoia.elf rmd160_test.elf Bessel.elf whet.elf phrasen.elf dttl.elf richards_benchmark.elf test_exception.elf life.elf r3.elf gunzip.elf basic_math.elf jman_patches.elf jman_patchmeshes.elf jman_polys.elf test_hpi.elf test_vga.elf test_fft.elf) PROG-denano = $(addprefix $(BUILD_DIR)/, hello.elf dhry.elf queens.elf stanford.elf paranoia.elf rmd160_test.elf Bessel.elf whet.elf phrasen.elf dttl.elf richards_benchmark.elf test_exception.elf testbench_denano.elf) PROG-sim = $(addprefix $(BUILD_DIR)/, hello.elf ICacheTest.elf) -CFLAGS-sim := -flto -O0 +CFLAGS-sim := -O0 CFLAGS += $(CFLAGS-$(BOARD)) diff --git a/src/libsys/boards/ml402/board.c b/src/libsys/boards/ml402/board.c index 5d6157f..b6b4c20 100644 --- a/src/libsys/boards/ml402/board.c +++ b/src/libsys/boards/ml402/board.c @@ -12,17 +12,27 @@ #include "../../regdef.h" extern uart_if_t uart_if[]; -extern void handle_exception (unsigned long *registers); - -int gdb_stub(struct xcptcontext * xcp) -{ - handle_exception((unsigned long *)xcp); - return 0; -} -#ifdef WITH_ROM_GDBSTUB +#ifdef WITH_ROM_DEBUGGER const fp_xcpt_t dbg_func = (fp_xcpt_t)0xbfc01fc0; #else -const fp_xcpt_t dbg_func = (fp_xcpt_t)gdb_stub; +#ifdef WITH_GDB_STUB +extern void handle_exception (unsigned long *registers); +#else +extern int dbg_handler(struct xcptcontext * xcp); +#endif + +int dbg_stub(struct xcptcontext * xcp) __attribute__ ((section (".dbg_stub"))) __attribute__ ((used)); +int dbg_stub(struct xcptcontext * xcp) +{ +#ifdef WITH_GDB_STUB + handle_exception((unsigned long *)xcp); + return 0; +#else + return dbg_handler(xcp); +#endif +} + +const fp_xcpt_t dbg_func = (fp_xcpt_t)dbg_stub; #endif #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0])) diff --git a/src/link/link.ld b/src/link/link.ld index b7d10bb..96b76eb 100644 --- a/src/link/link.ld +++ b/src/link/link.ld @@ -24,7 +24,7 @@ SECTIONS .exc_vector ORIGIN(ram) + 0x80 : { - *(.exc_vect) + KEEP (*(.exc_vect)) } >ram .init : { diff --git a/toolchain/make.sh b/toolchain/make.sh index 437e8b4..ecfd5af 100644 --- a/toolchain/make.sh +++ b/toolchain/make.sh @@ -31,7 +31,7 @@ if [ ! -e ./$SRC_BINUTILS-build ]; then echo Building $SRC_BINUTILS mkdir -p $SRC_BINUTILS-build cd $SRC_BINUTILS-build - ../$SRC_BINUTILS/configure --target=$TARGET --prefix=$PREFIX --enable-plugins --enable-lto || exit 1 + ../$SRC_BINUTILS/configure --target=$TARGET --prefix=$PREFIX || exit 1 make -j4 || exit 1 make install || exit 1 cd .. @@ -171,7 +171,7 @@ if [ ! -e ./$SRC_GCC-build ]; then echo Building $SRC_GCC mkdir -p $SRC_GCC-build cd $SRC_GCC-build - ../$SRC_GCC/configure --target=$TARGET --prefix=$PREFIX --with-gmp=$PREFIX --with-mpfr=$PREFIX --with-mpc=$PREFIX --with-float=soft --with-newlib --verbose --enable-languages="c,c++" --with-gnu-as --with-gnu-ld --enable-lto || exit 1 + ../$SRC_GCC/configure --target=$TARGET --prefix=$PREFIX --with-gmp=$PREFIX --with-mpfr=$PREFIX --with-mpc=$PREFIX --with-float=soft --with-newlib --verbose --enable-languages="c,c++" --with-gnu-as --with-gnu-ld || exit 1 make -j4 all || exit 1 make info || exit 1 make install || exit 1 @@ -215,3 +215,4 @@ fi echo Finished building toolchain. +