From cd730b38ff3ce72715f41065968193ab1c3e6dd9 Mon Sep 17 00:00:00 2001 From: martin Date: Sat, 5 Jul 2014 09:03:49 +0000 Subject: Make types (size_t and ptrdiff_t), predefines and link specs the same as the in-tree compiler. --- cross/gcc-mips-current/Makefile | 4 +- cross/gcc-mips-current/distinfo | 3 +- .../patches/patch-gcc_config_mips_netbsd.h | 126 +++++++++++++++++++++ 3 files changed, 130 insertions(+), 3 deletions(-) create mode 100644 cross/gcc-mips-current/patches/patch-gcc_config_mips_netbsd.h (limited to 'cross/gcc-mips-current') diff --git a/cross/gcc-mips-current/Makefile b/cross/gcc-mips-current/Makefile index 8b86d488e63..1c6b192ed39 100644 --- a/cross/gcc-mips-current/Makefile +++ b/cross/gcc-mips-current/Makefile @@ -1,11 +1,11 @@ -# $NetBSD: Makefile,v 1.5 2014/07/02 13:20:51 martin Exp $ +# $NetBSD: Makefile,v 1.6 2014/07/05 09:03:49 martin Exp $ GCC_DIST_VERSION=4.9.0 GCC_PKGNAME= gcc-mips-${GCC_DIST_VERSION} DISTNAME= gcc-${GCC_DIST_VERSION} PKGNAME= ${GCC_PKGNAME} -PKGREVISION= 4 +PKGREVISION= 5 CATEGORIES= cross lang MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_DIST_VERSION}/} EXTRACT_SUFX= .tar.bz2 diff --git a/cross/gcc-mips-current/distinfo b/cross/gcc-mips-current/distinfo index 672e14bb610..579cff93657 100644 --- a/cross/gcc-mips-current/distinfo +++ b/cross/gcc-mips-current/distinfo @@ -1,10 +1,11 @@ -$NetBSD: distinfo,v 1.3 2014/07/02 12:53:35 martin Exp $ +$NetBSD: distinfo,v 1.4 2014/07/05 09:03:49 martin Exp $ SHA1 (gcc-4.9.0.tar.bz2) = fbde8eb49f2b9e6961a870887cf7337d31cd4917 RMD160 (gcc-4.9.0.tar.bz2) = ac561660744127fa009ae75202d1ac81ac8d7668 Size (gcc-4.9.0.tar.bz2) = 89677407 bytes SHA1 (patch-gcc_config.host) = 1b1e11cd199eb93f49443d51c0063b09b7327858 SHA1 (patch-gcc_config_host-netbsd.c) = 8f13b09dd7006d456cd1c66e895be504e9537880 +SHA1 (patch-gcc_config_mips_netbsd.h) = 094c373421eca14076e55df65aed66e722582ddd SHA1 (patch-gcc_config_x-netbsd) = 6dc3d78e26df62054ea29f98ca51592858e671e3 SHA1 (patch-gcc_system.h) = 4c959a6b1c4d524cbdf44cfb80f0e5758ec20783 SHA1 (patch-libgcc_config.host) = 353f4d17581d619bb4fd55ad27ab4576f28023b7 diff --git a/cross/gcc-mips-current/patches/patch-gcc_config_mips_netbsd.h b/cross/gcc-mips-current/patches/patch-gcc_config_mips_netbsd.h new file mode 100644 index 00000000000..521832f4698 --- /dev/null +++ b/cross/gcc-mips-current/patches/patch-gcc_config_mips_netbsd.h @@ -0,0 +1,126 @@ +$NetBSD: patch-gcc_config_mips_netbsd.h,v 1.3 2014/07/05 09:03:49 martin Exp $ + +Use same types, pre-defines and link specs as the in-tree compiler. + +--- gcc/config/mips/netbsd.h.orig 2014-04-01 12:40:57.000000000 +0200 ++++ gcc/config/mips/netbsd.h 2014-07-05 10:37:40.000000000 +0200 +@@ -32,18 +32,63 @@ + if (TARGET_ABICALLS) \ + builtin_define ("__ABICALLS__"); \ + \ +- if (mips_abi == ABI_32) \ +- builtin_define ("__mips_o32"); \ +- else if (mips_abi == ABI_EABI) \ +- builtin_define ("__mips_eabi"); \ +- else if (mips_abi == ABI_N32) \ ++ /* The GNU C++ standard library requires this. */ \ ++ if (c_dialect_cxx ()) \ ++ builtin_define ("_GNU_SOURCE"); \ ++ \ ++ if (mips_abi == ABI_N32) \ ++ { \ + builtin_define ("__mips_n32"); \ ++ builtin_define ("_ABIN32=2"); \ ++ builtin_define ("_MIPS_SIM=_ABIN32"); \ ++ builtin_define ("_MIPS_SZLONG=32"); \ ++ builtin_define ("_MIPS_SZPTR=32"); \ ++ } \ + else if (mips_abi == ABI_64) \ ++ { \ + builtin_define ("__mips_n64"); \ ++ builtin_define ("_ABI64=3"); \ ++ builtin_define ("_MIPS_SIM=_ABI64"); \ ++ builtin_define ("_MIPS_SZLONG=64"); \ ++ builtin_define ("_MIPS_SZPTR=64"); \ ++ } \ + else if (mips_abi == ABI_O64) \ ++ { \ + builtin_define ("__mips_o64"); \ ++ builtin_define ("_ABIO64=4"); \ ++ builtin_define ("_MIPS_SIM=_ABIO64"); \ ++ builtin_define ("_MIPS_SZLONG=64"); \ ++ builtin_define ("_MIPS_SZPTR=64"); \ + } \ +- while (0) ++ else if (mips_abi == ABI_EABI) \ ++ { \ ++ builtin_define ("__mips_eabi"); \ ++ builtin_define ("_ABIEMB=5"); \ ++ builtin_define ("_MIPS_SIM=_ABIEMB"); \ ++ if (TARGET_LONG64) \ ++ builtin_define ("_MIPS_SZLONG=64"); \ ++ else \ ++ builtin_define ("_MIPS_SZLONG=32"); \ ++ if (TARGET_64BIT) \ ++ builtin_define ("_MIPS_SZPTR=64"); \ ++ else \ ++ builtin_define ("_MIPS_SZPTR=32"); \ ++ } \ ++ else \ ++ { \ ++ builtin_define ("__mips_o32"); \ ++ builtin_define ("_ABIO32=1"); \ ++ builtin_define ("_MIPS_SIM=_ABIO32"); \ ++ builtin_define ("_MIPS_SZLONG=32"); \ ++ builtin_define ("_MIPS_SZPTR=32"); \ ++ } \ ++ if (TARGET_FLOAT64) \ ++ builtin_define ("_MIPS_FPSET=32"); \ ++ else \ ++ builtin_define ("_MIPS_FPSET=16"); \ ++ \ ++ builtin_define ("_MIPS_SZINT=32"); \ ++ } while (0) + + /* The generic MIPS TARGET_CPU_CPP_BUILTINS are incorrect for NetBSD. + Specifically, they define too many namespace-invasive macros. Override +@@ -99,6 +144,11 @@ + builtin_define ("__mips=64"); \ + builtin_define ("__mips_isa_rev=1"); \ + } \ ++ else if (ISA_MIPS64R2) \ ++ { \ ++ builtin_define ("__mips=64"); \ ++ builtin_define ("__mips_isa_rev=2"); \ ++ } \ + \ + if (TARGET_HARD_FLOAT) \ + builtin_define ("__mips_hard_float"); \ +@@ -138,10 +188,12 @@ + + #undef LINK_SPEC + #define LINK_SPEC \ +- "%{EL:-m elf32lmip} \ +- %{EB:-m elf32bmip} \ ++ "%{EL:-m elf32ltsmip} \ ++ %{EB:-m elf32btsmip} \ + %(endian_spec) \ +- %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips32r2} %{mips64} \ ++ %{G*} %{mips1} %{mips2} %{mips3} %{mips4} \ ++ %{mips32} %{mips32r2} %{mips64} %{mips64r2} \ ++ %{bestGnum} %{call_shared} %{no_archive} %{exact_version} \ + %(netbsd_link_spec)" + + #define NETBSD_ENTRY_POINT "__start" +@@ -171,6 +223,14 @@ + + /* Make gcc agree with */ + ++#undef SIZE_TYPE ++#define SIZE_TYPE ((POINTER_SIZE == 64 || TARGET_NEWABI) \ ++ ? "long unsigned int" : "unsigned int") ++ ++#undef PTRDIFF_TYPE ++#define PTRDIFF_TYPE ((POINTER_SIZE == 64 || TARGET_NEWABI) \ ++ ? "long int" : "int") ++ + #undef WCHAR_TYPE + #define WCHAR_TYPE "int" + +@@ -179,3 +239,6 @@ + + #undef WINT_TYPE + #define WINT_TYPE "int" ++ ++#undef TARGET_WRITABLE_EH_FRAME ++#define TARGET_WRITABLE_EH_FRAME (flag_pic && TARGET_SHARED) -- cgit v1.2.3