From patchwork Sun Sep 9 15:54:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: rbmj X-Patchwork-Id: 182625 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 1A1D52C0088 for ; Mon, 10 Sep 2012 01:54:50 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1347810891; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-id:Date:From:User-Agent:MIME-version:To:Cc:Subject: References:In-reply-to:Content-type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=va3IwedZ3loRJJQI6M6fBrMdldA=; b=pvrT6y6Z2djacN0 vCXVmsTR0D/NdtIN/7feuBaYK+BQJdxU8WXMzyZ21X2zUNQZSSdl6BSwAaOar6Bm AJj3odATYJaOmvZD1H5nUs7YO8DGlPXs3uTccadPJUPYL9yDHC0eLR5gNua/nwNE FfZhhw6UWQAumNQD97gBWNdkIPa0= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Message-id:Date:From:User-Agent:MIME-version:To:Cc:Subject:References:In-reply-to:Content-type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=EuIxbn+4FRa2WHk8I5egYu6LP3rfzLpmf2vnmR4cg4Hf2pUMFo8pKizzIMefVK 45mR2yebX0YHoUKJuhjS0+ONjwtsOCw5OpNoZGExpdKM79G2KLtXpuwZwqZy3e71 GfCS+Alk5CZkypRinPquPKztpOnjJoMB+f7B52EPOwwGU=; Received: (qmail 25749 invoked by alias); 9 Sep 2012 15:54:45 -0000 Received: (qmail 25738 invoked by uid 22791); 9 Sep 2012 15:54:43 -0000 X-SWARE-Spam-Status: No, hits=1.6 required=5.0 tests=AWL, BAYES_00, BOTNET, KHOP_THREADED, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, TW_CX, TW_DC, TW_GC X-Spam-Check-By: sourceware.org Received: from vms173021pub.verizon.net (HELO vms173021pub.verizon.net) (206.46.173.21) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 09 Sep 2012 15:54:28 +0000 Received: from [10.16.147.104] ([unknown] [131.121.225.22]) by vms173021.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0MA300CX0AU77O40@vms173021.mailsrvcs.net> for gcc-patches@gcc.gnu.org; Sun, 09 Sep 2012 10:54:08 -0500 (CDT) Message-id: <504CBB9F.5070000@verizon.net> Date: Sun, 09 Sep 2012 11:54:07 -0400 From: rbmj User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-version: 1.0 To: Bruce Korb Cc: gcc-patches@gcc.gnu.org, bonzini@gnu.org, nathan@codesourcery.com Subject: Re: VxWorks Patches Back from the Dead! References: <503573B9.5090406@verizon.net> <50357EC8.3000709@gnu.org> <5037CD07.6020704@verizon.net> <5037DAA3.3080604@gnu.org> <5037E216.1040301@verizon.net> <50399984.1030405@verizon.net> <503F6AFD.4050005@verizon.net> <5042DC25.4060608@verizon.net> In-reply-to: <5042DC25.4060608@verizon.net> Content-type: multipart/mixed; boundary=------------050709040604050702040805 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Just because I *love* bothering everyone with emails... I've made a few changes and squashed everything into a single patch for ease of application. The commit message is inside the patch, but here's the suggested ChangeLog: configure.ac: add --enable-libstdcxx option configure: regenerate [gcc] gcov-io.c (gcov_open): Pass mode to open() unconditionally [fixincludes] fixinc.in: Added ability to skip machine_name inclhack.def (AAB_vxworks_assert): Added fix inclhack.def (AAB_vxworks_regs_vxtypes): Added fix inclhack.def (AAB_vxworks_stdint): Added fix inclhack.def (AAB_vxworks_unistd): Added fix inclhack.def (vxworks_ioctl_macro): Added fix inclhack.def (vxworks_mkdir_macro): Added fix inclhack.def (vxworks_regs): Added fix inclhack.def (vxworks_write_const): Added fix fixincl.x: Regenerate mkfixinc.sh: Removed vxworks from list of no-op fixinc targets [libstdc++-v3] config/os/vxworks/os_defines.h: #define'd NOMINMAX Thanks, Robert Mason From 2ce175a3c94e6d544e27a8f936728fbec8f1f004 Mon Sep 17 00:00:00 2001 From: rbmj Date: Mon, 4 Jun 2012 13:18:10 -0400 Subject: [PATCH] Fix issues with VxWorks Targets Fix 1: 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. Fix 2: Add hack for ioctl() on VxWorks. ioctl() is supposed to be variadic, but VxWorks only has a three argument version with the third argument of type int. This messes up when the third argument is not implicitly convertible to int. This adds a macro which wraps around ioctl() and explicitly casts the third argument to an int. This way, the most common use case of ioctl (with a const char * for the third argument) will compile in C++, where pointers must be explicitly casted to int. Fix 3: Added vxworks_mkdir_macro fix This adds a macro to POSIX-ify VxWorks' mkdir() function by including a macro that wraps the function and takes an (ignored, but still evaluated) mode argument. Fix 4: Add fix to prevent inclusion of regs.h on VxWorks. VxWorks has it's own regs.h that conflicts with GCC's regs.h, so just make any replace any references to regs.h in VxWorks with references to arch/../regs.h, which includes the VxWorks header, not GCC's header. Fix 5: Add stdint.h wrapper for VxWorks. Vxworks stdint.h doesn't have all the typedefs needed for standards compliance, so add a hack that adds all of the needed typedefs to be fully compliant to the standard. Fixes broken libstdc++. There was additional discussion of adding the necessary macros to get gcc to have built-in recognition of the types, but I could not get that to work. That is also non-essential to this patch, which is primarily to fix a bug caused by relying on types in stdint.h that vxworks does not define. Fix 6: Add unistd.h wrapper for VxWorks. On VxWorks, unistd.h doesn't define everything it should, like read/write, etc. This wrapper adds the things it should define so everything can be compliant and compile correctly without manual modification. Fix 7: Add fix to make write() const correct on VxWorks VxWorks' write() takes its second argument as non-const, so the compiler complains if one tries to pass a const pointer to it. This simply changes the prototype to say it is const so everything works. I believe that the prototype is non-const for backwards compatibility with old verisons of vxworks, but these versions are not supported by modern GCC, so causing potential bugs on those platforms is a non-issue. Modern vxworks will not modify the string passed to it, so just changing the prototype will work silently. Fix 8: Make open() call more compatible in gcc/gcov-io.c In gcc/gcov-io.c, the call to open() only has two arguments. This is fine, as long as the system open() is standards compliant. However, on at least one system (vxworks real time processes), open() is a non-variadic function, so the call fails. This adds a third argument passed unconditionally to open for compatibility with non-variadic open(). On systems with variadic open(), the extra argument should just be ignored anyway. There was talk of replacing this change with a fixincludes macro definition of open(), but this breaks libstdc++-v3. Fix 9: Added --enable-libstdcxx option. This patch allows the user to force enable/disable building of libstdc++-v3 with a --enable-libstdcxx option to be congruent with the other runtime library options. The side effect of this, and the main motivation for this patch, is to allow the user to force compilation of libstdc++-v3 for targets that do not currently enable building libstdc++-v3 by default. The configure-time override is useful when trying to override the stock runtime library on embedded systems that have their own C++ library. Please note that although this is a patch that pertains to libstdc++-v3, it is a patch over top-level configure, NOT libstdc++-v3/configure. Fix 10: Add ability to skip the machine_name fixincludes fix. This patch adds the ability to skip the machine_name fixincludes fix in fixinc.in by wiping the macro list. It also removes vxworks from the list of no-op fix platforms in order to allow necessary include fixes to allow a successful build of the latest GCC. Fix 11: Added NOMINMAX to vxworks os_defines.h VxWorks defines min and max as macros, but allows this behavior to be disabled by defining NOMINMAX. This adds that definition to libstdc++-v3's vxworks os_defines.h so that whenever C++ code is being compiled these macros are not defined and the standard versions of min and max will be used instead. ChangeLog: configure.ac: add --enable-libstdcxx option configure: regenerate [gcc] gcov-io.c (gcov_open): Pass mode to open() unconditionally [fixincludes] fixinc.in: Added ability to skip machine_name inclhack.def (AAB_vxworks_assert): Added fix inclhack.def (AAB_vxworks_regs_vxtypes): Added fix inclhack.def (AAB_vxworks_stdint): Added fix inclhack.def (AAB_vxworks_unistd): Added fix inclhack.def (vxworks_ioctl_macro): Added fix inclhack.def (vxworks_mkdir_macro): Added fix inclhack.def (vxworks_regs): Added fix inclhack.def (vxworks_write_const): Added fix fixincl.x: Regenerate mkfixinc.sh: Removed vxworks from list of no-op fixinc targets [libstdc++-v3] config/os/vxworks/os_defines.h: #define'd NOMINMAX --- configure.ac | 38 ++-- fixincludes/fixinc.in | 16 ++ fixincludes/inclhack.def | 266 +++++++++++++++++++++++++++ fixincludes/mkfixinc.sh | 1 - gcc/gcov-io.c | 3 +- libstdc++-v3/config/os/vxworks/os_defines.h | 6 + 6 files changed, 315 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index a6f5828..7aaa28d 100644 --- a/configure.ac +++ b/configure.ac @@ -426,6 +426,15 @@ AC_ARG_ENABLE(libssp, ENABLE_LIBSSP=$enableval, ENABLE_LIBSSP=yes) +AC_ARG_ENABLE(libstdcxx, +AS_HELP_STRING([--disable-libstdcxx], + [do not build libstdc++-v3 directory]), +ENABLE_LIBSTDCXX=$enableval, +ENABLE_LIBSTDCXX=default) +if test "${ENABLE_LIBSTDCXX}" = "no" ; then + noconfigdirs="$noconfigdirs libstdc++-v3" +fi + # Save it here so that, even in case of --enable-libgcj, if the Java # front-end isn't enabled, we still get libgcj disabled. libgcj_saved=$libgcj @@ -552,19 +561,22 @@ case "${target}" in esac # Disable libstdc++-v3 for some systems. -case "${target}" in - *-*-vxworks*) - # VxWorks uses the Dinkumware C++ library. - noconfigdirs="$noconfigdirs target-libstdc++-v3" - ;; - arm*-wince-pe*) - # the C++ libraries don't build on top of CE's C libraries - noconfigdirs="$noconfigdirs target-libstdc++-v3" - ;; - avr-*-*) - noconfigdirs="$noconfigdirs target-libstdc++-v3" - ;; -esac +# Allow user to override this if they pass --enable-libstdc++-v3 +if test "${ENABLE_LIBSTDCXX}" = "default" ; then + case "${target}" in + *-*-vxworks*) + # VxWorks uses the Dinkumware C++ library. + noconfigdirs="$noconfigdirs target-libstdc++-v3" + ;; + arm*-wince-pe*) + # the C++ libraries don't build on top of CE's C libraries + noconfigdirs="$noconfigdirs target-libstdc++-v3" + ;; + avr-*-*) + noconfigdirs="$noconfigdirs target-libstdc++-v3" + ;; + esac +fi # Disable Fortran for some systems. case "${target}" in diff --git a/fixincludes/fixinc.in b/fixincludes/fixinc.in index e73aed9..f7b8d8f 100755 --- a/fixincludes/fixinc.in +++ b/fixincludes/fixinc.in @@ -128,6 +128,22 @@ fi # # # # # # # # # # # # # # # # # # # # # # +# Check to see if the machine_name fix needs to be disabled. +# +# On some platforms, machine_name doesn't work properly and +# breaks some of the header files. Since everything works +# properly without it, just wipe the macro list to +# disable the fix. + +case "${target_canonical}" in + *-*-vxworks*) + test -f ${MACRO_LIST} && echo > ${MACRO_LIST} + ;; +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 diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 82792af..9f32f4e 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -354,6 +354,206 @@ 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_; +}; + +/* + * Add needed include to regs.h (NOT the gcc header) on VxWorks + */ + +fix = { + hackname = AAB_vxworks_regs_vxtypes; + files = regs.h; + mach = "*-*-vxworks*"; + + replace = <<- _EndOfHeader_ + #ifndef _REGS_H + #define _REGS_H + #include + #include_next + #endif + _EndOfHeader_; +}; + +/* + * Make VxWorks stdint.h a bit more compliant - add typedefs + */ +fix = { + hackname = AAB_vxworks_stdint; + files = stdint.h; + mach = "*-*-vxworks*"; + + replace = <<- _EndOfHeader_ + #ifndef _STDINT_H + #define _STDINT_H + /* get int*_t, uint*_t */ + #include + + /* get legacy vxworks types for compatibility */ + #include + + typedef long intptr_t; + typedef unsigned long uintptr_t; + + typedef int64_t intmax_t; + typedef uint64_t uintmax_t; + + typedef int8_t int_least8_t; + typedef int16_t int_least16_t; + typedef int32_t int_least32_t; + typedef int64_t int_least64_t; + + typedef uint8_t uint_least8_t; + typedef uint16_t uint_least16_t; + typedef uint32_t uint_least32_t; + typedef uint64_t uint_least64_t; + + typedef int8_t int_fast8_t; + typedef int int_fast16_t; + typedef int32_t int_fast32_t; + typedef int64_t int_fast64_t; + + typedef uint8_t uint_fast8_t; + typedef unsigned int uint_fast16_t; + typedef uint32_t uint_fast32_t; + typedef uint64_t uint_fast64_t; + + /* Ranges */ + #define UINT8_MAX (~(uint8_t)0) + #define UINT8_MIN 0 + #define UINT16_MAX (~(uint16_t)0) + #define UINT16_MIN 0 + #define UINT32_MAX (~(uint32_t)0) + #define UINT32_MIN 0 + #define UINT64_MAX (~(uint64_t)0) + #define UINT64_MIN 0 + + #define UINTPTR_MAX (~(uintptr_t)0) + #define UINTPTR_MIN 0 + + /* Need to do int_fast16_t as well, as type + size may be architecture dependent */ + #define UINT_FAST16_MAX (~(uint_fast16_t)0) + #define UINT_FAST16_MAX 0 + + #define INT8_MAX (UINT8_MAX>>1) + #define INT8_MIN (INT8_MAX+1) + #define INT16_MAX (UINT16_MAX>>1) + #define INT16_MIN (INT16_MAX+1) + #define INT32_MAX (UINT32_MAX>>1) + #define INT32_MIN (INT32_MAX+1) + #define INT64_MAX (UINT64_MAX>>1) + #define INT64_MIN (INT64_MAX+1) + + #define INTPTR_MAX (UINTPTR_MAX>>1) + #define INTPTR_MIN (INTPTR_MAX+1) + + #define INT_FAST16_MAX (UINT_FAST16_MAX>>1) + #define INT_FAST16_MIN (INT_FAST16_MAX+1) + + /* now define equiv. constants */ + #define UINT_FAST8_MAX UINT8_MAX + #define UINT_FAST8_MIN UINT_FAST8_MIN + #define INT_FAST8_MAX INT8_MAX + #define INT_FAST8_MIN INT8_MIN + #define UINT_FAST32_MAX UINT32_MAX + #define UINT_FAST32_MIN UINT32_MIN + #define INT_FAST32_MAX INT32_MAX + #define INT_FAST32_MIN INT32_MIN + #define UINT_FAST64_MAX UINT64_MAX + #define UINT_FAST64_MIN UINT64_MIN + #define INT_FAST64_MAX INT64_MAX + #define INT_FAST64_MIN INT64_MIN + + #define UINT_LEAST8_MAX UINT8_MAX + #define UINT_LEAST8_MIN UINT8_MIN + #define INT_LEAST8_MAX INT8_MAX + #define INT_LEAST8_MIN INT8_MIN + #define UINT_LEAST16_MAX UINT16_MAX + #define UINT_LEAST16_MIN UINT16_MIN + #define INT_LEAST16_MAX INT16_MAX + #define INT_LEAST16_MIN INT16_MIN + #define UINT_LEAST32_MAX UINT32_MAX + #define UINT_LEAST32_MIN UINT32_MIN + #define INT_LEAST32_MAX INT32_MAX + #define INT_LEAST32_MIN INT32_MIN + #define UINT_LEAST64_MAX UINT64_MAX + #define UINT_LEAST64_MIN UINT64_MIN + #define INT_LEAST64_MAX INT64_MAX + #define INT_LEAST64_MIN INT64_MIN + + #define UINTMAX_MAX UINT64_MAX + #define UINTMAX_MIN UINT64_MIN + #define INTMAX_MAX INT64_MAX + #define INTMAX_MIN INT64_MIN + + #endif + _EndOfHeader_; +}; + +/* + * This hack makes makes unistd.h more POSIX-compliant on VxWorks + */ +fix = { + hackname = AAB_vxworks_unistd; + files = unistd.h; + mach = "*-*-vxworks*"; + + replace = <<- _EndOfHeader_ + #ifndef _UNISTD_H + #define _UNISTD_H + #include_next + #include + #ifndef STDIN_FILENO + #define STDIN_FILENO 0 + #endif + #ifndef STDOUT_FILENO + #define STDOUT_FILENO 1 + #endif + #ifndef STDERR_FILENO + #define STDERR_FILENO 2 + #endif + #endif /* _UNISTD_H */ + _EndOfHeader_; +}; + /* * complex.h on AIX 5 and AIX 6 define _Complex_I and I in terms of __I, @@ -4371,6 +4571,41 @@ fix = { "#endif /* __GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__ */\n"; }; +/* + * Wrap VxWorks ioctl to keep everything pretty + */ +fix = { + hackname = vxworks_ioctl_macro; + files = ioLib.h; + mach = "*-*-vxworks*"; + + c_fix = format; + c_fix_arg = "%0\n" + "#define ioctl(fd, func, arg) (ioctl)(fd, func, (int)(arg))\n"; + c_fix_arg = "extern[\t ]+int[\t ]+ioctl[\t ]*\\([\t ,[:alnum:]]*\\);"; + + test_text = "extern int ioctl ( int asdf1234, int jkl , int qwerty ) ;"; +}; + +/* + * Wrap VxWorks mkdir to be posix compliant + */ +fix = { + hackname = vxworks_mkdir_macro; + files = sys/stat.h; + mach = "*-*-vxworks*"; + + c_fix = format; + c_fix_arg = "%0\n" + "#define mkdir(dir, ...) ((void)0, ##__VA_ARGS__, (mkdir)(dir))\n"; + c_fix_arg = "extern[\t ]+STATUS[\t ]+mkdir[\t ]*" + "\\([\t ]*const[\t ]+char[\t ]*\\*[\t ]*" /* arg type */ + "(|[_[:alpha:]][_[:alnum:]]*)" /* arg name (optional) */ + "\\)[\t ]*;"; + + test_text = "extern STATUS mkdir (const char * _qwerty) ;"; +}; + /* * Fix VxWorks to not require including . @@ -4404,6 +4639,20 @@ fix = { "# define\t__INCstath "; }; +/* + * Make it so VxWorks does not include gcc/regs.h accidentally + */ +fix = { + hackname = vxworks_regs; + mach = "*-*-vxworks*"; + + select = "#[\t ]*include[\t ]+[<\"]regs.h[>\"]"; + c_fix = format; + c_fix_arg = "#include "; + + test_text = "#include \n"; +}; + /* * Another bad dependency in VxWorks 5.2 . @@ -4431,6 +4680,23 @@ fix = { "#define VOIDFUNCPTR (void(*)())"; }; +/* + * This hack makes write const-correct on VxWorks + */ +fix = { + hackname = vxworks_write_const; + files = ioLib.h; + mach = "*-*-vxworks*"; + + c_fix = format; + c_fix_arg = "extern int write (int, const char*, size_t);"; + c_fix_arg = "extern[\t ]+int[\t ]+write[\t ]*\\(" + "[\t ]*int[\t ]*," + "[\t ]*char[\t ]*\\*[\t ]*," + "[\t ]*size_t[\t ]*\\)[\t ]*;"; + + test_text = "extern int write ( int , char * , size_t ) ;"; +}; /* * There are several name conflicts with C++ reserved words in X11 header 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* | \ diff --git a/gcc/gcov-io.c b/gcc/gcov-io.c index d64fb42..f562654 100644 --- a/gcc/gcov-io.c +++ b/gcc/gcov-io.c @@ -92,7 +92,8 @@ gcov_open (const char *name, int mode) { /* Read-only mode - acquire a read-lock. */ s_flock.l_type = F_RDLCK; - fd = open (name, O_RDONLY); + /* pass mode (ignored) for compatibility */ + fd = open (name, O_RDONLY, S_IRUSR | S_IWUSR); } else { diff --git a/libstdc++-v3/config/os/vxworks/os_defines.h b/libstdc++-v3/config/os/vxworks/os_defines.h index c66063e..93ad1d4 100644 --- a/libstdc++-v3/config/os/vxworks/os_defines.h +++ b/libstdc++-v3/config/os/vxworks/os_defines.h @@ -33,4 +33,10 @@ // System-specific #define, typedefs, corrections, etc, go here. This // file will come before all others. +//Keep vxWorks from defining min()/max() as macros +#ifdef NOMINMAX +#undef NOMINMAX +#endif +#define NOMINMAX 1 + #endif