This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Ping [PATCH] [MinGW] Set __USE_MINGW_ACCESS for C++ as well


Am 03.03.19 um 11:41 schrieb Johannes Pfau:
We set __USE_MINGW_ACCESS for windows hosts to use MinGWs wrapper
for the access function. The wrapper ensures that access behaves
in the expected way (e.g. for special files, such as nul).
However, we now compile most sources with the C++ compiler and
the __USE_MINGW_ACCESS in CFLAGS is not used there. This causes
GCCs build against newer msvcrt versions with incompatible
access implementations to fail. This patch adds the flag to the
CXXFLAGS for all bootstrap stages. Bootstrapped on
x86_64-mingw64-seh.

config/ChangeLog:

2019-03-02  Johannes Pfau  <johannespfau@gmail.com>

	* mh-mingw: Also set __USE_MINGW_ACCESS flag for C++ code.

---
  config/mh-mingw | 5 +++++
  1 file changed, 5 insertions(+)

diff --git a/config/mh-mingw b/config/mh-mingw
index bc1d27477d0..a795096f038 100644
--- a/config/mh-mingw
+++ b/config/mh-mingw
@@ -2,6 +2,11 @@
  # Vista (see PR33281 for details).
  BOOT_CFLAGS += -D__USE_MINGW_ACCESS -Wno-pedantic-ms-format
  CFLAGS += -D__USE_MINGW_ACCESS
+STAGE1_CXXFLAGS += -D__USE_MINGW_ACCESS
+STAGE2_CXXFLAGS += -D__USE_MINGW_ACCESS
+STAGE3_CXXFLAGS += -D__USE_MINGW_ACCESS
+STAGE4_CXXFLAGS += -D__USE_MINGW_ACCESS
+
  # Increase stack limit to a figure based on the Linux default, with 4MB added
  # as GCC turns out to need that much more to pass all the limits-* tests.
  LDFLAGS += -Wl,--stack,12582912


Ping. Would be great to get this into GCC as https://github.com/niXman/mingw-builds/ now has a --with-default-msvcrt= which simplifies building MinGW for a specific MSVC version a lot, but at least the bootstrap builds are currently blocked by this issue.


Best regards,

Johannes


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]