diff mbox

VxWorks Patches Back from the Dead!

Message ID 5042DC25.4060608@verizon.net
State New
Headers show

Commit Message

rbmj Sept. 2, 2012, 4:10 a.m. UTC
Hi all,

I have a new set of patches attached to this email.  I've made a few 
changes since last time, and a full build works (finally, again).

-The ioctl patch removes superfluous parens (thanks Paolo)
-The mkdir patch has a more precise (or uglier, depending on your point 
of view :P) regex, and uses the variadic macro fix (thanks again Paolo)
-It adds another fixincludes patch for vxworks *NOT GCC* regs.h as it 
doesn't include vxTypesOld.h, which it needs
-The patch that adds the AC_ARG_ENABLE option to explicitly 
enable/disable libstdc++-v3 now has the argument changed from 
--disable-libstdc++-v3 to --disable-libstdcxx, as I was having weird 
issues and changing it seemed to work.  If someone who has more 
experience with this than me (so anyone) knows that this should not make 
a difference than feel free to reject this change and I'll fall back to 
the old version.
-The patch to allow machine_name to be skipped and enable fixincludes 
for vxworks is now *much* simpler (thanks Bruce)
-There's a new patch to add NOMINMAX to 
libstdc++-v3/config/os/vxworks/os_defines.h to keep vxworks headers from 
defining min and max as macros.

Note that the open() patch is NOT changed as the suggested change does 
not work when also compiling libstdc++-v3.  Passing the third argument 
explicitly won't break anything - it will just be ignored - and is the 
only resolution that has worked so far.

They're also not in the same order as I was rebasing quite a bit to try 
and keep history in sync.

Also, I'm hoping since this is the third (or fourth for some of these 
patches) time submitting them, hopefully they can eventually make their 
way in :D.  Could someone please volunteer to commit once it is all 
approved?

Thank you all for the work you do on GCC, and the help you've given me 
to get my patches up to the standard!

Robert Mason
From f1132398e72e73c549cb7f608a3a43c0f4801bc3 Mon Sep 17 00:00:00 2001
From: rbmj <rbmj@verizon.net>
Date: Mon, 4 Jun 2012 13:18:10 -0400
Subject: [PATCH 01/12] Added assert fixinclude hack for VxWorks.

VxWorks's assert.h relies on adjacent string tokens being joined,
and uses macros for some of the strings (e.g. __FILE__).  However,
it does not put a space after the end quote and before the macro,
so instead of replacing the macro, gcc >= 4.7.x thinks it's a
user-defined literal token, and since the lookup obviously fails,
compilation of libstdc++ dies.

This patch just replaces the assert.h header with another one that
will work.  It preserves the same format, just changes the spacing.

Proposed by Robert Mason: http://gcc.gnu.org/ml/gcc-patches/2012-06/msg00385.html
Approved by Nathan Sidwell: http://gcc.gnu.org/ml/gcc-patches/2012-06/msg00549.html
Approved by Bruce Korb: http://gcc.gnu.org/ml/gcc-patches/2012-06/msg00552.html

Changes:

[fixincludes]
	inclhack.def (AAB_vxworks_assert): Added fix.
	fixincl.x: Regenerate
---
 fixincludes/inclhack.def |   40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
diff mbox

Patch

diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 82792af..a9d582d 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -354,6 +354,46 @@  fix = {
 	_EndOfHeader_;
 };
 
+/*
+ * Fix assert.h on VxWorks:
+ */
+fix = {
+	hackname	= AAB_vxworks_assert;
+	files		= assert.h;
+	mach		= "*-*-vxworks*";
+	
+	replace		= <<- _EndOfHeader_
+	#ifndef _ASSERT_H
+	#define _ASSERT_H
+
+	#ifdef assert
+	#undef assert
+	#endif
+
+	#if defined(__STDC__) || defined(__cplusplus)
+	extern void __assert (const char*);
+	#else
+	extern void __assert ();
+	#endif
+
+	#ifdef NDEBUG
+	#define assert(ign) ((void)0)
+	#else
+
+	#define ASSERT_STRINGIFY(str) ASSERT_STRINGIFY_HELPER(str)
+	#define ASSERT_STRINGIFY_HELPER(str) #str
+
+	#define assert(test) ((void) \
+		((test) ? ((void)0) : \
+		__assert("Assertion failed: " ASSERT_STRINGIFY(test) ", file " \
+		__FILE__ ", line " ASSERT_STRINGIFY(__LINE__) "\n")))
+
+	#endif
+
+	#endif
+	_EndOfHeader_;
+};
+
 
 /*
  * complex.h on AIX 5 and AIX 6 define _Complex_I and I in terms of __I,