public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc-12.3 cannot build gcc-ada on Cygwin
@ 2023-05-21 16:35 Achim Gratz
  2023-05-21 18:12 ` LIU Hao
  0 siblings, 1 reply; 4+ messages in thread
From: Achim Gratz @ 2023-05-21 16:35 UTC (permalink / raw)
  To: gcc


I've recently recovered Ada into gcc-11.3 on Cygwin and am now trying to
update the whole compiler suite to 12.3.  The build runs into a problem
in stage 2:

--8<---------------cut here---------------start------------->8---
make[3]: Entering directory '/mnt/share/cygpkgs/gcc/gcc.x86_64/build/gcc'
/mnt/share/cygpkgs/gcc/gcc.x86_64/build/./prev-gcc/xg++ -B/mnt/share/cygpkgs/gcc/gcc.x86_64/build/./prev-gcc/ -B/usr/x86_64-pc-cygwin/bin/ -nostdinc++ -B/mnt/share/cygpkgs/gcc/gcc.x86_64/build/prev-x86_64-pc-cygwin/libstdc++-v3/src/.libs -B/mnt/share/cygpkgs/gcc/gcc.x86_64/build/prev-x86_64-pc-cygwin/libstdc++-v3/libsupc++/.libs  -I/mnt/share/cygpkgs/gcc/gcc.x86_64/build/prev-x86_64-pc-cygwin/libstdc++-v3/include/x86_64-pc-cygwin  -I/mnt/share/cygpkgs/gcc/gcc.x86_64/build/prev-x86_64-pc-cygwin/libstdc++-v3/include  -I/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.3.0/libstdc++-v3/libsupc++ -L/mnt/share/cygpkgs/gcc/gcc.x86_64/build/prev-x86_64-pc-cygwin/libstdc++-v3/src/.libs -L/mnt/share/cygpkgs/gcc/gcc.x86_64/build/prev-x86_64-pc-cygwin/libstdc++-v3/libsupc++/.libs  -fno-PIE -c  -DIN_GCC_FRONTEND -fdebug-prefix-map=/mnt/share/cygpkgs/gcc/gcc.x86_64/build=/usr/src/debug/gcc-12.3.0-0.1 -fdebug-prefix-map=/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.3.0=/usr/src/debug/gcc-12.3.0-0.1 -fno-checking -gtoggle -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual  -Wmissing-format-attribute -Woverloaded-virtual -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -Iada -I/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.3.0/gcc -I/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.3.0/gcc/ada -I/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.3.0/gcc/../include -I/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.3.0/gcc/../libcpp/include -I/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.3.0/gcc/../libcody  -I/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.3.0/gcc/../libdecnumber -I/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.3.0/gcc/../libdecnumber/bid -I../libdecnumber -I/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.3.0/gcc/../libbacktrace   -o ada/argv.o -MT ada/argv.o -MMD -MP -MF ada/.deps/argv.TPo /mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.3.0/gcc/ada/argv.c
/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.3.0/gcc/system.h:783:30: error: expected identifier before string constant
  783 | #define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__)
      |                              ^~~~~~~~
/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.3.0/gcc/system.h:783:30: error: expected ‘,’ or ‘...’ before string constant
/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.3.0/gcc/system.h:783:30: error: expected identifier before string constant
  783 | #define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__)
      |                              ^~~~~~~~
/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-12.3.0/gcc/system.h:783:30: error: expected ‘,’ or ‘...’ before string constant
make[3]: *** [Makefile:1143: ada/argv.o] Error 1
--8<---------------cut here---------------end--------------->8---

The error probably is in part a result of using g++ for the compilation,
but other than that I don't really have an idea what goes on here or how
to fix it.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+


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

* Re: gcc-12.3 cannot build gcc-ada on Cygwin
  2023-05-21 16:35 gcc-12.3 cannot build gcc-ada on Cygwin Achim Gratz
@ 2023-05-21 18:12 ` LIU Hao
  2023-05-22 20:08   ` Achim Gratz
  0 siblings, 1 reply; 4+ messages in thread
From: LIU Hao @ 2023-05-21 18:12 UTC (permalink / raw)
  To: Achim Gratz, gcc


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

在 2023-05-22 00:35, Achim Gratz 写道:
> The error probably is in part a result of using g++ for the compilation,
> but other than that I don't really have an idea what goes on here or how
> to fix it.

This looks like https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108300.

It's because GCC defines `abort` as a macro; and the Windows header 'msxml.h', which is included 
indirectly by 'accctrl.h' (within Ada and GCC JIT), has a member function with that same name.

Previously, mingw-w64 had a distinct 'msxml.h' which did `push_macro` and `pop_macro`, but it's now 
imported from wine for additional functionality, while the wine header does not have those pragmas 
and is causing trouble. GCC should not have defined macros which match standard functions like that 
(see Comment 9 on the PR above). Sadly nobody has refactored it so far.

A temporary fix for this issue is to add `-DCOM_NO_WINDOWS_H` in `CPPFLAGS` when building GCC.



-- 
Best regards,
LIU Hao


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

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

* Re: gcc-12.3 cannot build gcc-ada on Cygwin
  2023-05-21 18:12 ` LIU Hao
