Add enough configury glue so that src/tools can build a N64 mips toolchain.

This commit is contained in:
matt 2006-08-25 23:35:04 +00:00
parent 194d4b6b59
commit 9e051a8002
6 changed files with 95 additions and 9 deletions

View File

@ -1,5 +1,5 @@
#! /usr/bin/env sh
# $NetBSD: build.sh,v 1.149 2006/08/09 22:13:12 jnemeth Exp $
# $NetBSD: build.sh,v 1.150 2006/08/25 23:35:04 matt Exp $
#
# Copyright (c) 2001-2005 The NetBSD Foundation, Inc.
# All rights reserved.
@ -178,6 +178,12 @@ getarch()
MACHINE=${MACHINE%-e[bl]}
;;
evbmips64-e[bl]|sbmips64-e[bl])
MACHINE_ARCH=mips64${MACHINE##*-}
makewrappermachine=${MACHINE}
MACHINE=${MACHINE%-e[bl]}
;;
evbmips|sbmips) # no default MACHINE_ARCH
;;
@ -238,7 +244,7 @@ validatearch()
#
case "${MACHINE_ARCH}" in
alpha|arm|armeb|hppa|i386|m68000|m68k|mipse[bl]|ns32k|powerpc|powerpc64|sh[35]e[bl]|sparc|sparc64|vax|x86_64|ia64)
alpha|arm|armeb|hppa|i386|m68000|m68k|mipse[bl]|mips64e[bl]|ns32k|powerpc|powerpc64|sh[35]e[bl]|sparc|sparc64|vax|x86_64|ia64)
;;
"")
@ -260,7 +266,11 @@ validatearch()
;;
evbmips|sbmips)
arches="mipseb mipsel"
arches="mipseb mipsel mips64eb mips64el"
;;
sgimips)
arches="mipseb mips64eb"
;;
evbsh3)
@ -871,7 +881,7 @@ createmakewrapper()
eval cat <<EOF ${makewrapout}
#! /bin/sh
# Set proper variables to allow easy "make" building of a NetBSD subtree.
# Generated from: \$NetBSD: build.sh,v 1.149 2006/08/09 22:13:12 jnemeth Exp $
# Generated from: \$NetBSD: build.sh,v 1.150 2006/08/25 23:35:04 matt Exp $
# with these arguments: ${_args}
#
EOF

View File

@ -808,6 +808,16 @@ case "${targ}" in
targ_defvec=ecoff_big_vec
targ_selvecs=ecoff_little_vec
;;
#ifdef BFD64
mips64*el-*-netbsd*)
targ_defvec=bfd_elf64_littlemips_vec
targ_selvecs="bfd_elf64_bigmips_vec bfd_elf32_nbigmips_vec bfd_elf32_nlittlemips_vec bfd_elf32_ntradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec ecoff_little_vec ecoff_big_vec"
;;
mips64*-*-netbsd*)
targ_defvec=bfd_elf64_bigmips_vec
targ_selvecs="bfd_elf64_littlemips_vec bfd_elf32_nbigmips_vec bfd_elf32_nlittlemips_vec bfd_elf32_ntradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec ecoff_little_vec ecoff_big_vec"
;;
#endif
mips*el-*-netbsd*)
targ_defvec=bfd_elf32_tradlittlemips_vec
targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_little_vec ecoff_big_vec"

View File

@ -1901,6 +1901,12 @@ mips*-*-netbsd*) # NetBSD/mips, either endian.
target_cpu_default="MASK_GAS|MASK_ABICALLS"
tm_file="elfos.h ${tm_file} mips/netbsd.h"
tmake_file="${tmake_file} mips/t-netbsd"
case $machine in
mips64*-*)
target_cpu_default="MASK_GAS|MASK_64BIT|MASK_FLOAT64"
tm_defines="MIPS_ISA_DEFAULT=64 MIPS_ABI_DEFAULT=ABI_N64"
;;
esac
;;
mips*-*-linux*) # Linux MIPS, either endian.
tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.own.mk,v 1.467 2006/07/24 23:54:15 uwe Exp $
# $NetBSD: bsd.own.mk,v 1.468 2006/08/25 23:35:04 matt Exp $
.if !defined(_BSD_OWN_MK_)
_BSD_OWN_MK_=1
@ -9,7 +9,7 @@ MAKECONF?= /etc/mk.conf
#
# CPU model, derived from MACHINE_ARCH
#
MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/sh3e[bl]/sh3/:C/sh5e[bl]/sh5/:S/m68000/m68k/:S/armeb/arm/}
MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips64/:C/sh3e[bl]/sh3/:C/sh5e[bl]/sh5/:S/m68000/m68k/:S/armeb/arm/}
#
# Subdirectory used below ${RELEASEDIR} when building a release
@ -52,6 +52,8 @@ TOOLCHAIN_MISSING?= no
${MACHINE_ARCH} == "armeb" || \
${MACHINE_ARCH} == "i386" || \
${MACHINE_ARCH} == "m68000" || \
${MACHINE_ARCH} == "mips64el" || \
${MACHINE_ARCH} == "mips64eb" || \
${MACHINE_ARCH} == "powerpc" || \
${MACHINE_ARCH} == "powerpc64" || \
${MACHINE_ARCH} == "sh3eb" || \
@ -134,8 +136,8 @@ USETOOLS?= yes
USETOOLS?= no
.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "sh3" || \
${MACHINE_ARCH} == "sh5"
.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \
${MACHINE_ARCH} == "sh3" || ${MACHINE_ARCH} == "sh5"
.BEGIN:
@echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
@false
@ -513,6 +515,7 @@ GNU_ARCH.sh3eb=sh
GNU_ARCH.sh3el=shle
GNU_ARCH.sh5eb=sh5
GNU_ARCH.sh5el=sh5le
GNU_ARCH.mips64eb=mips64
MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
#

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.31 2006/07/01 01:29:55 ross Exp $
# $NetBSD: Makefile,v 1.32 2006/08/25 23:35:04 matt Exp $
# For now, we install the machine and arch includes, and symlink 'machine'
# to the location of the machine includes (usually).
@ -10,6 +10,9 @@
SUBDIR= ${MACHINE}
ARCHSUBDIR= ${MACHINE_CPU}
.if ${ARCHSUBDIR} == "mips64"
ARCHSUBDIR= mips
.endif
.if ${ARCHSUBDIR} == "powerpc64"
ARCHSUBDIR= powerpc
.endif

View File

@ -0,0 +1,54 @@
/* $NetBSD: targparam.h,v 1.1 2006/08/25 23:35:04 matt Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
* All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Jochen Pohl for
* The NetBSD Project.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Machine-dependent target parameters for lint1.
*/
#include "lp64.h"
/*
* Should be set to 1 if the difference of two pointers is of type long
* or the value of sizeof is of type unsigned long. Note this MUST be
* kept in sync with the compiler!
*/
#define PTRDIFF_IS_LONG 1
#define SIZEOF_IS_ULONG 1
#define INTPTR_IS_LONG 1
#define FLOAT_SIZE (4 * CHAR_BIT)
#define DOUBLE_SIZE (8 * CHAR_BIT)
#define LDOUBLE_SIZE (8 * CHAR_BIT)
#define ENUM_SIZE (4 * CHAR_BIT)