Skip to content

Instantly share code, notes, and snippets.

@jpf91
Created January 21, 2013 15:12
Show Gist options
  • Select an option

  • Save jpf91/4586733 to your computer and use it in GitHub Desktop.

Select an option

Save jpf91/4586733 to your computer and use it in GitHub Desktop.
diff -ur config.orig/arm/arm.h config/arm/arm.h
--- config.orig/arm/arm.h 2013-01-20 14:48:46.355048483 +0100
+++ config/arm/arm.h 2013-01-20 17:00:20.998917173 +0100
@@ -109,6 +109,28 @@
builtin_define ("__ARM_ARCH_EXT_IDIV__"); \
} while (0)
+/* Target CPU builtins for D. */
+#define TARGET_CPU_D_BUILTINS() \
+ do \
+ { \
+ builtin_define ("ARM"); \
+ if (TARGET_THUMB) \
+ builtin_define ("ARM_Thumb"); \
+ \
+ if (TARGET_AAPCS_BASED) \
+ { \
+ if (arm_pcs_default == ARM_PCS_AAPCS_VFP) \
+ builtin_define ("ARM_HardFP"); \
+ else if (arm_pcs_default == ARM_PCS_AAPCS) \
+ { \
+ if(TARGET_SOFT_FLOAT) \
+ builtin_define ("ARM_Soft"); \
+ else \
+ builtin_define ("ARM_SoftFP"); \
+ } \
+ } \
+ } while (0)
+
#include "config/arm/arm-opts.h"
enum target_cpus
diff -ur config.orig/arm/linux-eabi.h config/arm/linux-eabi.h
--- config.orig/arm/linux-eabi.h 2013-01-20 14:48:46.352048430 +0100
+++ config/arm/linux-eabi.h 2013-01-20 15:06:26.157983038 +0100
@@ -31,6 +31,15 @@
} \
while (false)
+#undef TARGET_OS_D_BUILTINS
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ GNU_USER_TARGET_OS_D_BUILTINS(); \
+ ANDROID_TARGET_OS_D_BUILTINS(); \
+ } \
+ while (false)
+
/* We default to a soft-float ABI so that binaries can run on all
target hardware. */
#undef TARGET_DEFAULT_FLOAT_ABI
diff -ur config.orig/arm/linux-elf.h config/arm/linux-elf.h
--- config.orig/arm/linux-elf.h 2013-01-20 14:48:46.355048483 +0100
+++ config/arm/linux-elf.h 2013-01-20 15:09:00.563748855 +0100
@@ -81,6 +81,13 @@
} \
while (0)
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ GNU_USER_TARGET_OS_D_BUILTINS(); \
+ } \
+ while (0)
+
/* This is how we tell the assembler that two symbols have the same value. */
#define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
do \
diff -ur config.orig/arm/netbsd-elf.h config/arm/netbsd-elf.h
--- config.orig/arm/netbsd-elf.h 2013-01-20 14:48:46.352048430 +0100
+++ config/arm/netbsd-elf.h 2013-01-20 15:09:47.090567341 +0100
@@ -46,6 +46,13 @@
} \
while (0)
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ NETBSD_OS_D_BUILTINS_ELF(); \
+ } \
+ while (0)
+
#undef SUBTARGET_CPP_SPEC
#define SUBTARGET_CPP_SPEC NETBSD_CPP_SPEC
diff -ur config.orig/arm/uclinux-eabi.h config/arm/uclinux-eabi.h
--- config.orig/arm/uclinux-eabi.h 2013-01-20 14:48:46.353048448 +0100
+++ config/arm/uclinux-eabi.h 2013-01-20 15:13:55.550872198 +0100
@@ -41,6 +41,15 @@
} \
while (false)
+#undef TARGET_OS_D_BUILTINS
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ builtin_define ("linux"); \
+ builtin_define ("Posix"); \
+ } \
+ while (false)
+
#undef SUBTARGET_EXTRA_LINK_SPEC
#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi -elf2flt" \
" --pic-veneer --target2=abs"
diff -ur config.orig/arm/uclinux-elf.h config/arm/uclinux-elf.h
--- config.orig/arm/uclinux-elf.h 2013-01-20 14:48:46.354048465 +0100
+++ config/arm/uclinux-elf.h 2013-01-20 15:14:49.922805980 +0100
@@ -44,6 +44,15 @@
} \
while (false)
+#undef TARGET_OS_D_BUILTINS
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ builtin_define ("linux"); \
+ builtin_define ("Posix"); \
+ } \
+ while (false)
+
/* Do not assume anything about header files. */
#define NO_IMPLICIT_EXTERN_C
diff -ur config.orig/gnu.h config/gnu.h
--- config.orig/gnu.h 2013-01-20 14:48:46.375048836 +0100
+++ config/gnu.h 2013-01-20 14:58:07.295536550 +0100
@@ -40,3 +40,10 @@
builtin_assert ("system=unix"); \
builtin_assert ("system=posix"); \
} while (0)
+
+#undef GNU_USER_TARGET_OS_D_BUILTINS
+#define GNU_USER_TARGET_OS_D_BUILTINS() \
+ do { \
+ builtin_define ("Hurd"); \
+ builtin_define ("Posix"); \
+ } while (0)
diff -ur config.orig/i386/crtdll.h config/i386/crtdll.h
--- config.orig/i386/crtdll.h 2013-01-20 14:48:46.342048253 +0100
+++ config/i386/crtdll.h 2013-01-20 17:18:30.166126529 +0100
@@ -31,6 +31,16 @@
} \
while (0)
+#undef EXTRA_OS_D_BUILTINS
+#define EXTRA_OS_D_BUILTINS() \
+ do \
+ { \
+ builtin_define ("MinGW"); \
+ builtin_define ("Windows"); \
+ builtin_define ("Win32"); \
+ } \
+ while (0)
+
#undef LIBGCC_SPEC
#define LIBGCC_SPEC \
"%{mthreads:-lmingwthrd} -lmingw32 -lgcc -lcoldname -libmingwex -lcrtdll"
diff -ur config.orig/i386/cygming.h config/i386/cygming.h
--- config.orig/i386/cygming.h 2013-01-20 14:48:46.340048219 +0100
+++ config/i386/cygming.h 2013-01-20 17:10:54.977412893 +0100
@@ -145,6 +145,13 @@
} \
while (0)
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ EXTRA_OS_D_BUILTINS (); \
+ } \
+ while (0)
+
/* Get tree.c to declare a target-specific specialization of
merge_decl_attributes. */
#define TARGET_DLLIMPORT_DECL_ATTRIBUTES 1
diff -ur config.orig/i386/cygwin.h config/i386/cygwin.h
--- config.orig/i386/cygwin.h 2013-01-20 14:48:46.339048201 +0100
+++ config/i386/cygwin.h 2013-01-20 17:20:45.218412879 +0100
@@ -20,6 +20,17 @@
<http://www.gnu.org/licenses/>. */
#define EXTRA_OS_CPP_BUILTINS() /* Nothing. */
+#define EXTRA_OS_D_BUILTINS() \
+ do \
+ { \
+ builtin_define ("Cygwin"); \
+ builtin_define ("Windows"); \
+ if (TARGET_64BIT) \
+ builtin_define ("Win64"); \
+ else \
+ builtin_define ("Win32"); \
+ } \
+ while (0)
#undef CPP_SPEC
#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
diff -ur config.orig/i386/darwin.h config/i386/darwin.h
--- config.orig/i386/darwin.h 2013-01-20 14:48:46.338048183 +0100
+++ config/i386/darwin.h 2013-01-20 17:25:42.726543799 +0100
@@ -52,6 +52,14 @@
} \
while (0)
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ builtin_define ("darwin"); \
+ builtin_define ("OSX"); \
+ } \
+ while (0)
+
#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
diff -ur config.orig/i386/gnu-user64.h config/i386/gnu-user64.h
--- config.orig/i386/gnu-user64.h 2013-01-20 14:48:46.340048219 +0100
+++ config/i386/gnu-user64.h 2013-01-20 17:28:51.025764774 +0100
@@ -31,6 +31,13 @@
} \
while (0)
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ GNU_USER_TARGET_OS_D_BUILTINS(); \
+ } \
+ while (0)
+
#undef CPP_SPEC
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
diff -ur config.orig/i386/gnu-user.h config/i386/gnu-user.h
--- config.orig/i386/gnu-user.h 2013-01-20 14:48:46.343048270 +0100
+++ config/i386/gnu-user.h 2013-01-20 17:29:01.291941887 +0100
@@ -74,6 +74,13 @@
} \
while (0)
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ GNU_USER_TARGET_OS_D_BUILTINS(); \
+ } \
+ while (0)
+
#undef CPP_SPEC
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
diff -ur config.orig/i386/i386.h config/i386/i386.h
--- config.orig/i386/i386.h 2013-01-20 14:48:46.343048270 +0100
+++ config/i386/i386.h 2013-01-20 17:36:08.330968554 +0100
@@ -572,6 +572,14 @@
/* Target CPU builtins. */
#define TARGET_CPU_CPP_BUILTINS() ix86_target_macros ()
+#define TARGET_CPU_D_BUILTINS() \
+ do { \
+ if (TARGET_64BIT) \
+ builtin_define("X86_64"); \
+ else \
+ builtin_define("X86"); \
+ } while (0)
+
/* Target Pragmas. */
#define REGISTER_TARGET_PRAGMAS() ix86_register_pragmas ()
diff -ur config.orig/i386/mingw32.h config/i386/mingw32.h
--- config.orig/i386/mingw32.h 2013-01-20 14:48:46.340048219 +0100
+++ config/i386/mingw32.h 2013-01-20 17:15:48.402382829 +0100
@@ -54,6 +54,20 @@
} \
while (0)
+/* See i386/crtdll.h for an alternative definition. _INTEGRAL_MAX_BITS
+ is for compatibility with native compiler. */
+#define EXTRA_OS_D_BUILTINS() \
+ do \
+ { \
+ builtin_define ("MinGW"); \
+ builtin_define ("Windows"); \
+ if (TARGET_64BIT) \
+ builtin_define ("Win64"); \
+ else \
+ builtin_define ("Win32"); \
+ } \
+ while (0)
+
#ifndef TARGET_USE_PTHREAD_BY_DEFAULT
#define SPEC_PTHREAD1 "pthread"
#define SPEC_PTHREAD2 "!no-pthread"
diff -ur config.orig/i386/netbsd64.h config/i386/netbsd64.h
--- config.orig/i386/netbsd64.h 2013-01-20 14:48:46.337048166 +0100
+++ config/i386/netbsd64.h 2013-01-20 17:33:44.962552889 +0100
@@ -26,6 +26,12 @@
} \
while (0)
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ NETBSD_OS_D_BUILTINS_ELF(); \
+ } \
+ while (0)
/* Extra specs needed for NetBSD/x86-64 ELF. */
diff -ur config.orig/i386/netbsd-elf.h config/i386/netbsd-elf.h
--- config.orig/i386/netbsd-elf.h 2013-01-20 14:48:46.339048201 +0100
+++ config/i386/netbsd-elf.h 2013-01-20 17:33:08.492949711 +0100
@@ -26,6 +26,12 @@
} \
while (0)
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ NETBSD_OS_D_BUILTINS_ELF(); \
+ } \
+ while (0)
/* Extra specs needed for NetBSD/i386 ELF. */
diff -ur config.orig/i386/openbsdelf.h config/i386/openbsdelf.h
--- config.orig/i386/openbsdelf.h 2013-01-20 14:48:46.339048201 +0100
+++ config/i386/openbsdelf.h 2013-01-20 17:32:31.869353600 +0100
@@ -43,6 +43,13 @@
} \
while (0)
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ OPENBSD_OS_D_BUILTINS(); \
+ } \
+ while (0)
+
/* As an elf system, we need crtbegin/crtend stuff. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "\
diff -ur config.orig/i386/openbsd.h config/i386/openbsd.h
--- config.orig/i386/openbsd.h 2013-01-20 14:48:46.340048219 +0100
+++ config/i386/openbsd.h 2013-01-20 17:31:57.961817719 +0100
@@ -35,6 +35,14 @@
} \
while (0)
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ builtin_define ("OpenBSD"); \
+ builtin_define ("Posix"); \
+ } \
+ while (0)
+
/* Layout of source language data types. */
/* This must agree with <machine/ansi.h> */
diff -ur config.orig/kfreebsd-gnu.h config/kfreebsd-gnu.h
--- config.orig/kfreebsd-gnu.h 2013-01-20 14:48:46.343048270 +0100
+++ config/kfreebsd-gnu.h 2013-01-20 15:02:57.600465587 +0100
@@ -30,6 +30,14 @@
} \
while (0)
+#define GNU_USER_TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ builtin_define ("FreeBSD"); \
+ builtin_define ("Posix"); \
+ } \
+ while (0)
+
#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
#define GNU_USER_DYNAMIC_LINKER32 GLIBC_DYNAMIC_LINKER32
#define GNU_USER_DYNAMIC_LINKER64 GLIBC_DYNAMIC_LINKER64
diff -ur config.orig/knetbsd-gnu.h config/knetbsd-gnu.h
--- config.orig/knetbsd-gnu.h 2013-01-20 14:48:46.332048077 +0100
+++ config/knetbsd-gnu.h 2013-01-20 15:01:44.403223608 +0100
@@ -31,6 +31,14 @@
} \
while (0)
+#undef GNU_USER_TARGET_OS_D_BUILTINS
+#define GNU_USER_TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ builtin_define ("NetBSD"); \
+ builtin_define ("Posix"); \
+ } \
+ while (0)
#undef GNU_USER_DYNAMIC_LINKER
#define GNU_USER_DYNAMIC_LINKER "/lib/ld.so.1"
diff -ur config.orig/linux-android.h config/linux-android.h
--- config.orig/linux-android.h 2013-01-20 14:48:46.357048518 +0100
+++ config/linux-android.h 2013-01-20 14:49:40.260961602 +0100
@@ -26,6 +26,12 @@
builtin_define ("__ANDROID__"); \
} while (0)
+#define ANDROID_TARGET_OS_D_BUILTINS() \
+ do { \
+ if (OPTION_ANDROID) \
+ builtin_define ("ANDROID"); \
+ } while (0)
+
#if ANDROID_DEFAULT
# define NOANDROID "mno-android"
#else
diff -ur config.orig/linux.h config/linux.h
--- config.orig/linux.h 2013-01-20 14:48:46.405049358 +0100
+++ config/linux.h 2013-01-20 14:56:59.079382675 +0100
@@ -50,6 +50,12 @@
builtin_assert ("system=posix"); \
} while (0)
+#define GNU_USER_TARGET_OS_D_BUILTINS() \
+ do { \
+ builtin_define ("linux"); \
+ builtin_define ("Posix");
+ } while (0)
+
/* Determine which dynamic linker to use depending on whether GLIBC or
uClibc or Bionic is the default C library and whether
-muclibc or -mglibc or -mbionic has been passed to change the default. */
diff -ur config.orig/mips/gnu-user.h config/mips/gnu-user.h
--- config.orig/mips/gnu-user.h 2013-01-20 14:48:46.359048553 +0100
+++ config/mips/gnu-user.h 2013-01-20 17:51:54.010058363 +0100
@@ -39,6 +39,11 @@
builtin_define ("_GNU_SOURCE"); \
} while (0)
+#define TARGET_OS_D_BUILTINS() \
+ do { \
+ GNU_USER_TARGET_OS_D_BUILTINS(); \
+ } while (0)
+
#undef SUBTARGET_CPP_SPEC
#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
diff -ur config.orig/mips/mips.h config/mips/mips.h
--- config.orig/mips/mips.h 2013-01-20 14:48:46.360048572 +0100
+++ config/mips/mips.h 2013-01-20 17:47:41.080769855 +0100
@@ -561,6 +561,50 @@
} \
while (0)
+#define TARGET_CPU_D_BUILTINS() \
+ do \
+ { \
+ builtin_define("MIPS"); \
+ if (TARGET_64BIT) \
+ builtin_define("MIPS64"); \
+ else \
+ builtin_define("MIPS32"); \
+ \
+ switch (mips_abi) \
+ { \
+ case ABI_32: \
+ builtin_define("MIPS_O32"); \
+ break; \
+ \
+ case ABI_O64: \
+ builtin_define("MIPS_O64"); \
+ break; \
+ \
+ case ABI_N32: \
+ builtin_define("MIPS_N32"); \
+ break; \
+ \
+ case ABI_64: \
+ builtin_define("MIPS_N64"); \
+ break; \
+ \
+ case ABI_EABI: \
+ builtin_define("MIPS_EABI"); \
+ break; \
+ \
+ default: \
+ gcc_unreachable(); \
+ } \
+ \
+ if (TARGET_NO_FLOAT) \
+ builtin_define("MIPS_NoFloat"); \
+ else if (TARGET_HARD_FLOAT_ABI) \
+ builtin_define("MIPS_HardFloat"); \
+ else \
+ builtin_define("MIPS_SoftFloat"); \
+ } \
+ while (0) \
+
/* Default target_flags if no switches are specified */
#ifndef TARGET_DEFAULT
diff -ur config.orig/mips/netbsd.h config/mips/netbsd.h
--- config.orig/mips/netbsd.h 2013-01-20 14:48:46.359048553 +0100
+++ config/mips/netbsd.h 2013-01-20 17:51:28.786629799 +0100
@@ -44,6 +44,13 @@
} \
while (0)
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ NETBSD_OS_D_BUILTINS_ELF(); \
+ } \
+ while (0)
+
/* The generic MIPS TARGET_CPU_CPP_BUILTINS are incorrect for NetBSD.
Specifically, they define too many namespace-invasive macros. Override
them here. Note this is structured for easy comparison to the version
diff -ur config.orig/mips/openbsd.h config/mips/openbsd.h
--- config.orig/mips/openbsd.h 2013-01-20 14:48:46.358048535 +0100
+++ config/mips/openbsd.h 2013-01-20 17:52:38.688815296 +0100
@@ -52,6 +52,12 @@
builtin_assert ("system=OpenBSD"); \
} while (0)
+#define TARGET_OS_D_BUILTINS() \
+ do { \
+ builtin_define ("OpenBSD"); \
+ builtin_define ("Posix"); \
+} while (0)
+
/* Layout of source language data types. */
/* This must agree with <machine/ansi.h>. */
diff -ur config.orig/netbsd-elf.h config/netbsd-elf.h
--- config.orig/netbsd-elf.h 2013-01-20 14:48:46.349048377 +0100
+++ config/netbsd-elf.h 2013-01-20 15:10:34.115389366 +0100
@@ -26,6 +26,13 @@
} \
while (0)
+#define NETBSD_OS_D_BUILTINS_ELF() \
+ do \
+ { \
+ NETBSD_OS_D_BUILTINS_COMMON(); \
+ } \
+ while (0)
+
/* Provide a STARTFILE_SPEC appropriate for NetBSD ELF. Here we
provide support for the special GCC option -static. On ELF
targets, we also add the crtbegin.o file, which provides part
diff -ur config.orig/netbsd.h config/netbsd.h
--- config.orig/netbsd.h 2013-01-20 14:48:46.373048799 +0100
+++ config/netbsd.h 2013-01-20 15:11:19.707183349 +0100
@@ -30,6 +30,14 @@
} \
while (0)
+#define NETBSD_OS_D_BUILTINS_COMMON() \
+ do \
+ { \
+ builtin_define ("NetBSD"); \
+ builtin_define ("Posix"); \
+ } \
+ while (0)
+
/* CPP_SPEC parts common to all NetBSD targets. */
#define NETBSD_CPP_SPEC \
"%{posix:-D_POSIX_SOURCE} \
diff -ur config.orig/rs6000/aix43.h config/rs6000/aix43.h
--- config.orig/rs6000/aix43.h 2013-01-20 14:48:46.367048694 +0100
+++ config/rs6000/aix43.h 2013-01-20 19:37:25.233489053 +0100
@@ -94,6 +94,14 @@
} \
while (0)
+#undef TARGET_OS_D_BUILTINS
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ TARGET_OS_AIX_D_BUILTINS (); \
+ } \
+ while (0)
+
#undef CPP_SPEC
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE}\
%{ansi: -D_ANSI_C_SOURCE}\
diff -ur config.orig/rs6000/aix51.h config/rs6000/aix51.h
--- config.orig/rs6000/aix51.h 2013-01-20 14:48:46.370048747 +0100
+++ config/rs6000/aix51.h 2013-01-20 19:37:12.340286111 +0100
@@ -91,6 +91,15 @@
} \
while (0)
+
+#undef TARGET_OS_D_BUILTINS
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ TARGET_OS_AIX_D_BUILTINS (); \
+ } \
+ while (0)
+
#undef CPP_SPEC
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
%{ansi: -D_ANSI_C_SOURCE} \
diff -ur config.orig/rs6000/aix52.h config/rs6000/aix52.h
--- config.orig/rs6000/aix52.h 2013-01-20 14:48:46.365048659 +0100
+++ config/rs6000/aix52.h 2013-01-20 19:36:58.373064921 +0100
@@ -89,6 +89,14 @@
} \
while (0)
+#undef TARGET_OS_D_BUILTINS
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ TARGET_OS_AIX_D_BUILTINS (); \
+ } \
+ while (0)
+
#undef CPP_SPEC
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
%{ansi: -D_ANSI_C_SOURCE} \
diff -ur config.orig/rs6000/aix53.h config/rs6000/aix53.h
--- config.orig/rs6000/aix53.h 2013-01-20 14:48:46.365048659 +0100
+++ config/rs6000/aix53.h 2013-01-20 19:37:34.976642474 +0100
@@ -95,6 +95,14 @@
} \
while (0)
+#undef TARGET_OS_D_BUILTINS
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ TARGET_OS_AIX_D_BUILTINS (); \
+ } \
+ while (0)
+
#undef CPP_SPEC
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
%{ansi: -D_ANSI_C_SOURCE} \
diff -ur config.orig/rs6000/aix61.h config/rs6000/aix61.h
--- config.orig/rs6000/aix61.h 2013-01-20 14:48:46.367048694 +0100
+++ config/rs6000/aix61.h 2013-01-20 19:37:47.660851258 +0100
@@ -96,6 +96,14 @@
} \
while (0)
+#undef TARGET_OS_D_BUILTINS
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ TARGET_OS_AIX_D_BUILTINS (); \
+ } \
+ while (0)
+
#undef CPP_SPEC
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
%{ansi: -D_ANSI_C_SOURCE} \
diff -ur config.orig/rs6000/aix.h config/rs6000/aix.h
--- config.orig/rs6000/aix.h 2013-01-20 14:48:46.369048730 +0100
+++ config/rs6000/aix.h 2013-01-20 19:38:59.208116229 +0100
@@ -111,6 +111,14 @@
} \
while (0)
+#define TARGET_OS_AIX_D_BUILTINS() \
+ do \
+ { \
+ builtin_define ("AIX"); \
+ builtin_define ("Posix"); \
+ } \
+ while (0)
+
/* Define appropriate architecture macros for preprocessor depending on
target switches. */
diff -ur config.orig/rs6000/darwin.h config/rs6000/darwin.h
--- config.orig/rs6000/darwin.h 2013-01-20 14:48:46.365048659 +0100
+++ config/rs6000/darwin.h 2013-01-20 19:41:11.881340750 +0100
@@ -62,6 +62,14 @@
} \
while (0)
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ builtin_define ("darwin"); \
+ builtin_define ("OSX"); \
+ } \
+ while (0)
+
/* Generate branch islands stubs if this is true. */
extern int darwin_emit_branch_islands;
diff -ur config.orig/rs6000/linux64.h config/rs6000/linux64.h
--- config.orig/rs6000/linux64.h 2013-01-20 14:48:46.368048712 +0100
+++ config/rs6000/linux64.h 2013-01-20 19:48:05.337348639 +0100
@@ -331,6 +331,19 @@
} \
while (0)
+#undef TARGET_OS_D_BUILTINS
+#define TARGET_OS_DBUILTINS() \
+ do \
+ { \
+ if (TARGET_64BIT) \
+ { \
+ } \
+ else \
+ { \
+ } \
+ } \
+ while (0)
+
#undef CPP_OS_DEFAULT_SPEC
#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
diff -ur config.orig/rs6000/linux.h config/rs6000/linux.h
--- config.orig/rs6000/linux.h 2013-01-20 14:48:46.370048747 +0100
+++ config/rs6000/linux.h 2013-01-20 19:48:29.630736270 +0100
@@ -53,6 +53,13 @@
} \
while (0)
+#undef TARGET_OS_D_BUILTINS
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ } \
+ while (0)
+
#undef CPP_OS_DEFAULT_SPEC
#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
diff -ur config.orig/rs6000/netbsd.h config/rs6000/netbsd.h
--- config.orig/rs6000/netbsd.h 2013-01-20 14:48:46.369048730 +0100
+++ config/rs6000/netbsd.h 2013-01-20 19:49:19.658538351 +0100
@@ -30,6 +30,14 @@
} \
while (0)
+#undef TARGET_OS_D_BUILTINS /* FIXME: sysv4.h should not define this! */
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ NETBSD_OS_D_BUILTINS_ELF(); \
+ } \
+ while (0)
+
/* Override the default from rs6000.h to avoid conflicts with macros
defined in NetBSD header files. */
diff -ur config.orig/rs6000/rs6000.h config/rs6000/rs6000.h
--- config.orig/rs6000/rs6000.h 2013-01-20 14:48:46.368048712 +0100
+++ config/rs6000/rs6000.h 2013-01-20 19:28:08.265522833 +0100
@@ -560,6 +560,26 @@
#define TARGET_CPU_CPP_BUILTINS() \
rs6000_cpu_cpp_builtins (pfile)
+#define TARGET_CPU_CPP_BUILTINS() \
+ do \
+ { \
+ if (BYTES_BIG_ENDIAN) \
+ builtin_define ("BigEndian"); \
+ else \
+ builtin_define ("LittleEndian"); \
+ \
+ if ((target_flags & MASK_POWERPC) != 0) \
+ builtin_define ("PPC"); \
+ else if((flags & MASK_POWERPC64) != 0) \
+ builtin_define ("PPC64"); \
+ \
+ if(TARGET_HARD_FLOAT) \
+ builtin_define ("PPC_HardFP"); \
+ else \
+ builtin_define ("PPC_SoftFP"); \
+ } \
+ while (0)
+
/* This is used by rs6000_cpu_cpp_builtins to indicate the byte order
we're compiling for. Some configurations may need to override it. */
#define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
diff -ur config.orig/rs6000/sysv4.h config/rs6000/sysv4.h
--- config.orig/rs6000/sysv4.h 2013-01-20 14:48:46.368048712 +0100
+++ config/rs6000/sysv4.h 2013-01-20 19:45:14.264620695 +0100
@@ -538,6 +538,16 @@
while (0)
#endif
+#ifndef TARGET_OS_D_BUILTINS
+#define TARGET_OS_D_BUILTINS() \
+ do \
+ { \
+ builtin_define ("SysV4"); \
+ builtin_define ("Posix"); \
+ } \
+ while (0)
+#endif
+
#undef ASM_SPEC
#define ASM_SPEC "%(asm_cpu) \
%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment