summaryrefslogtreecommitdiff
path: root/cross
diff options
context:
space:
mode:
authorkent <kent>2001-08-05 15:28:41 +0000
committerkent <kent>2001-08-05 15:28:41 +0000
commit36292b88f91ccadd306679c9d358d003fa519eb9 (patch)
tree93339e7ce017cb184fbb4ae8a3442dadad927645 /cross
parentd6d82a218e9edc3042ed36fb70f5511f1e391c51 (diff)
downloadpkgsrc-36292b88f91ccadd306679c9d358d003fa519eb9.tar.gz
New package, cross-compiler for NetBSD/PlayStation2
Diffstat (limited to 'cross')
-rw-r--r--cross/mipsEEel-netbsd/Makefile103
-rw-r--r--cross/mipsEEel-netbsd/distinfo14
-rw-r--r--cross/mipsEEel-netbsd/patches/binutils-aa13
-rw-r--r--cross/mipsEEel-netbsd/patches/binutils-ab14
-rw-r--r--cross/mipsEEel-netbsd/patches/binutils-ac13
-rw-r--r--cross/mipsEEel-netbsd/patches/binutils-ad26
-rw-r--r--cross/mipsEEel-netbsd/patches/gcc-aa20
-rw-r--r--cross/mipsEEel-netbsd/patches/gcc-ab255
-rw-r--r--cross/mipsEEel-netbsd/patches/gcc-ac13
-rw-r--r--cross/mipsEEel-netbsd/pkg/DESCR5
-rw-r--r--cross/mipsEEel-netbsd/pkg/PLIST134
11 files changed, 610 insertions, 0 deletions
diff --git a/cross/mipsEEel-netbsd/Makefile b/cross/mipsEEel-netbsd/Makefile
new file mode 100644
index 00000000000..e59bb9db864
--- /dev/null
+++ b/cross/mipsEEel-netbsd/Makefile
@@ -0,0 +1,103 @@
+# $NetBSD: Makefile,v 1.1 2001/08/05 15:28:41 kent Exp $
+
+DISTNAME= cross-${TARGET_ARCH}-${DISTVERSION}
+TARGET_ARCH= mipsEEel-netbsd
+DISTVERSION= 1.0.0
+CATEGORIES+= cross lang
+MAINTAINER= kent@netbsd.org
+COMMENT= Cross-compiler for NetBSD/PlayStation2 kernel
+
+BZCAT= /usr/bin/bzcat
+USE_GMAKE= yes
+
+# We don't use CROSSBASE because the binutils are not the same as binutils
+# for other cross compilers.
+#USE_CROSSBASE= yes
+TARGET_DIR= ${PREFIX}/cross-ps2
+PLIST_SUBST+= SUBDIR="cross-ps2" TARGET_ARCH="${TARGET_ARCH}" \
+ GCC_VERSION="${GCC_VERSION}"
+
+#
+# binutils
+#
+MASTER_SITES+= ftp://ftp.netbsd.org/pub/NetBSD/misc/tshiozak/PlayStation2/GPLed-from-SCEI/binutils-2.9EE/
+DISTFILES+= binutils-2.9EE.linux.patch.bz2
+BINUTILS_PATCH1= ${_DISTDIR}/binutils-2.9EE.linux.patch.bz2
+DISTFILES+= binutils-ps2linux-0.9.patch.bz2
+BINUTILS_PATCH2= ${_DISTDIR}/binutils-ps2linux-0.9.patch.bz2
+
+BINUTILS_DISTNAME= binutils-2.9EE
+BINUTILS_WRKSRC= ${WRKDIR}/${BINUTILS_DISTNAME}
+DISTFILES+= ${BINUTILS_DISTNAME}.tar.gz
+EXTRACT_ONLY= ${BINUTILS_DISTNAME}.tar.gz
+
+#
+# gcc
+#
+MASTER_SITES+= ftp://ftp.netbsd.org/pub/NetBSD/misc/tshiozak/PlayStation2/GPLed-from-SCEI/gcc-2.95.2EE/
+GCC_VERSION= 2.95.2
+GCC_DISTNAME= gcc-${GCC_VERSION}
+GCC_WRKSRC= ${WRKDIR}/${GCC_DISTNAME}
+DISTFILES+= ${GCC_DISTNAME}.tar.gz
+EXTRACT_ONLY+= ${GCC_DISTNAME}.tar.gz
+DISTFILES+= gcc-${GCC_VERSION}.EE-linux.patch.bz2
+GCC_PATCH1= ${_DISTDIR}/gcc-${GCC_VERSION}.EE-linux.patch.bz2
+DISTFILES+= gcc-ps2linux-0.9.1.patch.bz2
+GCC_PATCH2= ${_DISTDIR}/gcc-ps2linux-0.9.1.patch.bz2
+BUILD_DEPENDS+= bison:../../devel/bison
+
+
+pre-patch: binutils-patch gcc-patch
+do-configure: binutils-configure gcc-configure
+do-build: binutils-build gcc-build
+do-install: binutils-install gcc-install
+
+
+binutils-patch:
+ ${BZCAT} ${BINUTILS_PATCH1} | ${PATCH} -d ${BINUTILS_WRKSRC} --forward --quiet -p1 -E
+ ${BZCAT} ${BINUTILS_PATCH2} | ${PATCH} -d ${BINUTILS_WRKSRC} --forward --quiet -p1 -E
+ for i in patches/binutils-*; do \
+ ${PATCH} -d ${BINUTILS_WRKSRC} --forward --quiet -E < $$i; \
+ done
+
+binutils-configure:
+ ${MKDIR} ${BINUTILS_WRKSRC}/obj
+ cd ${BINUTILS_WRKSRC}/obj && ../configure --prefix=${TARGET_DIR} \
+ --target=${TARGET_ARCH}
+
+binutils-build:
+ ${GMAKE} -C ${BINUTILS_WRKSRC}/obj
+
+binutils-install:
+ ${GMAKE} -C ${BINUTILS_WRKSRC}/obj install
+
+
+gcc-patch:
+ ${BZCAT} ${GCC_PATCH1} | ${PATCH} -d ${GCC_WRKSRC} --forward --quiet -p1 -E
+ ${BZCAT} ${GCC_PATCH2} | ${PATCH} -d ${GCC_WRKSRC} --forward --quiet -p1 -E
+ for i in patches/gcc-*; do \
+ ${PATCH} -d ${GCC_WRKSRC} --forward --quiet -E < $$i; \
+ done
+
+gcc-configure:
+ ${MKDIR} ${GCC_WRKSRC}/obj
+ cd ${GCC_WRKSRC}/obj && ../configure --prefix=${TARGET_DIR} \
+ --enable-shared --target=${TARGET_ARCH} \
+ --enable-languages=c,c++ --with-gnu-as \
+ --with-gnu-ld --disable-nls
+ -${RM} ${GCC_WRKSRC}/obj/texinfo/makeinfo/Makefile
+
+gcc-build:
+ -${RM} ${GCC_WRKSRC}/obj/gcc/as
+ -${RM} ${GCC_WRKSRC}/obj/gcc/ld
+ ${LN} -s ${BINUTILS_WRKSRC}/obj/gas/as-new ${GCC_WRKSRC}/obj/gcc/as
+ ${LN} -s ${BINUTILS_WRKSRC}/obj/ld/ld-new ${GCC_WRKSRC}/obj/gcc/ld
+ ${GMAKE} -C ${GCC_WRKSRC}/obj/libiberty
+# ${GMAKE} -C ${GCC_WRKSRC}/obj/texinfo
+ ${GMAKE} -C ${GCC_WRKSRC}/obj/gcc LIBGCC="" LIBGCC1_TEST="" INSTALL_LIBGCC=""
+
+gcc-install:
+ ${GMAKE} -C ${GCC_WRKSRC}/obj/gcc install-common install-headers install-cpp lang.install-normal install-driver
+
+.include "../../mk/bsd.pkg.mk"
+
diff --git a/cross/mipsEEel-netbsd/distinfo b/cross/mipsEEel-netbsd/distinfo
new file mode 100644
index 00000000000..fe5be8f98ef
--- /dev/null
+++ b/cross/mipsEEel-netbsd/distinfo
@@ -0,0 +1,14 @@
+$NetBSD: distinfo,v 1.1 2001/08/05 15:28:41 kent Exp $
+
+SHA1 (binutils-2.9EE.linux.patch.bz2) = 9b8af1ca94cbb6731fc283509d420b9ca35a7658
+Size (binutils-2.9EE.linux.patch.bz2) = 292104 bytes
+SHA1 (binutils-ps2linux-0.9.patch.bz2) = 29283f4fe7f450a69495a0da80c44eb28377088d
+Size (binutils-ps2linux-0.9.patch.bz2) = 19123 bytes
+SHA1 (binutils-2.9EE.tar.gz) = 541c6815446b091ca17405127602b3673dc84fc8
+Size (binutils-2.9EE.tar.gz) = 7199214 bytes
+SHA1 (gcc-2.95.2.tar.gz) = c3da103de3fa97c78ccc1b4fdc29fa25bf26a6c8
+Size (gcc-2.95.2.tar.gz) = 12885815 bytes
+SHA1 (gcc-2.95.2.EE-linux.patch.bz2) = df5ee1b60219a1d1f7c073751571554888028b18
+Size (gcc-2.95.2.EE-linux.patch.bz2) = 220838 bytes
+SHA1 (gcc-ps2linux-0.9.1.patch.bz2) = 2dd428fc45d2aafafe7bbd479012fbff29fbc07c
+Size (gcc-ps2linux-0.9.1.patch.bz2) = 612196 bytes
diff --git a/cross/mipsEEel-netbsd/patches/binutils-aa b/cross/mipsEEel-netbsd/patches/binutils-aa
new file mode 100644
index 00000000000..76f491ea4db
--- /dev/null
+++ b/cross/mipsEEel-netbsd/patches/binutils-aa
@@ -0,0 +1,13 @@
+$NetBSD: binutils-aa,v 1.1 2001/08/05 15:28:41 kent Exp $
+
+--- gas/configure.orig Tue Jan 11 20:47:59 2000
++++ gas/configure
+@@ -1760,7 +1760,7 @@
+ m88k-*-coff*) fmt=coff ;;
+
+ # don't change em like *-*-bsd does
+- mips-dec-netbsd*) fmt=elf endian=little ;;
++ mips-*-netbsd*) fmt=elf endian=little ;;
+ mips-dec-openbsd*) fmt=elf endian=little ;;
+ mips-dec-bsd*) fmt=aout endian=little ;;
+ mips-sony-bsd*) fmt=ecoff ;;
diff --git a/cross/mipsEEel-netbsd/patches/binutils-ab b/cross/mipsEEel-netbsd/patches/binutils-ab
new file mode 100644
index 00000000000..71f39544626
--- /dev/null
+++ b/cross/mipsEEel-netbsd/patches/binutils-ab
@@ -0,0 +1,14 @@
+$NetBSD: binutils-ab,v 1.1 2001/08/05 15:28:41 kent Exp $
+
+--- ld/configure.tgt.orig Tue Jan 11 20:48:20 2000
++++ ld/configure.tgt
+@@ -167,6 +167,9 @@
+ mips*-*-ecoff*) targ_emul=mipsidt ;;
+ mips*-dec-bsd*) targ_emul=mipsbsd ;;
+ mips*-dec-netbsd*) targ_emul=elf32lmip ;;
++mips*el-*-netbsd*) targ_emul=elf32lsmip
++ targ_extra_emuls="elf32bsmip mipslit mipsbig"
++ ;;
+ mips*-*-bsd*) targ_emul=mipsbig ;;
+ mips*vr4300el-*-elf*) targ_emul=elf32l4300 ;;
+ mips*vr4300-*-elf*) targ_emul=elf32b4300 ;;
diff --git a/cross/mipsEEel-netbsd/patches/binutils-ac b/cross/mipsEEel-netbsd/patches/binutils-ac
new file mode 100644
index 00000000000..4c603ebab94
--- /dev/null
+++ b/cross/mipsEEel-netbsd/patches/binutils-ac
@@ -0,0 +1,13 @@
+$NetBSD: binutils-ac,v 1.1 2001/08/05 15:28:41 kent Exp $
+
+--- bfd/config.bfd~ Fri Aug 3 01:08:39 2001
++++ bfd/config.bfd
+@@ -48,7 +48,7 @@
+
+ case "${targ}" in
+ mips64*-sky*-elf*) targ_archs="${targ_archs} bfd_dvp_arch" ;;
+- mipsEEel-*-linux*) targ_archs="${targ_archs} bfd_dvp_arch" ;;
++ mipsEEel-*-*) targ_archs="${targ_archs} bfd_dvp_arch" ;;
+ esac
+
+ # WHEN ADDING ENTRIES TO THIS MATRIX:
diff --git a/cross/mipsEEel-netbsd/patches/binutils-ad b/cross/mipsEEel-netbsd/patches/binutils-ad
new file mode 100644
index 00000000000..f2fb63addad
--- /dev/null
+++ b/cross/mipsEEel-netbsd/patches/binutils-ad
@@ -0,0 +1,26 @@
+$NetBSD: binutils-ad,v 1.1 2001/08/05 15:28:41 kent Exp $
+
+--- configure.in.orig Fri Aug 3 09:01:15 2001
++++ configure.in
+@@ -332,6 +332,9 @@
+ mips64r59*)
+ target_makefile_frag="${target_makefile_frag} config/mt-r5900"
+ ;;
++ mipsEEel-*-netbsd*)
++ target_makefile_frag="${target_makefile_frag} config/mt-sky"
++ ;;
+ mipsEEel-*-linux*)
+ target_makefile_frag="${target_makefile_frag} config/mt-linux config/mt-sky"
+ ;;
+@@ -671,6 +674,11 @@
+ i[3456]86-*-go32* | i[3456]-*-msdosdjgpp*)
+ # but don't build gdb
+ noconfigdirs="$noconfigdirs gdb target-libg++ target-libstdc++ target-libio target-librx"
++ ;;
++ mipsEEel-*-netbsd*)
++ extraconfigdirs="$extraconfigdirs gas,dvp-gas,ee-dvp"
++ # linux has rx in libc
++ skipdirs="$skipdirs target-librx"
+ ;;
+ mipsEEel-*-linux*)
+ extraconfigdirs="$extraconfigdirs gas,dvp-gas,ee-dvp"
diff --git a/cross/mipsEEel-netbsd/patches/gcc-aa b/cross/mipsEEel-netbsd/patches/gcc-aa
new file mode 100644
index 00000000000..468b4fdfc86
--- /dev/null
+++ b/cross/mipsEEel-netbsd/patches/gcc-aa
@@ -0,0 +1,20 @@
+$NetBSD: gcc-aa,v 1.1 2001/08/05 15:28:41 kent Exp $
+
+--- gcc/configure.hoge Thu Aug 2 23:14:48 2001
++++ gcc/configure
+@@ -4686,6 +4686,15 @@
+ # On NetBSD, the headers are already okay, except for math.h.
+ tmake_file=t-netbsd
+ ;;
++ mipsEEel-*-netbsd*) # for NetBSD/PlayStation2, incomplete!!
++ xmake_file=x-linux # Oops
++ xm_file="xm-siglist.h ${xm_file}"
++ tmake_file="mips/t-eelinux" #
++ tm_file="mips/elfl.h mips/eenetbsd.h"
++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
++ gnu_ld=yes
++ gas=yes
++ ;;
+ mipsEE*-*-linux*) # MIPS EE w/ Linux & ELF
+ xmake_file=x-linux
+ xm_file="xm-siglist.h ${xm_file}"
diff --git a/cross/mipsEEel-netbsd/patches/gcc-ab b/cross/mipsEEel-netbsd/patches/gcc-ab
new file mode 100644
index 00000000000..ed2a4a40e92
--- /dev/null
+++ b/cross/mipsEEel-netbsd/patches/gcc-ab
@@ -0,0 +1,255 @@
+$NetBSD: gcc-ab,v 1.1 2001/08/05 15:28:41 kent Exp $
+
+--- /dev/null Thu Aug 2 23:44:43 2001
++++ gcc/config/mips/eenetbsd.h
+@@ -0,0 +1,250 @@
++/*
++ *
++ *
++ *
++ */
++
++/* Experimental: */
++#define MIPS_ABI_DEFAULT ABI_32
++#undef mips_abi
++extern int mips_abi;
++/* End of experimental */
++
++#define MIPS_CPU_STRING_DEFAULT "R5900"
++
++#undef MIPS_ISA_DEFAULT
++#define MIPS_ISA_DEFAULT 2
++
++#include "linux.h"
++#include "abi64.h"
++
++/*
++ * Override TARGET_DEFAULT
++ * for r5900 : default is -msingle-float
++ */
++#undef TARGET_DEFAULT
++#define TARGET_DEFAULT (MASK_ABICALLS|MASK_GAS|MASK_SINGLE_FLOAT|MASK_MIPS5900)
++
++#undef MACHINE_TYPE
++#define MACHINE_TYPE "(MIPSEL EE NetBSD/ELF)"
++
++/* How to output a quadword for the r5900. */
++#define ASM_OUTPUT_QUADRUPLE_INT(STREAM,VALUE) \
++do { \
++ if (TARGET_64BIT) \
++ { \
++ fprintf (STREAM, "\t.octa\t"); \
++ if (HOST_BITS_PER_WIDE_INT < 64 || GET_CODE (VALUE) != CONST_INT) \
++ /* We can't use 'X' for negative numbers, because then we won't \
++ get the right value for the upper 32 bits. */ \
++ output_addr_const (STREAM, VALUE); \
++ else \
++ /* We must use 'X', because otherwise LONG_MIN will print as \
++ a number that the Irix 6 assembler won't accept. */ \
++ print_operand (STREAM, VALUE, 'X'); \
++ fprintf (STREAM, "\n"); \
++ } \
++ else \
++ { \
++ assemble_integer (operand_subword ((VALUE), 0, 0, TImode), \
++ UNITS_PER_WORD, 1); \
++ assemble_integer (operand_subword ((VALUE), 1, 0, TImode), \
++ UNITS_PER_WORD, 1); \
++ } \
++} while (0)
++
++/* ALIGN 128 bit objects */
++
++#define DEFAULT_MIPS_ALIGNMENT 128
++
++#undef SUBTARGET_TARGET_OPTIONS
++#define SUBTARGET_TARGET_OPTIONS \
++ { "align128", &mips_align128_string, \
++ "Speciy 128bit alignment to use"}, \
++ { "no-align128", &mips_no_align128_string, \
++ "Speciy no 128bit alignment to use"}, \
++ { "abi=", &mips_abi_string, \
++ "Speciy ABI to use"},
++
++#undef STACK_BOUNDARY
++#define STACK_BOUNDARY \
++ ((mips_abi == ABI_32 || mips_abi == ABI_O64 || mips_abi == ABI_EABI) \
++ ? 64 : 128)
++
++#undef MIPS_STACK_ALIGN
++#define MIPS_STACK_ALIGN(LOC) \
++ (((mips_abi == ABI_32 || mips_abi == ABI_O64 || mips_abi == ABI_EABI) \
++ && mips_alignment != 128 ) \
++ ? ((LOC) + 7) & ~7 \
++ : ((LOC) + 15) & ~15)
++
++
++#undef BIGGEST_ALIGNMENT
++#define BIGGEST_ALIGNMENT mips_alignment
++
++#define PREFERRED_STACK_BOUNDARY \
++(mips_alignment == 128 ? 128 : \
++ ((mips_abi == ABI_32 || mips_abi == ABI_O64 || mips_abi == ABI_EABI ) \
++ ? 64 : 128))
++
++
++/*
++
++ ** Table of cc1 flags v.s. stack alignment related values **
++
++ STACK_BOUNDARY MIPS_STACK_ALIGN BIGGEST_ALIGNMENT PREFERRED_STACK_BOUNDARY
++o32/o64 64 64 64 64
++ +align128 64 128 128 128
++n32/n64 128 128 64 128
++ +align128 128 128 128 128
++*/
++
++/*
++////////////
++//
++// default mips2
++//
++// default is elf, -mabi=o32, -mips2, -mcpu=r5900 and -EL
++*/
++#undef CPP_PREDEFINES
++#define CPP_PREDEFINES "\
++-D__ELF__ -D_MIPS_SIM=_MIPS_SIM_ABI32 \
++-D_MIPS_ISA=_MIPS_ISA_MIPS2 \
++-Dunix -D__unix__ \
++-D__NetBSD__ \
++-Dmips -D_mips -D__mips -D__mips__ \
++-DR3000 -D_R3000 \
++-DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__ \
++-Asystem(unix) -Asystem(posix) -Acpu(mips) -Amachine(mips) \
++ "
++
++#undef SUBTARGET_CPP_SPEC
++#define SUBTARGET_CPP_SPEC "\
++%{mfp32: -D_MIPS_FPSET=16}%{!mfp32: -D_MIPS_FPSET=32} \
++%{mips1: -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS1} \
++%{mips2: -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS2} \
++%{mips3: -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS3 -UR3000 -U_R3000} \
++%{mips4: -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS4 -UR3000 -U_R3000} \
++%{!mips*: -D_MIPS_ISA=_MIPS_ISA_MIPS2} \
++%{fno-PIC: -U__PIC__ -U__pic__} \
++%{fno-pic: -U__PIC__ -U__pic__} \
++%{fPIC: -D__PIC__ -D__pic__} \
++%{fpic: -D__PIC__ -D__pic__} \
++%{!fpic: %{!fPIC: %{!fno-pic: %{!fno-pic: -D__PIC__ -D__pic__}}}} \
++%{-D__HAVE_FPU__ } \
++%{posix: -D_POSIX_SOURCE} \
++%{.cc: -D__LANGUAGE_C_PLUS_PLUS__ %{!ansi:-DLANGUAGE_C_PLUS_PLUS}} \
++%{.cxx: -D__LANGUAGE_C_PLUS_PLUS__ %{!ansi:-DLANGUAGE_C_PLUS_PLUS}} \
++%{.C: -D__LANGUAGE_C_PLUS_PLUS__ %{!ansi:-DLANGUAGE_C_PLUS_PLUS}} \
++%{.m: -D__LANGUAGE_OBJECTIVE_C__ %{!ansi:-DLANGUAGE_OBJECTIVE_C}} \
++%{.S: -D__LANGUAGE_ASSEMBLY__ %{!ansi:-DLANGUAGE_ASSEMBLY}} \
++%{.s: -D__LANGUAGE_ASSEMBLY__ %{!ansi:-DLANGUAGE_ASSEMBLY}} \
++%{!.S: %{!.s: %{!.cc: %{!.cxx: %{!.C: %{!.m: -D__LANGUAGE_C__ %{!ansi:-DLANGUAGE_C}}}}}} } \
++%{ansi:-Uunix -Ulinux -Umips -UR3000 -UMIPSEB -UMIPSEL} \
++%{ffast-math: -D__FAST_MATH__} \
++%{!mcpu*: -D__R5900 -D_R5900} \
++%{mcpu=r5900: -D__R5900 -D_R5900} \
++ "
++#undef SUBTARGET_CC1_SPEC
++#define SUBTARGET_CC1_SPEC "\
++%{fno-pic: -mno-abicalls} \
++ "
++
++#undef SUBTARGET_ASM_SPEC
++#define SUBTARGET_ASM_SPEC "\
++%{!mcpu*: -mwarn-short-loop} \
++%{!mcpu*: -mcpu=r5900} \
++%{fno-pic: -non_shared} \
++%{mno-abicalls: -non_shared} \
++%{!fno-pic: %{!mno-abicalls: -KPIC}} \
++%{!mips*: -mips2} \
++%{!mdouble-float: -msingle-float} \
++ "
++
++
++/*
++ * Default fucntion and data alignment values for r5900
++ */
++
++/* prefer .p2align rather than .align (gas assumed) */
++#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
++ if ((LOG)!=0) \
++ if ((MAX_SKIP)==0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
++ else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP))
++
++#undef DEFAULT_LOOP_ALIGN
++#undef DEFAULT_LOOP_MAX_SKIP
++#undef DEFAULT_JUMP_ALIGN
++#undef DEFAULT_JUMP_MAX_SKIP
++#undef DEFAULT_FUNCTION_ALIGN
++#undef DEFAULT_FUNCTION_MAX_SKIP
++
++#define DEFAULT_LOOP_ALIGN 3
++#define DEFAULT_LOOP_MAX_SKIP 0
++#define DEFAULT_JUMP_ALIGN 2
++#define DEFAULT_JUMP_MAX_SKIP 0
++#define DEFAULT_FUNCTION_ALIGN 3
++#define DEFAULT_FUNCTION_MAX_SKIP 0
++
++/*
++ * bb profiling extension
++ *
++ *construct/destruct private reocord in strunc bb
++ * int BB_CONSTRUCT_PRIVATE_RECORD(void **p_private)
++ * ( return 1 if successed, otherwise return 0 )
++ * void BB_DESTRUCT_PRIVATE_RECORD(void **p_private)
++ *
++ *called from "bb.out" reporter
++ * void BB_PRINT_PRIVATE_RECORD(FILE*, void *private)
++ *
++ *called from "bb.in" parser
++ * int BB_PARSE_PRIVATE(char *bb_in)
++ * ( return 1 if processed, otherwise return 0 )
++ *
++ *called per once program
++ * void BB_INIT_PRIVATE(void)
++ * void BB_EXIT_PRIVATE(void)
++ *
++ *called when etering/returning function
++ * void BB_INIT_TRACE_FUNC_PRIVATE(struct bb *blocks, unsigned long blockno)
++ * void BB_TRACE_RET_PRIVATE(void)
++ *
++ *called when entering bb
++ * void BB_TRACE_FUNC_PRIVATE(struct __bb * p__bb)
++ *
++ */
++
++#define BB_CONSTRUCT_PRIVATE_RECORD(p_private) \
++ __bb_alloc_r5900_perf_counter(p_private)
++
++#define BB_DESTRUCT_PRIVATE_RECORD(p_private) \
++ __bb_free_r5900_perf_counter(p_private)
++
++#define BB_PRINT_PRIVATE_RECORD(file,private) \
++ __bb_print_r5900_perf_counter(file,private)
++
++#define BB_PARSE_PRIVATE(ptr) \
++ __bb_parse_r5900_perf_counter(ptr)
++
++#define BB_INIT_PRIVATE \
++ __bb_init_r5900_perf_counter
++
++#define BB_EXIT_PRIVATE \
++ __bb_exit_r5900_perf_counter
++
++#define BB_TRACE_FUNC_PRIVATE(pbb) \
++ __bb_trace_r5900_perf_counter(pbb)
++
++#define BB_INIT_TRACE_FUNC_PRIVATE(blocks, blockno) \
++ __bb_init_trace_r5900_perf_counter(blocks, blockno)
++
++#define BB_TRACE_RET_PRIVATE \
++ __bb_ret_trace_r5900_perf_counter
++
++/*
++ * bb_stack size
++ * inital and growth value
++ *
++ */
++#define BB_INITAL_STACK_SIZE 100
++#define BB_GROWTH_OF_STACK_SIZE 100
diff --git a/cross/mipsEEel-netbsd/patches/gcc-ac b/cross/mipsEEel-netbsd/patches/gcc-ac
new file mode 100644
index 00000000000..9ec9ba401fc
--- /dev/null
+++ b/cross/mipsEEel-netbsd/patches/gcc-ac
@@ -0,0 +1,13 @@
+$NetBSD: gcc-ac,v 1.1 2001/08/05 15:28:41 kent Exp $
+
+--- gcc/ginclude/stddef.h.orig Thu Dec 17 06:19:25 1998
++++ gcc/ginclude/stddef.h
+@@ -24,7 +24,7 @@
+
+ /* On 4.3bsd-net2, make sure ansi.h is included, so we have
+ one less case to deal with in the following. */
+-#if defined (__BSD_NET2__) || defined (____386BSD____) || defined (__FreeBSD__) || defined(__NetBSD__)
++#if defined (__BSD_NET2__) || defined (____386BSD____) || defined (__FreeBSD__) /*|| defined(__NetBSD__)*/
+ #include <machine/ansi.h>
+ #endif
+
diff --git a/cross/mipsEEel-netbsd/pkg/DESCR b/cross/mipsEEel-netbsd/pkg/DESCR
new file mode 100644
index 00000000000..88dca9f1d92
--- /dev/null
+++ b/cross/mipsEEel-netbsd/pkg/DESCR
@@ -0,0 +1,5 @@
+This is a cross compiler for mipsEEel, R5900 Emotion Engine,
+which is the CPU of PlayStatoin2.
+
+The cross compiler was tested only for compiling the NetBSD
+kernel.
diff --git a/cross/mipsEEel-netbsd/pkg/PLIST b/cross/mipsEEel-netbsd/pkg/PLIST
new file mode 100644
index 00000000000..4b0957fccbc
--- /dev/null
+++ b/cross/mipsEEel-netbsd/pkg/PLIST
@@ -0,0 +1,134 @@
+@comment $NetBSD: PLIST,v 1.1 2001/08/05 15:28:42 kent Exp $
+${SUBDIR}/bin/cpp
+${SUBDIR}/bin/ee-dvp-as
+${SUBDIR}/bin/ee-dvp-gasp
+${SUBDIR}/bin/gcov
+${SUBDIR}/bin/${TARGET_ARCH}-addr2line
+${SUBDIR}/bin/${TARGET_ARCH}-ar
+${SUBDIR}/bin/${TARGET_ARCH}-as
+${SUBDIR}/bin/${TARGET_ARCH}-c++
+${SUBDIR}/bin/${TARGET_ARCH}-c++filt
+${SUBDIR}/bin/${TARGET_ARCH}-g++
+${SUBDIR}/bin/${TARGET_ARCH}-gasp
+${SUBDIR}/bin/${TARGET_ARCH}-gcc
+${SUBDIR}/bin/${TARGET_ARCH}-ld
+${SUBDIR}/bin/${TARGET_ARCH}-nm
+${SUBDIR}/bin/${TARGET_ARCH}-objcopy
+${SUBDIR}/bin/${TARGET_ARCH}-objdump
+${SUBDIR}/bin/${TARGET_ARCH}-protoize
+${SUBDIR}/bin/${TARGET_ARCH}-ranlib
+${SUBDIR}/bin/${TARGET_ARCH}-readelf
+${SUBDIR}/bin/${TARGET_ARCH}-size
+${SUBDIR}/bin/${TARGET_ARCH}-strings
+${SUBDIR}/bin/${TARGET_ARCH}-strip
+${SUBDIR}/bin/${TARGET_ARCH}-unprotoize
+${SUBDIR}/include/ansidecl.h
+${SUBDIR}/include/bfd.h
+${SUBDIR}/include/bfdlink.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/SYSCALLS.c.X
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/cc1
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/cc1plus
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/collect2
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/cpp
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/crtbegin.o
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/crtbeginS.o
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/crtend.o
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/crtendS.o
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/README
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/assert.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/exception
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/fixed
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/float.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/iso646.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/limits.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/new
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/new.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/proto.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/stdarg.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/stdbool.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/stddef.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/syslimits.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/typeinfo
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-alpha.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-arc.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-c4x.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-clipper.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-h8300.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-i860.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-i960.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-m32r.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-m88k.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-mips.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-mn10200.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-mn10300.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-pa.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-ppc.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-pyr.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-sh.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-sparc.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-spur.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/va-v850.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include/varargs.h
+${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/specs
+${SUBDIR}/lib/libbfd.a
+${SUBDIR}/lib/libbfd.la
+${SUBDIR}/lib/libiberty.a
+${SUBDIR}/lib/libopcodes.a
+${SUBDIR}/lib/libopcodes.la
+${SUBDIR}/man/man1/ee-dvp-as.1
+${SUBDIR}/man/man1/${TARGET_ARCH}-addr2line.1
+${SUBDIR}/man/man1/${TARGET_ARCH}-ar.1
+${SUBDIR}/man/man1/${TARGET_ARCH}-as.1
+${SUBDIR}/man/man1/${TARGET_ARCH}-c++filt.1
+${SUBDIR}/man/man1/${TARGET_ARCH}-ld.1
+${SUBDIR}/man/man1/${TARGET_ARCH}-nlmconv.1
+${SUBDIR}/man/man1/${TARGET_ARCH}-nm.1
+${SUBDIR}/man/man1/${TARGET_ARCH}-objcopy.1
+${SUBDIR}/man/man1/${TARGET_ARCH}-objdump.1
+${SUBDIR}/man/man1/${TARGET_ARCH}-ranlib.1
+${SUBDIR}/man/man1/${TARGET_ARCH}-size.1
+${SUBDIR}/man/man1/${TARGET_ARCH}-strings.1
+${SUBDIR}/man/man1/${TARGET_ARCH}-strip.1
+${SUBDIR}/${TARGET_ARCH}/bin/ar
+${SUBDIR}/${TARGET_ARCH}/bin/as
+${SUBDIR}/${TARGET_ARCH}/bin/gcc
+${SUBDIR}/${TARGET_ARCH}/bin/ld
+${SUBDIR}/${TARGET_ARCH}/bin/nm
+${SUBDIR}/${TARGET_ARCH}/bin/ranlib
+${SUBDIR}/${TARGET_ARCH}/bin/strip
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/elf32bsmip.x
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/elf32bsmip.xbn
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/elf32bsmip.xn
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/elf32bsmip.xr
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/elf32bsmip.xs
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/elf32bsmip.xu
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/elf32lsmip.x
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/elf32lsmip.xbn
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/elf32lsmip.xn
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/elf32lsmip.xr
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/elf32lsmip.xs
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/elf32lsmip.xu
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/mipsbig.x
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/mipsbig.xbn
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/mipsbig.xn
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/mipsbig.xr
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/mipsbig.xu
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/mipslit.x
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/mipslit.xbn
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/mipslit.xn
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/mipslit.xr
+${SUBDIR}/${TARGET_ARCH}/lib/ldscripts/mipslit.xu
+@dirrm ${SUBDIR}/bin
+@dirrm ${SUBDIR}/include
+@dirrm ${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}/include
+@dirrm ${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}/${GCC_VERSION}
+@dirrm ${SUBDIR}/lib/gcc-lib/${TARGET_ARCH}
+@dirrm ${SUBDIR}/lib/gcc-lib
+@dirrm ${SUBDIR}/lib
+@dirrm ${SUBDIR}/man/man1
+@dirrm ${SUBDIR}/man
+@dirrm ${SUBDIR}/${TARGET_ARCH}/bin
+@dirrm ${SUBDIR}/${TARGET_ARCH}/lib/ldscripts
+@dirrm ${SUBDIR}/${TARGET_ARCH}/lib
+@dirrm ${SUBDIR}/${TARGET_ARCH}
+@dirrm ${SUBDIR}