public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] cooperation between gcc's and mingw's float.h
@ 2010-06-05 11:07 Mark Brand
  2010-06-07 16:13 ` Doug Semler
  0 siblings, 1 reply; 12+ messages in thread
From: Mark Brand @ 2010-06-05 11:07 UTC (permalink / raw)
  To: MinGW Users List, gcc-patches; +Cc: mingw-cross-env-list

[-- Attachment #1: Type: text/plain, Size: 1052 bytes --]

  Hi,

I'm reluctantly cross-posting because this issue requires cooperation 
between gcc and mingw.

Both mingw and gcc have a float.h. The mingw version supplements the gcc 
version, declaring _clear87 and _control87 among other things. The mingw 
version has an #include_next which is meant to include the gcc version. 
This works only when the mingw include dir is first in the header search 
path, which may not be correct.

When the header search list is ordered with the mingw include directory 
after the gcc's, a common symptom is that _clear87 and _control87 are 
undeclared.

A web search for "mingw gcc float.h _clear87" turns up lots of 
references to this problem, one of which is here:
http://bugreports.qt.nokia.com/browse/QTBUG-7576.

An easy (and correct?) solution is to move the #include_next<float.h> 
from the mingw version into the gcc version regards. The attached 
patches do this. But I imagine some discussion might be needed.

These patches are against  tarballs gcc-4.5.0.tar.bz2 and 
mingwrt-3.18-mingw32-dev.tar.gz

Mark

[-- Attachment #2: gcc-1-mingw-float.patch --]
[-- Type: text/x-patch, Size: 319 bytes --]

diff -urN a/gcc/ginclude/float.h b/gcc/ginclude/float.h
--- a/gcc/ginclude/float.h	2009-04-09 17:00:19.000000000 +0200
+++ b/gcc/ginclude/float.h	2010-06-05 12:03:41.887724045 +0200
@@ -236,3 +236,7 @@
 #endif /* __STDC_WANT_DEC_FP__ */
 
 #endif /* _FLOAT_H___ */
+
+#ifdef __MINGW32__
+#include_next<float.h>
+#endif

[-- Attachment #3: mingwrt-1-float.patch --]
[-- Type: text/x-patch, Size: 269 bytes --]

diff -urN a/include/float.h b/include/float.h
--- a/include/float.h	2010-03-07 04:31:41.000000000 +0100
+++ b/include/float.h	2010-06-05 12:29:08.899723741 +0200
@@ -16,8 +16,6 @@
  *
  */
 
-#include_next<float.h>
-
 #ifndef _MINGW_FLOAT_H_
 #define _MINGW_FLOAT_H_
 

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

* Re: [patch] cooperation between gcc's and mingw's float.h
  2010-06-05 11:07 [patch] cooperation between gcc's and mingw's float.h Mark Brand
@ 2010-06-07 16:13 ` Doug Semler
  2010-06-07 17:10   ` [Mingw-cross-env-list] " Volker Grabsch
  0 siblings, 1 reply; 12+ messages in thread
From: Doug Semler @ 2010-06-07 16:13 UTC (permalink / raw)
  To: Mark Brand; +Cc: MinGW Users List, gcc-patches, mingw-cross-env-list

See http://gcc.gnu.org/ml/gcc-patches/2010-01/msg01034.html

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

* Re: [Mingw-cross-env-list] Re: [patch] cooperation between gcc's and mingw's float.h
  2010-06-07 16:13 ` Doug Semler
@ 2010-06-07 17:10   ` Volker Grabsch
  2010-06-09 12:15     ` [Mingw-users] " Chris Sutcliffe
  0 siblings, 1 reply; 12+ messages in thread
From: Volker Grabsch @ 2010-06-07 17:10 UTC (permalink / raw)
  To: Doug Semler
  Cc: Mark Brand, mingw-cross-env-list, MinGW Users List, gcc-patches

Doug Semler <dougsemler@gmail.com> schrieb:
> See http://gcc.gnu.org/ml/gcc-patches/2010-01/msg01034.html

Thanks for the hint. This discussion essentially ends with the
following posting:
http://gcc.gnu.org/ml/gcc-patches/2010-01/msg01114.html

where Ozkan Sezer proposed the following patch, which is quite
similar to the GCC-part of Mark Brand's patch:
http://gcc.gnu.org/ml/gcc-patches/2010-01/msg01114/ginclude.diff

This happened 3 months before the GCC 4.5 release, so obviously
it wasn't accepted. Does anyone know what was wrong with it?


To the GCC maintainers: Would you accept the patch if MinGW-RT
                        includes the other patch?


