Add TARGET_ARCH=mipsel and TARGET_ARCH=mipseb as a valid targets.

Unlike the unisex architecutres we've had so far, mips is bisexual.
These tools can produce either byte sex, and the compiler/make
determines the proper gender to use.  Otherwise, we'd have to have had
mipsel and mipseb in all the places that we have just mips.  And there
are other complications with doing that (binutils doesn't like to
build mips tools without both byte genders, it seems).

Introduced BINUTIL_ARCH so that other bisexual architectures can a
generic mechanism.

We cannot just define MACHINE_ARCH as mips because we need to
differentiate big and little endian types of binaries.  Discussions on
freebsd-arch have hashed out this issue (and the parallel libc
issues).  NetBSD is moving towards mipsel and mipseb for their two
flavors of mips ports (in time for 1.4, if this change hasn't already
been accomplished).

I've been building i386 worlds with this tree for a three months with
these files in place with no ill effects.
This commit is contained in:
Warner Losh 1999-03-01 04:01:57 +00:00
parent 8a8d99276f
commit 7408d8ff34
17 changed files with 3182 additions and 13 deletions

View File

@ -1,5 +1,5 @@
#
# $Id: Makefile.inc0,v 1.4 1998/05/04 21:10:56 jb Exp $
# $Id: Makefile.inc0,v 1.5 1998/09/06 23:01:49 jdp Exp $
#
#
@ -10,6 +10,12 @@
VERSION= 2.9.1
.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
BINUTIL_ARCH=mips
.else
BINUTIL_ARCH=${MACHINE_ARCH}
.endif
# RELTOP is the relative path to this point in the source or object
# tree, from any subdirectory of same. It gets extra "../" prefixes
# added to it as we descend into subdirectories.
@ -23,18 +29,18 @@ CFLAGS+= -D_GNU_SOURCE
# We use "-I-" because without it our yacc-generated parser tries to
# use GNU's bison-generated header files.
CFLAGS+= -I- -I.
.if exists(${.CURDIR}/${MACHINE_ARCH})
CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH}
.if exists(${.CURDIR}/${BINUTIL_ARCH})
CFLAGS+= -I${.CURDIR}/${BINUTIL_ARCH}
.endif
CFLAGS+= -I${.CURDIR}
CFLAGS+= -I${.CURDIR}/${RELTOP}/libbfd/${MACHINE_ARCH}
CFLAGS+= -I${.CURDIR}/${RELTOP}/libbfd/${BINUTIL_ARCH}
CFLAGS+= -I${SRCDIR}/include
.if exists(${.CURDIR}/${MACHINE_ARCH})
.PATH: ${.CURDIR}/${MACHINE_ARCH}
.if exists(${.CURDIR}/${BINUTIL_ARCH})
.PATH: ${.CURDIR}/${BINUTIL_ARCH}
.endif
ARCHS= ${MACHINE_ARCH} ${CROSS_TOOLS}
ARCHS= ${BINUTIL_ARCH} ${CROSS_TOOLS}
.for _arch in ${ARCHS}
.if exists(${.CURDIR}/Makefile.${_arch})

View File

@ -1,8 +1,11 @@
#
# $Id: Makefile,v 1.3 1998/05/04 22:01:27 jb Exp $
# $Id: Makefile,v 1.4 1998/05/11 09:31:17 jb Exp $
#
GASES= ${MACHINE_ARCH} ${CROSS_TOOLS} ${CROSS_TARGETS}
.include "${.CURDIR}/../Makefile.inc0"
GASES= ${BINUTIL_ARCH}
GASES+= ${CROSS_TOOLS} ${CROSS_TARGETS}
.for _g in ${GASES}
.if exists(${.CURDIR}/as_${_g})
SUBDIR+= as_${_g}

View File

@ -0,0 +1,14 @@
#
# $Id: Makefile,v 1.3 1998/05/05 10:31:52 jb Exp $
#
.include "${.CURDIR}/../Makefile.inc0"
.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
PROG= as
.else
PROG= as_mips
.endif
SRCS+= obj-elf.c tc-mips.c itbl-ops.c itbl-parse.y itbl-lex.l
.include <bsd.prog.mk>

View File