@ 2023-05-22 20:08   ` Achim Gratz
  2023-05-24  1:42     ` LIU Hao
  0 siblings, 1 reply; 4+ messages in thread
From: Achim Gratz @ 2023-05-22 20:08 UTC (permalink / raw)
  To: gcc

LIU Hao via Gcc writes:
> 在 2023-05-22 00:35, Achim Gratz 写道:
>> The error probably is in part a result of using g++ for the compilation,
>> but other than that I don't really have an idea what goes on here or how
>> to fix it.
>
> This looks like https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108300.

Apparently yes.  Thanks for pointing that out.

> It's because GCC defines `abort` as a macro; and the Windows header
> 'msxml.h', which is included indirectly by 'accctrl.h' (within Ada and
> GCC JIT), has a member function with that same name.
>
> Previously, mingw-w64 had a distinct 'msxml.h' which did `push_macro`
> and `pop_macro`, but it's now imported from wine for additional
> functionality, while the wine header does not have those pragmas and
> is causing trouble. GCC should not have defined macros which match
> standard functions like that (see Comment 9 on the PR above). Sadly
> nobody has refactored it so far.
>
> A temporary fix for this issue is to add `-DCOM_NO_WINDOWS_H` in
> `CPPFLAGS` when building GCC.

I've backported the patch _and_ defined both WIN32_LEAN_AND_MEAN and
COM_NO_WINDOWS_H (of which I find no reference anywhere in the sources,
so it's probably doing something in the Windows headers?) and the build
has been working through stage 3.

The Cygwin build probably shouldn't pull in Windows headers at all, but
checking that is for another time.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada


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

* Re: gcc-12.3 cannot build gcc-ada on Cygwin
  2023-05-22 20:08   ` Achim Gratz
@ 2023-05-24  1:42     ` LIU Hao
  0 siblings, 0 replies; 4+ messages in thread
From: LIU Hao @ 2023-05-24  1:42 UTC (permalink / raw)
  To: Achim Gratz, gcc


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

在 2023/5/23 04:08, Achim Gratz 写道:
> I've backported the patch _and_ defined both WIN32_LEAN_AND_MEAN and
> COM_NO_WINDOWS_H (of which I find no reference anywhere in the sources,
> so it's probably doing something in the Windows headers?) and the build
> has been working through stage 3.

That look likes a private macro that prevents inclusion of 'msxml.h', which can identified by 
examining Windows headers. It's undocumented and probably shouldn't be defined by users.





-- 
Best regards,
LIU Hao


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

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

end of thread, other threads:[~2023-05-24  1:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-21 16:35 gcc-12.3 cannot build gcc-ada on Cygwin Achim Gratz
2023-05-21 18:12 ` LIU Hao
2023-05-22 20:08   ` Achim Gratz
2023-05-24  1:42     ` LIU Hao

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).