public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] [MinGW] Set __USE_MINGW_ACCESS for C++ as well
@ 2019-03-03 10:42 Johannes Pfau
  2019-03-17 12:57 ` Ping " Johannes Pfau
  2019-03-18 22:33 ` JonY
  0 siblings, 2 replies; 4+ messages in thread
From: Johannes Pfau @ 2019-03-03 10:42 UTC (permalink / raw)
  To: gcc-patches

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
-- 
2.19.2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Ping [PATCH] [MinGW] Set __USE_MINGW_ACCESS for C++ as well
  2019-03-03 10:42 [PATCH] [MinGW] Set __USE_MINGW_ACCESS for C++ as well Johannes Pfau
@ 2019-03-17 12:57 ` Johannes Pfau
  2019-03-18 22:33 ` JonY
  1 sibling, 0 replies; 4+ messages in thread
From: Johannes Pfau @ 2019-03-17 12:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: 10walls

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [MinGW] Set __USE_MINGW_ACCESS for C++ as well
  2019-03-03 10:42 [PATCH] [MinGW] Set __USE_MINGW_ACCESS for C++ as well Johannes Pfau
  2019-03-17 12:57 ` Ping " Johannes Pfau
@ 2019-03-18 22:33 ` JonY
  2019-03-19 14:56   ` JonY
  1 sibling, 1 reply; 4+ messages in thread
From: JonY @ 2019-03-18 22:33 UTC (permalink / raw)
  To: Johannes Pfau, gcc-patches


[-- Attachment #1.1: Type: text/plain, Size: 1532 bytes --]

On 3/3/19 10:41 AM, Johannes Pfau wrote:
> 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
> 

Patch looks good, will apply soon.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [MinGW] Set __USE_MINGW_ACCESS for C++ as well
  2019-03-18 22:33 ` JonY
@ 2019-03-19 14:56   ` JonY
  0 siblings, 0 replies; 4+ messages in thread
From: JonY @ 2019-03-19 14:56 UTC (permalink / raw)
  To: gcc-patches


[-- Attachment #1.1: Type: text/plain, Size: 1663 bytes --]

On 3/18/19 10:31 PM, JonY wrote:
> On 3/3/19 10:41 AM, Johannes Pfau wrote:
>> 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
>>
> 
> Patch looks good, will apply soon.
> 

Forgot to reply that this was checked in as r269784.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-19 14:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-03 10:42 [PATCH] [MinGW] Set __USE_MINGW_ACCESS for C++ as well Johannes Pfau
2019-03-17 12:57 ` Ping " Johannes Pfau
2019-03-18 22:33 ` JonY
2019-03-19 14:56   ` JonY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).