To the MinGW-RT maintainers: Would you accept the patch if GCC
                             includes the other patch?


Greets,
Volker

-- 
Volker Grabsch
---<<(())>>---
Administrator
NotJustHosting GbR

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

* Re: [Mingw-users] [Mingw-cross-env-list] Re: [patch] cooperation  between gcc's and mingw's float.h
  2010-06-07 17:10   ` [Mingw-cross-env-list] " Volker Grabsch
@ 2010-06-09 12:15     ` Chris Sutcliffe
  2010-06-19 18:11       ` [Mingw-users] [Mingw-cross-env-list] Re: [patch] [ginclude] " Manuel López-Ibáñez
  0 siblings, 1 reply; 12+ messages in thread
From: Chris Sutcliffe @ 2010-06-09 12:15 UTC (permalink / raw)
  To: MinGW Users List; +Cc: Doug Semler, gcc-patches, mingw-cross-env-list

On 7 June 2010 13:10, Volker Grabsch wrote:
> Doug Semler schrieb:
>> See http://gcc.gnu.org/ml/gcc-patches/2010-01/msg01034.html
>
> Thanks for the hint. This discussion essentially ends with the
> following posting:
> http://gcc.gnu.org/ml/gcc-patches/2010-01/msg01114.html
>
> where Ozkan Sezer proposed the following patch, which is quite
> similar to the GCC-part of Mark Brand's patch:
> http://gcc.gnu.org/ml/gcc-patches/2010-01/msg01114/ginclude.diff
>
> This happened 3 months before the GCC 4.5 release, so obviously
> it wasn't accepted. Does anyone know what was wrong with it?
>
>
> To the GCC maintainers: Would you accept the patch if MinGW-RT
>                        includes the other patch?
>
>
> To the MinGW-RT maintainers: Would you accept the patch if GCC
>                             includes the other patch?

I have no issue with the patch from a MinGW-RT perspective as long as
there are no negative impacts.

Chris

-- 
Chris Sutcliffe
http://emergedesktop.org
http://www.google.com/profiles/ir0nh34d

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

* Re: [Mingw-users] [Mingw-cross-env-list] Re: [patch] [ginclude]  cooperation between gcc's and mingw's float.h
  2010-06-09 12:15     ` [Mingw-users] " Chris Sutcliffe
@ 2010-06-19 18:11       ` Manuel López-Ibáñez
  2010-06-19 20:11         ` Volker Grabsch
  2010-06-20 13:20         ` Paolo Bonzini
  0 siblings, 2 replies; 12+ messages in thread
From: Manuel López-Ibáñez @ 2010-06-19 18:11 UTC (permalink / raw)
  To: Chris Sutcliffe
  Cc: MinGW Users List, Doug Semler, gcc-patches, mingw-cross-env-list,
	Paolo Bonzini

On 9 June 2010 13:59, Chris Sutcliffe <ir0nh34d@gmail.com> wrote:
> On 7 June 2010 13:10, Volker Grabsch wrote:
>>
>> To the GCC maintainers: Would you accept the patch if MinGW-RT
>>                        includes the other patch?
>>

Perhaps the decision takers for this patch have not been specified
with sufficient clarity. It seems a build issue, so CCing a build
maintainer.

Cheers,

Manuel.

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

* Re: [Mingw-users] [Mingw-cross-env-list] Re: [patch] [ginclude] cooperation between gcc's and mingw's float.h
  2010-06-19 18:11       ` [Mingw-users] [Mingw-cross-env-list] Re: [patch] [ginclude] " Manuel López-Ibáñez
@ 2010-06-19 20:11         ` Volker Grabsch
  2010-06-20 13:20         ` Paolo Bonzini
  1 sibling, 0 replies; 12+ messages in thread
From: Volker Grabsch @ 2010-06-19 20:11 UTC (permalink / raw)
  To: Manuel López-Ibáñez
  Cc: Chris Sutcliffe, mingw-cross-env-list, MinGW Users List,
	Paolo Bonzini, gcc-patches, Doug Semler

Manuel López-Ibáñez <lopezibanez@gmail.com> schrieb:
> On 9 June 2010 13:59, Chris Sutcliffe <ir0nh34d@gmail.com> wrote:
> > On 7 June 2010 13:10, Volker Grabsch wrote:
> >>
> >> To the GCC maintainers: Would you accept the patch if MinGW-RT
> >>                        includes the other patch?
> >>
> 
> Perhaps the decision takers for this patch have not been specified
> with sufficient clarity. It seems a build issue, so CCing a build
> maintainer.

For completeness, here is a link to the corresponding entry/discussion
on the MinGW bug tracker:
http://sourceforge.net/tracker/?func=detail&atid=302435&aid=3011968&group_id=2435