@ -0,0 +1,133 @@
/* config.h. Generated automatically by make. */
#ifndef GAS_VERSION
#define GAS_VERSION "2.8.1"
/* conf. Generated automatically by configure. */
/* conf.in. Generated automatically from configure.in by autoheader. */
/* Define if using alloca.c. */
/* #undef C_ALLOCA */
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
/* #undef CRAY_STACKSEG_END */
/* Define if you have alloca, as a function or macro. */
#define HAVE_ALLOCA 1
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
/* #undef HAVE_ALLOCA_H */
/* Define as __inline if that's what the C compiler calls it. */
/* #undef inline */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
/* #undef STACK_DIRECTION */
/* Should gas use high-level BFD interfaces? */
#define BFD_ASSEMBLER 1
/* Some assert/preprocessor combinations are incapable of handling
certain kinds of constructs in the argument of assert. For example,
quoted strings (if requoting isn't done right) or newlines. */
/* #undef BROKEN_ASSERT */
/* If we aren't doing cross-assembling, some operations can be optimized,
since byte orders and value sizes don't need to be adjusted. */
#define CROSS_COMPILE
/* Some gas code wants to know these parameters. */
#define TARGET_ALIAS "mips-unknown-freebsdelf"
#define TARGET_CPU "mips"
#define TARGET_CANONICAL "mips-unknown-freebsdelf"
#define TARGET_OS "freebsdelf"
#define TARGET_VENDOR "unknown"
/* Sometimes the system header files don't declare strstr. */
/* #undef NEED_DECLARATION_STRSTR */
/* Sometimes the system header files don't declare malloc and realloc. */
/* #undef NEED_DECLARATION_MALLOC */
/* Sometimes the system header files don't declare free. */
/* #undef NEED_DECLARATION_FREE */
/* Sometimes the system header files don't declare sbrk. */
/* #undef NEED_DECLARATION_SBRK */
/* Sometimes errno.h doesn't declare errno itself. */
/* #undef NEED_DECLARATION_ERRNO */
/* #undef MANY_SEGMENTS */
/* Needed only for sparc configuration. */
/* #undef SPARC_V9 */
/* #undef SPARC_ARCH64 */
/* Defined if using CGEN. */
/* #undef USING_CGEN */
/* Needed only for some configurations that can produce multiple output
formats. */
#define DEFAULT_EMULATION ""
#define EMULATIONS
/* #undef USE_EMULATIONS */
/* #undef OBJ_MAYBE_AOUT */
/* #undef OBJ_MAYBE_BOUT */
/* #undef OBJ_MAYBE_COFF */
/* #undef OBJ_MAYBE_ECOFF */
/* #undef OBJ_MAYBE_ELF */
/* #undef OBJ_MAYBE_GENERIC */
/* #undef OBJ_MAYBE_HP300 */
/* #undef OBJ_MAYBE_IEEE */
/* #undef OBJ_MAYBE_SOM */
/* #undef OBJ_MAYBE_VMS */
/* Used for some of the COFF configurations, when the COFF code needs
to select something based on the CPU type before it knows it... */
/* #undef I386COFF */
/* #undef M68KCOFF */
/* #undef M88KCOFF */
/* Define if you have the remove function. */
/* #undef HAVE_REMOVE */
/* Define if you have the sbrk function. */
#define HAVE_SBRK 1
/* Define if you have the unlink function. */
#define HAVE_UNLINK 1
/* Define if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1
/* Define if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define if you have the <varargs.h> header file. */
#define HAVE_VARARGS_H 1
#endif /* GAS_VERSION */

View File

@ -0,0 +1,47 @@
/* itbl-mips.h
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
GAS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GAS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GAS; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
/* Defines for Mips itbl cop support */
#include "opcode/mips.h"
/* Values for processors will be from 0 to NUMBER_OF_PROCESSORS-1 */
#define NUMBER_OF_PROCESSORS 4
#define MAX_BITPOS 31
/* Mips specifics */
#define MIPS_OPCODE_COP0 (0x21) /* COPz+CO, bits 31-25: 0100zz1 */
#define MIPS_ENCODE_COP_NUM(z) ((MIPS_OPCODE_COP0|z<<1)<<25)
#define MIPS_IS_COP_INSN(insn) ((MIPS_OPCODE_COP0&(insn>>25)) \
== MIPS_OPCODE_COP0)
#define MIPS_DECODE_COP_NUM(insn) ((~MIPS_OPCODE_COP0&(insn>>25))>>1)
#define MIPS_DECODE_COP_COFUN(insn) ((~MIPS_ENCODE_COP_NUM(3))&(insn))
/* definitions required by generic code */
#define ITBL_IS_INSN(insn) MIPS_IS_COP_INSN(insn)
#define ITBL_DECODE_PNUM(insn) MIPS_DECODE_COP_NUM(insn)
#define ITBL_ENCODE_PNUM(pnum) MIPS_ENCODE_COP_NUM(pnum)
#define ITBL_OPCODE_STRUCT mips_opcode
#define ITBL_OPCODES mips_opcodes
#define ITBL_NUM_OPCODES NUMOPCODES
#define ITBL_NUM_MACROS M_NUM_MACROS

View File

@ -0,0 +1 @@
#include "obj-elf.h"

View File

@ -0,0 +1 @@
#include "tc-mips.h"

View File

@ -0,0 +1 @@
#include "te-freebsd.h"

View File

@ -0,0 +1,37 @@
#
# $Id: Makefile.i386,v 1.4 1998/06/04 06:38:17 bde Exp $
#
.if ${MACHINE_ARCH} == "mipseb"
HOST= mipseb-unknown-freebsdelf
CFLAGS+= -DDEFAULT_EMULATION=\"elf_mips\"
CFLAGS+= -DTARGET=\"mipseb-unknown-freebsdelf\"
.endif
.if ${MACHINE_ARCH} == "mipsel"
HOST= mipsel-unknown-freebsdelf
CFLAGS+= -DDEFAULT_EMULATION=\"elf_mips\"
CFLAGS+= -DTARGET=\"mipsel-unknown-freebsdelf\"
.endif
EMS+= ld_elf32bmip_emulation ld_elf32lmip_emulation
LDSCRIPTS+= elf32bmip.x elf32bmip.xbn elf32bmip.xn elf32bmip.xr \
elf32bmip.xs elf32bmip.xu elf32lmip.x elf32lmip.xbn \
elf32lmip.xn elf32lmip.xr elf32lmip.xs elf32lmip.xu
SRCS+= eelf32bmip.c
SRCS+= eelf32lmip.c
CLEANFILES+= eelf32bmip.c
CLEANFILES+= eelf32lmip.c
eelf32bmip.c: emulparams/elf32ebmip.sh emultempl/elf32.em \
scripttempl/elf.sc genscripts.sh emultempl/stringify.sed
env LIB_PATH="/usr/lib" \
sh ${SRCDIR}/ld/genscripts.sh ${SRCDIR}/ld ${DESTDIR}/usr/lib \
${HOST} mipseb-unknown-freebsdelf mipseb-unknown-freebsdelf \
elf32bmip "" elf32bmip mipseb-unknown-freebsdelf
eelf32lmip.c: emulparams/elf32elmip.sh emultempl/elf32.em \
scripttempl/elf.sc genscripts.sh emultempl/stringify.sed
env LIB_PATH="/usr/lib" \
sh ${SRCDIR}/ld/genscripts.sh ${SRCDIR}/ld ${DESTDIR}/usr/lib \
${HOST} mipsel-unknown-freebsdelf mipsel-unknown-freebsdelf \
elf32lmip "" elf32lmip mipsel-unknown-freebsdelf

View File

@ -0,0 +1,7 @@
/* This file is automatically generated. DO NOT EDIT! */
extern ld_emulation_xfer_type ld_elf_i386_emulation;
#define EMULATION_LIST \
&ld_elf32ebmip_emulation, \
&ld_elf32elmip_emulation, \
0

View File

@ -1,10 +1,10 @@
#
# $Id: Makefile,v 1.5 1998/06/04 06:50:57 bde Exp $
# $Id: Makefile,v 1.6 1998/09/06 23:01:53 jdp Exp $
#
.include "../Makefile.inc0"
.PATH: ${SRCDIR}/bfd
.PATH: ${SRCDIR}/bfd ${SRCDIR}/opcodes
LIB= bfd
SRCS+= archive.c archures.c bfd.c binary.c cache.c \

View File

