From patchwork Fri Aug 24 20:20:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: VxWorks Patches Back from the Dead! From: rbmj X-Patchwork-Id: 179908 Message-Id: <5037E216.1040301@verizon.net> To: Bruce Korb Cc: gcc-patches@gcc.gnu.org, bonzini@gnu.org, nathan@codesourcery.com Date: Fri, 24 Aug 2012 16:20:38 -0400 I have two candidate patches. I've tested both and either can supersede the original 0001-fixincludes-machine_name patch. The first is the original proposed sed expression: --- fixincludes/mkfixinc.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fixincludes/mkfixinc.sh b/fixincludes/mkfixinc.sh index 89e8ab7..a9f7c30 100755 --- a/fixincludes/mkfixinc.sh +++ b/fixincludes/mkfixinc.sh @@ -15,7 +15,6 @@ case $machine in i?86-*-mingw32* | \ x86_64-*-mingw32* | \ i?86-*-interix* | \ - *-*-vxworks* | \ powerpc-*-eabisim* | \ powerpc-*-eabi* | \ powerpc-*-rtems* | \ @@ -26,6 +25,12 @@ case $machine in (echo "#! /bin/sh" ; echo "exit 0" ) > ${target} ;; + *-*-vxworks* ) + # Platforms for which the machine_name fix breaks things + sed '/if test -s .{MACRO_LIST}/s/$/ \&\& false/' \ + ${srcdir}/fixinc.in > ${target} || exit 1 + ;; + *) cat < ${srcdir}/fixinc.in > ${target} || exit 1 ;; -- The second is adding a target-dependent override to fixinc.in directly (IMHO more complex, but also more complete): --- fixincludes/fixinc.in | 14 +++++++++++++- fixincludes/mkfixinc.sh | 1 - 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/fixincludes/fixinc.in b/fixincludes/fixinc.in index e73aed9..de7be35 100755 --- a/fixincludes/fixinc.in +++ b/fixincludes/fixinc.in @@ -128,6 +128,18 @@ fi # # # # # # # # # # # # # # # # # # # # # # +# Check to see if the machine_name fix needs to be disabled. +# + +case "${target_canonical}" in + *-*-vxworks*) + machine_name_override="OVERRIDE" + ;; +esac + + +# # # # # # # # # # # # # # # # # # # # # +# # In the file macro_list are listed all the predefined # macros that are not in the C89 reserved namespace (the reserved # namespace is all identifiers beginnning with two underscores or one @@ -137,7 +149,7 @@ fi # Note dependency on ASCII. \012 = newline. # tr ' ' '\n' is, alas, not portable. -if test -s ${MACRO_LIST} +if test -s ${MACRO_LIST} && test -z "${machine_name_override}" then if test $VERBOSE -gt 0; then echo "Forbidden identifiers: `tr '\012' ' ' < ${MACRO_LIST}`" diff --git a/fixincludes/mkfixinc.sh b/fixincludes/mkfixinc.sh index 89e8ab7..6653fed 100755 --- a/fixincludes/mkfixinc.sh +++ b/fixincludes/mkfixinc.sh @@ -15,7 +15,6 @@ case $machine in i?86-*-mingw32* | \ x86_64-*-mingw32* | \ i?86-*-interix* | \ - *-*-vxworks* | \ powerpc-*-eabisim* | \ powerpc-*-eabi* | \ powerpc-*-rtems* | \