It would be great if some GCC developers would join the discussion there.


Greets,
Volker

-- 
Volker Grabsch
---<<(())>>---
Administrator
NotJustHosting GbR

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

* Re: [Mingw-users] [Mingw-cross-env-list] Re: [patch] [ginclude] cooperation between gcc's and mingw's float.h
  2010-06-19 18:11       ` [Mingw-users] [Mingw-cross-env-list] Re: [patch] [ginclude] " Manuel López-Ibáñez
  2010-06-19 20:11         ` Volker Grabsch
@ 2010-06-20 13:20         ` Paolo Bonzini
  2010-06-20 15:16           ` Volker Grabsch
  1 sibling, 1 reply; 12+ messages in thread
From: Paolo Bonzini @ 2010-06-20 13:20 UTC (permalink / raw)
  To: Manuel López-Ibáñez
  Cc: Chris Sutcliffe, MinGW Users List, Doug Semler, gcc-patches,
	mingw-cross-env-list

On 06/19/2010 04:23 PM, Manuel López-Ibáñez wrote:
> On 9 June 2010 13:59, Chris Sutcliffe<ir0nh34d@gmail.com>  wrote:
>> On 7 June 2010 13:10, Volker Grabsch wrote:
>>>
>>> To the GCC maintainers: Would you accept the patch if MinGW-RT
>>>                         includes the other patch?
>>>
>
> Perhaps the decision takers for this patch have not been specified
> with sufficient clarity. It seems a build issue, so CCing a build
> maintainer.

What patch?  Archive link, please. :)

Paolo

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

* Re: [Mingw-users] [Mingw-cross-env-list] Re: [patch] [ginclude] cooperation between gcc's and mingw's float.h
  2010-06-20 13:20         ` Paolo Bonzini
@ 2010-06-20 15:16           ` Volker Grabsch
  2010-06-20 15:25             ` Paolo Bonzini
  0 siblings, 1 reply; 12+ messages in thread
From: Volker Grabsch @ 2010-06-20 15:16 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Manuel López-Ibáñez, mingw-cross-env-list,
	Chris Sutcliffe, MinGW Users List, gcc-patches, Doug Semler

Paolo Bonzini <bonzini@gnu.org> schrieb:
> On 06/19/2010 04:23 PM, Manuel López-Ibáñez wrote:
>> On 9 June 2010 13:59, Chris Sutcliffe<ir0nh34d@gmail.com>  wrote:
>>> On 7 June 2010 13:10, Volker Grabsch wrote:
>>>>
>>>> To the GCC maintainers: Would you accept the patch if MinGW-RT
>>>>                         includes the other patch?
>>>>
>>
>> Perhaps the decision takers for this patch have not been specified
>> with sufficient clarity. It seems a build issue, so CCing a build
>> maintainer.
>
> What patch?  Archive link, please. :)

Start of discussion in the GCC mailing list:
http://gcc.gnu.org/ml/gcc-patches/2010-06/msg00387.html

Start of discussion in the MinGW bugtracker:
http://sourceforge.net/tracker/?func=detail&atid=302435&aid=3011968&group_id=2435

Corresponding changeset in Mingw-cross-env:
http://hg.savannah.gnu.org/hgweb/mingw-cross-env/rev/682d860fa4e9


Greets,
Volker

-- 
Volker Grabsch
---<<(())>>---
Administrator
NotJustHosting GbR

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

* Re: [Mingw-users] [Mingw-cross-env-list] Re: [patch] [ginclude] cooperation between gcc's and mingw's float.h
  2010-06-20 15:16           ` Volker Grabsch
@ 2010-06-20 15:25             ` Paolo Bonzini
  2010-06-20 15:55               ` Volker Grabsch
  2010-06-20 16:44               ` Doug Semler
  0 siblings, 2 replies; 12+ messages in thread
From: Paolo Bonzini @ 2010-06-20 15:25 UTC (permalink / raw)
  To: Volker Grabsch
  Cc: Manuel López-Ibáñez, mingw-cross-env-list,
	Chris Sutcliffe, MinGW Users List, gcc-patches, Doug Semler

On 06/20/2010 01:50 PM, Volker Grabsch wrote:
> Paolo Bonzini<bonzini@gnu.org>  schrieb:
>> On 06/19/2010 04:23 PM, Manuel López-Ibáñez wrote:
>>> On 9 June 2010 13:59, Chris Sutcliffe<ir0nh34d@gmail.com>   wrote:
>>>> On 7 June 2010 13:10, Volker Grabsch wrote:
>>>>>
>>>>> To the GCC maintainers: Would you accept the patch if MinGW-RT
>>>>>                          includes the other patch?
>>>>>
>>>
>>> Perhaps the decision takers for this patch have not been specified
>>> with sufficient clarity. It seems a build issue, so CCing a build
>>> maintainer.
>>
>> What patch?  Archive link, please. :)
>
> Start of discussion in the GCC mailing list:
> http://gcc.gnu.org/ml/gcc-patches/2010-06/msg00387.html
>
> Start of discussion in the MinGW bugtracker:
> http://sourceforge.net/tracker/?func=detail&atid=302435&aid=3011968&group_id=2435
>
> Corresponding changeset in Mingw-cross-env:
> http://hg.savannah.gnu.org/hgweb/mingw-cross-env/rev/682d860fa4e9

This is not really a GCC build machinery patch (more of a C front-end 
patch, or something like that), so I wouldn't approve it.  However, to 
understand the issue better, is there a place where I can see the full 
MinGW float.h?

It seems to me like a better way to fix this might be to rely on 
fixincludes.

Paolo

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

* Re: [Mingw-users] [Mingw-cross-env-list] Re: [patch] [ginclude] cooperation between gcc's and mingw's float.h
  2010-06-20 15:25             ` Paolo Bonzini
@ 2010-06-20 15:55               ` Volker Grabsch
  2010-06-20 16:44               ` Doug Semler
  1 sibling, 0 replies; 12+ messages in thread
From: Volker Grabsch @ 2010-06-20 15:55 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Manuel López-Ibáñez, mingw-cross-env-list,
	Chris Sutcliffe, MinGW Users List, gcc-patches, Doug Semler

Paolo Bonzini <bonzini@gnu.org> schrieb:
> On 06/20/2010 01:50 PM, Volker Grabsch wrote:
>> Paolo Bonzini<bonzini@gnu.org>  schrieb:
>>>
>>> What patch?  Archive link, please. :)
>>
>> Start of discussion in the GCC mailing list:
>> http://gcc.gnu.org/ml/gcc-patches/2010-06/msg00387.html
>>
>> Start of discussion in the MinGW bugtracker:
>> http://sourceforge.net/tracker/?func=detail&atid=302435&aid=3011968&group_id=2435
>>
>> Corresponding changeset in Mingw-cross-env:
>> http://hg.savannah.gnu.org/hgweb/mingw-cross-env/rev/682d860fa4e9
>
> This is not really a GCC build machinery patch (more of a C front-end  
> patch, or something like that), so I wouldn't approve it.  However, to  
> understand the issue better, is there a place where I can see the full  
> MinGW float.h?

Just download and unpack the current MinGW-Runtime dev package:

http://kent.dl.sourceforge.net/project/mingw/MinGW/BaseSystem/RuntimeLibrary/MinGW-RT/mingwrt-3.18/mingwrt-3.18-mingw32-dev.tar.gz

> It seems to me like a better way to fix this might be to rely on  
> fixincludes.

It would be great if you would join the discussion at the MinGW
bugtracker and restate your proposal there. The MinGW bugtracker
is where the technical discussion is currently happening. At the
moment it is currently unclear whether the MinGW people will accept
the patch or whether they seek for another solution:

http://sourceforge.net/tracker/?func=detail&atid=302435&aid=3011968&group_id=2435


Greets,
Volker

-- 
Volker Grabsch
---<<(())>>---
Administrator
NotJustHosting GbR

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

* Re: [Mingw-users] [Mingw-cross-env-list] Re: [patch] [ginclude]  cooperation between gcc's and mingw's float.h
  2010-06-20 15:25             ` Paolo Bonzini
  2010-06-20 15:55               ` Volker Grabsch
@ 2010-06-20 16:44               ` Doug Semler
  2010-06-20 20:47                 ` Joseph S. Myers
  1 sibling, 1 reply; 12+ messages in thread
From: Doug Semler @ 2010-06-20 16:44 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Volker Grabsch, Manuel López-Ibáñez,
	mingw-cross-env-list, Chris Sutcliffe, MinGW Users List,
	gcc-patches

On Sun, Jun 20, 2010 at 8:00 AM, Paolo Bonzini <bonzini@gnu.org> wrote:
> On 06/20/2010 01:50 PM, Volker Grabsch wrote:
>>
>> Paolo Bonzini<bonzini@gnu.org>  schrieb:
>>>
>>> On 06/19/2010 04:23 PM, Manuel López-Ibáñez wrote:
>>>>
>>>> On 9 June 2010 13:59, Chris Sutcliffe<ir0nh34d@gmail.com>   wrote:
>>>>>
>>>>> On 7 June 2010 13:10, Volker Grabsch wrote:
>>>>>>
>>>>>> To the GCC maintainers: Would you accept the patch if MinGW-RT
>>>>>>                         includes the other patch?
>>>>>>
>>>>
>>>> Perhaps the decision takers for this patch have not been specified
>>>> with sufficient clarity. It seems a build issue, so CCing a build
>>>> maintainer.
>>>
>>> What patch?  Archive link, please. :)
>>
>> Start of discussion in the GCC mailing list:
>> http://gcc.gnu.org/ml/gcc-patches/2010-06/msg00387.html
>>
>> Start of discussion in the MinGW bugtracker:
>>
>> http://sourceforge.net/tracker/?func=detail&atid=302435&aid=3011968&group_id=2435
>>
>> Corresponding changeset in Mingw-cross-env:
>> http://hg.savannah.gnu.org/hgweb/mingw-cross-env/rev/682d860fa4e9
>
> This is not really a GCC build machinery patch (more of a C front-end patch,
> or something like that), so I wouldn't approve it.  However, to understand
> the issue better, is there a place where I can see the full MinGW float.h?
>
> It seems to me like a better way to fix this might be to rely on
> fixincludes.
>

Mingw 64's float.h adds extensions to float.h for MS compatibility.  I
don't know about float.h from mingw.org but I believe it's similar
Unfortunately the fixincludes route doesn't work, because GCC's
float.h is included first, before the fixincludes headers so you run
into the exact same issue --- the runtime's float.h isn't ever
included.

So, either USER_H needs to be overriden in the gcc config/i386/t-*
makefile frags to prevent gcc from installing the float.h header, so
that mingw's float.h is used, or gcc's float.h needs to be changed so
that it include_next's mingw's float.h.  There is a third messy
method, which is employed by gcc's stdint.h header which does some
things based on the target.  (there is one more method, below).

The drawback to the USER_H method is the requirement that the runtime
maintain a copy of float.h that is pretty a copy of gcc's.  That leads
to one licensing issue that I can think of, and that is that the
runtime may only be compiled by gcc itself...and it also requires the
runtime to track the header for changes.  I vaguely recall that idea
being discussed at one point...

The only other method (mentioned above) that I can really think of
would be a hack to the CPP specs to -include _mingw.h, which would say
have the file included always, and then have that file include the
mingw specific extensions.  That seems to me to be a nasty hack,
though.

(Note that for mingw-64, this issue is also in stddef.h and stdarg.h.
However, stddef.h actually should probably have mingw-64's changes
incorporated into gcc's stddef.h since they are type sizing and
declarations that are specific for the architecture, like wint_t being
unsigned short not unsigned int, etc)

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

* Re: [Mingw-users] [Mingw-cross-env-list] Re: [patch] [ginclude]  cooperation between gcc's and mingw's float.h
  2010-06-20 16:44               ` Doug Semler
@ 2010-06-20 20:47                 ` Joseph S. Myers
  0 siblings, 0 replies; 12+ messages in thread
From: Joseph S. Myers @ 2010-06-20 20:47 UTC (permalink / raw)
  To: Doug Semler
  Cc: Paolo Bonzini, Volker Grabsch,
	Manuel López-Ibáñez, mingw-cross-env-list,
	Chris Sutcliffe, MinGW Users List, gcc-patches

On Sun, 20 Jun 2010, Doug Semler wrote:

> The drawback to the USER_H method is the requirement that the runtime
> maintain a copy of float.h that is pretty a copy of gcc's.  That leads

And this means keeping it updated with changes that are made in GCC's copy 
- for example, I recently added new C1X macros to GCC's float.h.  I don't 
generally recommend the USER_H approach.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

end of thread, other threads:[~2010-06-20 16:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-05 11:07 [patch] cooperation between gcc's and mingw's float.h Mark Brand
2010-06-07 16:13 ` Doug Semler
2010-06-07 17:10   ` [Mingw-cross-env-list] " Volker Grabsch
2010-06-09 12:15     ` [Mingw-users] " Chris Sutcliffe
2010-06-19 18:11       ` [Mingw-users] [Mingw-cross-env-list] Re: [patch] [ginclude] " Manuel López-Ibáñez
2010-06-19 20:11         ` Volker Grabsch
2010-06-20 13:20         ` Paolo Bonzini
2010-06-20 15:16           ` Volker Grabsch
2010-06-20 15:25             ` Paolo Bonzini
2010-06-20 15:55               ` Volker Grabsch
2010-06-20 16:44               ` Doug Semler
2010-06-20 20:47                 ` Joseph S. Myers

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