--- a/gcc/config/rs6000/vxworks.h
+++ b/gcc/config/rs6000/vxworks.h
@@ -26,21 +26,56 @@ along with GCC; see the file COPYING3.  If not see
 /* CPP predefined macros.  */
 
 #undef TARGET_OS_CPP_BUILTINS
-#define TARGET_OS_CPP_BUILTINS()		\
-  do						\
-    {						\
-      builtin_define ("__ppc");			\
-      builtin_define ("__PPC__");		\
-      builtin_define ("__EABI__");		\
-      builtin_define ("__ELF__");		\
-      if (!TARGET_SOFT_FLOAT)			\
-	builtin_define ("__hardfp");		\
+#define TARGET_OS_CPP_BUILTINS()                \
+  do                                            \
+    {                                           \
+      /* CPU macros.  */			\
+      builtin_define ("__ppc");                 \
+      builtin_define ("__ppc__");               \
+      builtin_define ("__PPC");                 \
+      builtin_define ("__PPC__");               \
+      builtin_define ("__powerpc");             \
+      builtin_define ("__powerpc__");           \
+      if (TARGET_64BIT)                         \
+        {                                       \
+          builtin_define ("__ppc64");           \
+          builtin_define ("__ppc64__");         \
+          builtin_define ("__PPC64");		\
+          builtin_define ("__PPC64__");         \
+          builtin_define ("__powerpc64");	\
+          builtin_define ("__powerpc64__");     \
+	}					\
 						\
-      /* C89 namespace violation! */		\
-      builtin_define ("CPU_FAMILY=PPC");	\
-        					\
-      VXWORKS_OS_CPP_BUILTINS ();		\
-    }		\
+      /* Asserts for #cpu and #machine.  */	\
+      if (TARGET_64BIT)                         \
+	{					\
+          builtin_assert ("cpu=powerpc64");     \
+          builtin_assert ("machine=powerpc64"); \
+        }                                       \
+      else 					\
+	{					\
+          builtin_assert ("cpu=powerpc");	\
+          builtin_assert ("machine=powerpc");   \
+	}					\
+						\
+      /* PowerPC VxWorks specificities.  */	\
+      if (!TARGET_SOFT_FLOAT)                   \
+        {                                       \
+          builtin_define ("__hardfp");          \
+          builtin_define ("_WRS_HARDWARE_FP");  \
+        }                                       \
+						\
+      if (!TARGET_VXWORKS7)			\
+	{					\
+          builtin_define ("__EABI__");          \
+	  builtin_define ("__ELF__");           \
+          builtin_define ("CPU_FAMILY=PPC");	\
+	}					\
+						\
+      /* Common VxWorks and port items.  */	\
+      VXWORKS_OS_CPP_BUILTINS ();               \
+      TARGET_OS_SYSV_CPP_BUILTINS ();           \
+    }                                           \
   while (0)
 
 /* vx6 library path.  */
-- 
2.17.1

