Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[BUILD] : lm32--netbsd cross compilation toolchain now builds using N…

…etBSD build system

You can now compile lm32--netbsd cross compilation toolchain:

$ ./build.sh -U -m lm32 tools
  • Loading branch information...
commit a5153fa93a0cc61ca266f2403d84d2a1223ed72b 1 parent ad16a38
@fallen authored committed
View
1  build.sh
@@ -650,6 +650,7 @@ MACHINE=vax MACHINE_ARCH=vax
MACHINE=x68k MACHINE_ARCH=m68k
MACHINE=zaurus MACHINE_ARCH=arm DEFAULT
MACHINE=zaurus MACHINE_ARCH=earm
+MACHINE=lm32 MACHINE_ARCH=lm32
'
# getarch -- find the default MACHINE_ARCH for a MACHINE,
View
5 external/gpl3/binutils/dist/bfd/config.bfd
@@ -748,6 +748,11 @@ case "${targ}" in
targ_defvec=bfd_elf32_iq2000_vec
;;
+ lm32-*-netbsd*)
+ targ_defvec=bfd_elf32_lm32_netbsd_vec
+ targ_selvecs=bfd_elf32_lm32_vec
+ ;;
+
lm32-*-elf | lm32-*-rtems*)
targ_defvec=bfd_elf32_lm32_vec
targ_selvecs=bfd_elf32_lm32fdpic_vec
View
1  external/gpl3/binutils/dist/bfd/configure
@@ -15229,6 +15229,7 @@ do
bfd_elf32_ip2k_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;;
bfd_elf32_iq2000_vec) tb="$tb elf32-iq2000.lo elf32.lo $elf" ;;
bfd_elf32_lm32_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
+ bfd_elf32_lm32_netbsd_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
bfd_elf32_lm32fdpic_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
View
1  external/gpl3/binutils/dist/bfd/configure.in
@@ -720,6 +720,7 @@ do
bfd_elf32_ip2k_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;;
bfd_elf32_iq2000_vec) tb="$tb elf32-iq2000.lo elf32.lo $elf" ;;
bfd_elf32_lm32_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
+ bfd_elf32_lm32_netbsd_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
bfd_elf32_lm32fdpic_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
View
11 external/gpl3/binutils/dist/bfd/elf32-lm32.c
@@ -2903,3 +2903,14 @@ lm32_elf_fdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
#define bfd_elf32_bfd_copy_private_bfd_data lm32_elf_fdpic_copy_private_bfd_data
#include "elf32-target.h"
+
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM bfd_elf32_lm32_netbsd_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf32-lm32-netbsd"
+#undef ELF_OSABI
+#define ELF_OSABI ELFOSABI_NETBSD
+#undef elf32_bed
+#define elf32_bed elf32_lm32_netbsd_bed
+
+#include "elf32-target.h"
View
2  external/gpl3/binutils/dist/bfd/targets.c
@@ -616,6 +616,7 @@ extern const bfd_target bfd_elf32_ia64_hpux_big_vec;
extern const bfd_target bfd_elf32_ip2k_vec;
extern const bfd_target bfd_elf32_iq2000_vec;
extern const bfd_target bfd_elf32_lm32_vec;
+extern const bfd_target bfd_elf32_lm32_netbsd_vec;
extern const bfd_target bfd_elf32_lm32fdpic_vec;
extern const bfd_target bfd_elf32_little_generic_vec;
extern const bfd_target bfd_elf32_littlearc_vec;
@@ -963,6 +964,7 @@ static const bfd_target * const _bfd_target_vector[] =
&bfd_elf32_ip2k_vec,
&bfd_elf32_iq2000_vec,
&bfd_elf32_lm32_vec,
+ &bfd_elf32_lm32_netbsd_vec,
&bfd_elf32_little_generic_vec,
&bfd_elf32_littlearc_vec,
&bfd_elf32_littlearm_vec,
View
4 external/gpl3/gcc/dist/gcc/config.gcc
@@ -1565,6 +1565,10 @@ iq2000*-*-elf*)
out_file=iq2000/iq2000.c
md_file=iq2000/iq2000.md
;;
+lm32-*-netbsd*)
+ tm_file="dbxelf.h elfos.h netbsd.h netbsd-elf.h lm32/lm32-netbsd.h ${tm_file}"
+ tmake_file="${tmake_file} lm32/t-lm32 lm32/t-fprules-softfp soft-fp/t-softfp"
+ ;;
lm32-*-elf*)
tm_file="dbxelf.h elfos.h ${tm_file}"
tmake_file="${tmake_file} lm32/t-lm32 lm32/t-fprules-softfp soft-fp/t-softfp"
View
117 external/gpl3/gcc/dist/gcc/config/lm32/lm32-netbsd.h
@@ -0,0 +1,117 @@
+/* Definitions for PA_RISC with ELF format
+ Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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 GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ NETBSD_OS_CPP_BUILTINS_ELF(); \
+ } \
+ while (0)
+
+#undef CPP_SPEC
+#define CPP_SPEC NETBSD_CPP_SPEC
+
+#undef ASM_SPEC
+#define ASM_SPEC \
+ "%{v:-V} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
+
+#undef EXTRA_SPECS
+#define EXTRA_SPECS \
+ { "netbsd_entry_point", NETBSD_ENTRY_POINT },
+
+#define NETBSD_ENTRY_POINT "__start"
+
+#undef LINK_SPEC
+#define LINK_SPEC NETBSD_LINK_SPEC_ELF
+
+/* NetBSD profiling functions don't need gcc to allocate counters. */
+#define NO_DEFERRED_PROFILE_COUNTERS 1
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#undef STRING_ASM_OP
+#define STRING_ASM_OP "\t.stringz"
+
+#define TEXT_SECTION_ASM_OP "\t.text"
+#define DATA_SECTION_ASM_OP "\t.data"
+#define BSS_SECTION_ASM_OP "\t.section\t.bss"
+
+/* We want local labels to start with period if made with asm_fprintf. */
+#undef LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX "."
+
+/* Define these to generate the Linux/ELF/SysV style of internal
+ labels all the time - i.e. to be compatible with
+ ASM_GENERATE_INTERNAL_LABEL in <elfos.h>. Compare these with the
+ ones in pa.h and note the lack of dollar signs in these. FIXME:
+ shouldn't we fix pa.h to use ASM_GENERATE_INTERNAL_LABEL instead? */
+
+#undef ASM_OUTPUT_ADDR_VEC_ELT
+#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
+ if (TARGET_BIG_SWITCH) \
+ fprintf (FILE, "\t.word .L%d\n", VALUE); \
+ else \
+ fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
+
+#undef ASM_OUTPUT_ADDR_DIFF_ELT
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
+ if (TARGET_BIG_SWITCH) \
+ fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL); \
+ else \
+ fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
+
+/* Use the default. */
+#undef ASM_OUTPUT_LABEL
+
+/* NOTE: (*targetm.asm_out.internal_label)() is defined for us by elfos.h, and
+ does what we want (i.e. uses colons). It must be compatible with
+ ASM_GENERATE_INTERNAL_LABEL(), so do not define it here. */
+
+/* Use the default. */
+#undef ASM_OUTPUT_INTERNAL_LABEL
+
+/* Use the default. */
+#undef TARGET_ASM_GLOBALIZE_LABEL
+
+/* FIXME: Hacked from the <elfos.h> one so that we avoid multiple
+ labels in a function declaration (since pa.c seems determined to do
+ it differently) */
+
+#undef ASM_DECLARE_FUNCTION_NAME
+#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
+ do \
+ { \
+ ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
+ ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
+ } \
+ while (0)
+
+/* NetBSD always uses gas. */
+#undef TARGET_GAS
+#define TARGET_GAS 1
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "long int"
View
3  share/mk/bsd.endian.mk
@@ -22,7 +22,8 @@ TARGET_ENDIANNESS= 1234
${MACHINE_ARCH} == "powerpc64" || \
${MACHINE_ARCH} == "sparc" || \
${MACHINE_ARCH} == "sparc64" || \
- ${MACHINE_ARCH:C/^.*eb$/eb/} == "eb"
+ ${MACHINE_ARCH:C/^.*eb$/eb/} == "eb" || \
+ ${MACHINE_ARCH} == "lm32"
TARGET_ENDIANNESS= 4321
.endif
View
6 share/mk/bsd.own.mk
@@ -63,7 +63,8 @@ HAVE_GCC?= 45
${MACHINE_ARCH} == "i386" || \
${MACHINE_ARCH} == "powerpc" || \
${MACHINE_CPU} == "sh3" || \
- ${MACHINE_ARCH} == "x86_64"
+ ${MACHINE_ARCH} == "x86_64" || \
+ ${MACHINE_ARCH} == "lm32"
USE_COMPILERCRTSTUFF?= no
.endif
USE_COMPILERCRTSTUFF?= yes
@@ -74,7 +75,8 @@ HAVE_GDB?= 7
(${MACHINE_ARCH} == "hppa") || \
(${MACHINE_ARCH} == "ia64") || \
(${MACHINE_ARCH} == "mipsel") || (${MACHINE_ARCH} == "mipseb") || \
- (${MACHINE_ARCH} == "mips64el") || (${MACHINE_ARCH} == "mips64eb")
+ (${MACHINE_ARCH} == "mips64el") || (${MACHINE_ARCH} == "mips64eb") || \
+ (${MACHINE_ARCH} == "lm32")
HAVE_SSP?= no
.else
HAVE_SSP?= yes
View
75 sys/arch/lm32/include/disklabel.h
@@ -0,0 +1,75 @@
+/* $NetBSD: disklabel.h,v 1.16 2011/08/30 12:39:55 bouyer Exp $ */
+
+/*
+ * Copyright (c) 1994 Christopher G. Demetriou
+ * 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 Christopher G. Demetriou.
+ * 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.
+ */
+
+#ifndef _LM32_DISKLABEL_H_
+#define _LM32_DISKLABEL_H_
+
+#define LABELUSESMBR 1 /* use MBR partitionning */
+#define LABELSECTOR 1 /* sector containing label */
+#define LABELOFFSET 0 /* offset of label in sector */
+#define MAXPARTITIONS 16 /* number of partitions */
+#define OLDMAXPARTITIONS 8 /* number of partitions before 1.6 */
+#define RAW_PART 3 /* raw partition: XX?d (XXX) */
+
+/*
+ * We use the highest bit of the minor number for the partition number.
+ * This maintains backward compatibility with device nodes created before
+ * MAXPARTITIONS was increased.
+ */
+#define __LM32_MAXDISKS ((1 << 20) / MAXPARTITIONS)
+#define DISKUNIT(dev) ((minor(dev) / OLDMAXPARTITIONS) % __LM32_MAXDISKS)
+#define DISKPART(dev) ((minor(dev) % OLDMAXPARTITIONS) + \
+ ((minor(dev) / (__LM32_MAXDISKS * OLDMAXPARTITIONS)) * OLDMAXPARTITIONS))
+#define DISKMINOR(unit, part) \
+ (((unit) * OLDMAXPARTITIONS) + ((part) % OLDMAXPARTITIONS) + \
+ ((part) / OLDMAXPARTITIONS) * (__LM32_MAXDISKS * OLDMAXPARTITIONS))
+
+/* Pull in MBR partition definitions. */
+#if HAVE_NBTOOL_CONFIG_H
+#include <nbinclude/sys/bootblock.h>
+#else
+#include <sys/bootblock.h>
+#endif /* HAVE_NBTOOL_CONFIG_H */
+
+#ifndef __ASSEMBLER__
+#if HAVE_NBTOOL_CONFIG_H
+#include <nbinclude/sys/dkbad.h>
+#else
+#include <sys/dkbad.h>
+#endif /* HAVE_NBTOOL_CONFIG_H */
+struct cpu_disklabel {
+#define __HAVE_DISKLABEL_DKBAD
+ struct dkbad bad;
+};
+#endif
+
+#endif /* _LM32_DISKLABEL_H_ */
View
37 sys/arch/lm32/include/elf_machdep.h
@@ -0,0 +1,37 @@
+/* $NetBSD: elf_machdep.h,v 1.10 2009/05/30 05:56:52 skrll Exp $ */
+
+#define ELF32_MACHDEP_ENDIANNESS ELFDATA2MSB
+#define ELF32_MACHDEP_ID_CASES \
+ case EM_LM32: \
+ break;
+
+#define ELF64_MACHDEP_ENDIANNESS XXX /* break compilation */
+#define ELF64_MACHDEP_ID_CASES \
+ /* no 64-bit ELF machine types supported */
+
+#define ELF32_MACHDEP_ID EM_LM32
+
+#define ARCH_ELFSIZE 32 /* MD native binary size */
+
+/* iLM32 relocations */
+#define R_LM32_NONE 0
+#define R_LM32_8 1
+#define R_LM32_16 2
+#define R_LM32_32 3
+#define R_LM32_HI16 4
+#define R_LM32_LO16 5
+#define R_LM32_GPREL16 6
+#define R_LM32_CALL 7
+#define R_LM32_BRANCH 8
+#define R_LM32_GNU_VTINHERIT 9
+#define R_LM32_GNU_VTENTRY 10
+#define R_LM32_16_GOT 11
+#define R_LM32_GOTOFF_HI16 12
+#define R_LM32_GOTOFF_LO16 13
+#define R_LM32_COPY 14
+#define R_LM32_GLOB_DAT 15
+#define R_LM32_JMP_SLOT 16
+#define R_LM32_RELATIVE 17
+
+
+#define R_TYPE(name) __CONCAT(R_LM32_,name)
View
14 tools/headerlist
@@ -1,7 +1,7 @@
-# $NetBSD: headerlist,v 1.6 2011/01/26 01:18:55 pooka Exp $
+# $NetBSD$
#
# do not edit; this file was automatically generated by:
-# NetBSD: mkheaderlist.sh,v 1.1 2007/08/07 12:38:23 yamt Exp
+# NetBSD: mkheaderlist.sh,v 1.2 2011/02/05 13:30:26 yamt Exp
./acorn26/include/disklabel.h
./acorn26/include/elf_machdep.h
@@ -23,7 +23,6 @@
./arm/include/elf_machdep.h
./atari/include/disklabel.h
./atari/include/elf_machdep.h
-./mips/include/elf_machdep.h
./bebox/include/disklabel.h
./bebox/include/elf_machdep.h
./cats/include/disklabel.h
@@ -32,10 +31,10 @@
./cesfic/include/elf_machdep.h
./cobalt/include/disklabel.h
./cobalt/include/elf_machdep.h
-./emips/include/disklabel.h
-./emips/include/elf_machdep.h
./dreamcast/include/disklabel.h
./dreamcast/include/elf_machdep.h
+./emips/include/disklabel.h
+./emips/include/elf_machdep.h
./evbarm/include/disklabel.h
./evbarm/include/elf_machdep.h
./evbmips/include/disklabel.h
@@ -51,8 +50,8 @@
./hp700/include/disklabel.h
./hp700/include/elf_machdep.h
./hpc/stand/hpcboot/arm/elf_machdep.h
-./hpc/stand/hpcboot/sh3/elf_machdep.h
./hpc/stand/hpcboot/mips/elf_machdep.h
+./hpc/stand/hpcboot/sh3/elf_machdep.h
./hpc/stand/include/machine/disklabel.h
./hpc/stand/include/machine/elf_machdep.h
./hpcarm/include/disklabel.h
@@ -75,6 +74,8 @@
./iyonix/include/elf_machdep.h
./landisk/include/disklabel.h
./landisk/include/elf_machdep.h
+./lm32/include/disklabel.h
+./lm32/include/elf_machdep.h
./luna68k/include/disklabel.h
./luna68k/include/elf_machdep.h
./m68k/include/elf_machdep.h
@@ -82,6 +83,7 @@
./mac68k/include/elf_machdep.h
./macppc/include/disklabel.h
./macppc/include/elf_machdep.h
+./mips/include/elf_machdep.h
./mipsco/include/disklabel.h
./mipsco/include/elf_machdep.h
./mmeye/include/disklabel.h
View
0  tools/mkheaderlist.sh 100644 → 100755
File mode changed
View
54 usr.bin/xlint/arch/lm32/targparam.h
@@ -0,0 +1,54 @@
+/* $NetBSD: targparam.h,v 1.4 2012/03/27 19:24:02 christos 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 "schar.h"
+#include "ilp32.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 0
+#define SIZEOF_IS_ULONG 0
+#define INTPTR_IS_LONG 0
+
+#define FLOAT_SIZE (4 * CHAR_BIT)
+#define DOUBLE_SIZE (8 * CHAR_BIT)
+#define LDOUBLE_SIZE (12 * CHAR_BIT)
+
+#define ENUM_SIZE (4 * CHAR_BIT)
Please sign in to comment.
Something went wrong with that request. Please try again.