@ -0,0 +1,20 @@
#
# $Id: Makefile.i386,v 1.5 1998/06/04 06:50:58 bde Exp $
#
SRCS+= cpu-mips.c elf32-mips.c elf32-target.h elf32.c elflink.c
SRCS+= coff-mips.c ecoff.c ecofflink.c mips-opc.c mips16-opc.c
VECS+= bfd_elf32_littlemips_vec bfd_elf32_bigmips_vec ecoff_little_vec ecoff_big_vec
.if ${MACHINE_ARCH} == "mipsel"
CFLAGS+= -DDEFAULT_VECTOR=bfd_elf32_littlemips_vec
.endif
.if ${MACHINE_ARCH} == "mipseb"
CFLAGS+= -DDEFAULT_VECTOR=bfd_elf32_bigmips_vec
.endif
CFLAGS+= -DHAVE_bfd_elf32_littlemips_vec
CFLAGS+= -DHAVE_bfd_elf32_bigmips_vec
CFLAGS+= -DHAVE_ecoff_little_vec
CFLAGS+= -DHAVE_ecoff_big_vec
CLEANFILES+= elf32-target.h
elf32-target.h: elfxx-target.h
sed -e s/NN/32/g ${.ALLSRC} > ${.TARGET}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,92 @@
/* config.h. Generated automatically by configure. */
/* config.in. Generated automatically from configure.in by autoheader. */
/* Name of package. */
#define PACKAGE "bfd"
/* Version of package. */
#define VERSION "2.9.1"
/* Whether strstr must be declared even if <string.h> is included. */
/* #undef NEED_DECLARATION_STRSTR */
/* Whether malloc must be declared even if <stdlib.h> is included. */
/* #undef NEED_DECLARATION_MALLOC */
/* Whether realloc must be declared even if <stdlib.h> is included. */
/* #undef NEED_DECLARATION_REALLOC */
/* Whether free must be declared even if <stdlib.h> is included. */
/* #undef NEED_DECLARATION_FREE */
/* Whether getenv must be declared even if <stdlib.h> is included. */
/* #undef NEED_DECLARATION_GETENV */
/* Define if you have a working `mmap' system call. */
#define HAVE_MMAP 1
/* Define if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Do we need to use the b modifier when opening binary files? */
/* #undef USE_BINARY_FOPEN */
/* Name of host specific header file to include in trad-core.c. */
/* #undef TRAD_HEADER */
/* Define only if <sys/procfs.h> is available *and* it defines prstatus_t. */
#define HAVE_SYS_PROCFS_H 1
/* Do we really want to use mmap if it's available? */
/* #undef USE_MMAP */
/* Define if you have the fcntl function. */
#define HAVE_FCNTL 1
/* Define if you have the fdopen function. */
#define HAVE_FDOPEN 1
/* Define if you have the getpagesize function. */
#define HAVE_GETPAGESIZE 1
/* Define if you have the madvise function. */
#define HAVE_MADVISE 1
/* Define if you have the mprotect function. */
#define HAVE_MPROTECT 1
/* Define if you have the setitimer function. */
#define HAVE_SETITIMER 1
/* Define if you have the sysconf function. */
#define HAVE_SYSCONF 1
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1
/* Define if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define if you have the <sys/file.h> header file. */
#define HAVE_SYS_FILE_H 1
/* Define if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define if you have the <time.h> header file. */
#define HAVE_TIME_H 1
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

View File

@ -0,0 +1,5 @@
#
# $Id: Makefile.alpha,v 1.1 1998/03/12 08:00:03 jb Exp $
#
TARGET= ${MACHINE_ARCH}-unknown-freebsdelf

View File

@ -1,5 +1,5 @@
#
# $Id: Makefile,v 1.2 1998/03/12 02:55:32 jdp Exp $
# $Id: Makefile,v 1.3 1998/03/12 05:14:19 jdp Exp $
#
.include "../Makefile.inc0"
@ -8,7 +8,7 @@
LIB= opcodes
SRCS+= dis-buf.c disassemble.c
CFLAGS+= -I${SRCDIR}/opcodes
CFLAGS+= -I${SRCDIR}/opcodes -I${SRCDIR}/bfd
NOPROFILE= true
NOPIC= true
INTERNALLIB= true

View File

@ -0,0 +1,6 @@
#
# $Id: Makefile.i386,v 1.1 1998/03/12 02:55:32 jdp Exp $
#
SRCS+= mips-dis.c
CFLAGS+= -DARCH_mips