phunix/external/gpl3/gcc/patches/0001-minix.patch
Lionel Sambuc 0a6a1f1d05 NetBSD re-synchronization of the source tree
This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
2016-01-13 20:32:14 +01:00

113 lines
4.0 KiB
Diff

diff -rNU3 dist.nbsd/gcc/config.gcc dist/gcc/config.gcc
--- dist.nbsd/gcc/config.gcc 2015-10-16 12:40:18.000000000 +0200
+++ dist/gcc/config.gcc 2015-10-16 13:35:51.000000000 +0200
@@ -704,6 +704,12 @@
tmake_file="${tmake_file} t-glibc"
target_has_targetcm=yes
;;
+*-*-minix*)
+ tmake_file="t-slibgcc"
+ gas=yes
+ gnu_ld=yes
+ default_use_cxa_atexit=yes
+ ;;
*-*-netbsd*)
tmake_file="t-slibgcc"
gas=yes
@@ -887,6 +893,34 @@
extra_options="${extra_options} arm/vxworks.opt"
tmake_file="${tmake_file} arm/t-arm arm/t-vxworks"
;;
+arm*-*-minix*)
+ tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf"
+ tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h"
+ extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+
+ tm_file="$tm_file arm/bpabi.h"
+ tmake_file="$tmake_file arm/t-bpabi t-minix"
+
+ # The BPABI long long divmod functions return a 128-bit value in
+ # registers r0-r3. Correctly modeling that requires the use of
+ # TImode.
+ need_64bit_hwint=yes
+ # The EABI requires the use of __cxa_atexit.
+ default_use_cxa_atexit=yes
+
+ case ${target} in
+ arm*-*-minix-*hf*)
+ tm_defines="${tm_defines} TARGET_DEFAULT_FLOAT_ABI=ARM_FLOAT_ABI_HARD"
+ ;;
+ esac
+ case ${target} in
+ armv4*) with_cpu=${with_cpu:-strongarm};;
+ armv6*) with_cpu=${with_cpu:-arm1176jzf-s};;
+ armv7*) with_cpu=${with_cpu:-cortex-a8};;
+ esac
+ tm_file="$tm_file arm/eabi.h newlib-stdint.h minix-spec.h arm/minix.h minix.h"
+ tmake_file="$tmake_file arm/t-arm-softfp soft-fp/t-softfp"
+ ;;
arm*-*-netbsdelf*)
tmake_file="${tmake_file} arm/t-arm"
tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h arm/aout.h arm/arm.h"
@@ -1287,6 +1321,11 @@
x86_64-*-freebsd*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
;;
+i[34567]86-*-minix)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h minix-spec.h i386/minix.h minix.h"
+ tmake_file="${tmake_file} i386/t-crtstuff"
+ extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+ ;;
i[34567]86-*-netbsdelf*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/netbsd-elf.h"
tmake_file="${tmake_file} i386/t-crtstuff"
diff -rNU3 dist.nbsd/gcc/gcov.c dist/gcc/gcov.c
--- dist.nbsd/gcc/gcov.c 2015-10-16 12:40:18.000000000 +0200
+++ dist/gcc/gcov.c 2015-10-16 13:36:18.000000000 +0200
@@ -62,6 +62,10 @@
/* This is the size of the buffer used to read in source file lines. */
+#if defined(__minix)
+#define block_t gcc_block_t
+#endif
+
struct function_info;
struct block_info;
struct source_info;
diff -rNU3 dist.nbsd/gcc/ginclude/stddef.h dist/gcc/ginclude/stddef.h
--- dist.nbsd/gcc/ginclude/stddef.h 2015-10-16 12:40:18.000000000 +0200
+++ dist/gcc/ginclude/stddef.h 2015-10-16 13:35:25.000000000 +0200
@@ -48,7 +48,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__) && (__FreeBSD__ < 5)) || defined(__NetBSD__)
+#if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__) || defined(__minix)
#ifndef inhibit_libc
#include <machine/ansi.h>
#endif
diff -rNU3 dist.nbsd/libgcc/config.host dist/libgcc/config.host
--- dist.nbsd/libgcc/config.host 2015-10-16 12:40:19.000000000 +0200
+++ dist/libgcc/config.host 2015-10-16 13:36:44.000000000 +0200
@@ -325,6 +325,10 @@
tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
extra_parts="$extra_parts crti.o crtn.o"
;;
+arm*-*-minix*)
+ tmake_file="$tmake_file arm/t-arm"
+ unwind_header=config/arm/unwind-arm.h
+ ;;
arm*-*-netbsdelf*)
tmake_file="$tmake_file arm/t-arm"
case ${host} in
@@ -525,6 +529,8 @@
x86_64-*-freebsd*)
tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff"
;;
+i[34567]86-*-minix*)
+ ;;
i[34567]86-*-netbsdelf*)
;;
x86_64-*-netbsd*)