public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] cygwin: update child info magic
@ 2016-02-12  2:39 Yaakov Selkowitz
  2016-02-12  9:34 ` Corinna Vinschen
  0 siblings, 1 reply; 10+ messages in thread
From: Yaakov Selkowitz @ 2016-02-12  2:39 UTC (permalink / raw)
  To: cygwin-patches

	winsup/cygwin/
	* child_info.h (CURR_CHILD_INFO_MAGIC): Update.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
---
 winsup/cygwin/child_info.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/child_info.h b/winsup/cygwin/child_info.h
index ddd5b8b..c11040c 100644
--- a/winsup/cygwin/child_info.h
+++ b/winsup/cygwin/child_info.h
@@ -39,7 +39,7 @@ enum child_status
 #define EXEC_MAGIC_SIZE sizeof(child_info)
 
 /* Change this value if you get a message indicating that it is out-of-sync. */
-#define CURR_CHILD_INFO_MAGIC 0x30ea98f6U
+#define CURR_CHILD_INFO_MAGIC 0xf67f938cU
 
 #define NPROCS	256
 
-- 
2.7.0

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

* Re: [PATCH] cygwin: update child info magic
  2016-02-12  2:39 [PATCH] cygwin: update child info magic Yaakov Selkowitz
@ 2016-02-12  9:34 ` Corinna Vinschen
  2016-02-12 16:53   ` Yaakov Selkowitz
  0 siblings, 1 reply; 10+ messages in thread
From: Corinna Vinschen @ 2016-02-12  9:34 UTC (permalink / raw)
  To: cygwin-patches

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

On Feb 11 20:38, Yaakov Selkowitz wrote:
> 	winsup/cygwin/
> 	* child_info.h (CURR_CHILD_INFO_MAGIC): Update.
> 
> Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
> ---
>  winsup/cygwin/child_info.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/winsup/cygwin/child_info.h b/winsup/cygwin/child_info.h
> index ddd5b8b..c11040c 100644
> --- a/winsup/cygwin/child_info.h
> +++ b/winsup/cygwin/child_info.h
> @@ -39,7 +39,7 @@ enum child_status
>  #define EXEC_MAGIC_SIZE sizeof(child_info)
>  
>  /* Change this value if you get a message indicating that it is out-of-sync. */
> -#define CURR_CHILD_INFO_MAGIC 0x30ea98f6U
> +#define CURR_CHILD_INFO_MAGIC 0xf67f938cU

This needs an explanation.  CHILD_INFO_MAGIC is still 0x30ea98f6U
for me.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] cygwin: update child info magic
  2016-02-12  9:34 ` Corinna Vinschen
@ 2016-02-12 16:53   ` Yaakov Selkowitz
  2016-02-12 17:18     ` Corinna Vinschen
  0 siblings, 1 reply; 10+ messages in thread
From: Yaakov Selkowitz @ 2016-02-12 16:53 UTC (permalink / raw)
  To: cygwin-patches

On 2016-02-12 03:33, Corinna Vinschen wrote:
> On Feb 11 20:38, Yaakov Selkowitz wrote:
>> 	winsup/cygwin/
>> 	* child_info.h (CURR_CHILD_INFO_MAGIC): Update.
>
> This needs an explanation.  CHILD_INFO_MAGIC is still 0x30ea98f6U
> for me.

Hmmm, in that case it's either one of the patches I just sent or it's 
gcc-5.  How would either of those affect this?

-- 
Yaakov

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

* Re: [PATCH] cygwin: update child info magic
  2016-02-12 16:53   ` Yaakov Selkowitz
@ 2016-02-12 17:18     ` Corinna Vinschen
  2016-02-12 20:05       ` Yaakov Selkowitz
  0 siblings, 1 reply; 10+ messages in thread
From: Corinna Vinschen @ 2016-02-12 17:18 UTC (permalink / raw)
  To: cygwin-patches

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

On Feb 12 10:53, Yaakov Selkowitz wrote:
> On 2016-02-12 03:33, Corinna Vinschen wrote:
> >On Feb 11 20:38, Yaakov Selkowitz wrote:
> >>	winsup/cygwin/
> >>	* child_info.h (CURR_CHILD_INFO_MAGIC): Update.
> >
> >This needs an explanation.  CHILD_INFO_MAGIC is still 0x30ea98f6U
> >for me.
> 
> Hmmm, in that case it's either one of the patches I just sent or it's gcc-5.
> How would either of those affect this?

Off the top of my head, I don't know.  Usually only a change to
child_info.h should affect CHILD_INFO_MAGIC.  Unless the preprocessed
output of gcc differs for some reason.  You might want to compare the
output of gcc4 vs. gcc5 when called from cygmagic.  In general it
doesn't make sense if an identical structure definition results in
different checksums dependent on the compiler.  If push comes to shove
we have to change the cygmagic script to make sure the output fed to
cksum is independent on the compiler used (which I though it is, oh well).


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] cygwin: update child info magic
  2016-02-12 17:18     ` Corinna Vinschen
@ 2016-02-12 20:05       ` Yaakov Selkowitz
  2016-02-12 20:31         ` Corinna Vinschen
  2016-02-12 20:32         ` Eric Blake
  0 siblings, 2 replies; 10+ messages in thread
From: Yaakov Selkowitz @ 2016-02-12 20:05 UTC (permalink / raw)
  To: cygwin-patches

On 2016-02-12 11:18, Corinna Vinschen wrote:
> On Feb 12 10:53, Yaakov Selkowitz wrote:
>> On 2016-02-12 03:33, Corinna Vinschen wrote:
>>> On Feb 11 20:38, Yaakov Selkowitz wrote:
>>>> 	winsup/cygwin/
>>>> 	* child_info.h (CURR_CHILD_INFO_MAGIC): Update.
>>>
>>> This needs an explanation.  CHILD_INFO_MAGIC is still 0x30ea98f6U
>>> for me.
>>
>> Hmmm, in that case it's either one of the patches I just sent or it's gcc-5.
>> How would either of those affect this?
>
> Off the top of my head, I don't know.  Usually only a change to
> child_info.h should affect CHILD_INFO_MAGIC.  Unless the preprocessed
> output of gcc differs for some reason.

It turns out it does.  Anything that is substituted by preprocessor is 
placed on its own line with gcc-5, e.g. with NULL and _SYMSTR:

@@ -47340,7 +47636,11 @@
    char filler[4];
    child_info_fork ();
    void __attribute__((__stdcall__)) __attribute__ ((regparm (1))) 
handle_fork ();
-  bool abort (const char *fmt = __null, ...);
+  bool abort (const char *fmt =
+                               __null
+                                   , ...);
    void alloc_stack ();
  };

@@ -47422,6 +47722,14 @@

  extern "C" {
  extern child_info *child_proc_info;
-extern child_info_spawn *spawn_info asm ("_" "child_proc_info");
-extern child_info_fork *fork_info asm ("_" "child_proc_info");
+extern child_info_spawn *spawn_info asm (
+                                        "_"
+                                        "child_proc_info");
+extern child_info_fork *fork_info asm (
+                                      "_"
+                                      "child_proc_info");
  }

-- 
Yaakov

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

* Re: [PATCH] cygwin: update child info magic
  2016-02-12 20:05       ` Yaakov Selkowitz
@ 2016-02-12 20:31         ` Corinna Vinschen
  2016-02-12 20:34           ` Eric Blake
  2016-02-12 20:32         ` Eric Blake
  1 sibling, 1 reply; 10+ messages in thread
From: Corinna Vinschen @ 2016-02-12 20:31 UTC (permalink / raw)
  To: cygwin-patches

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

On Feb 12 14:05, Yaakov Selkowitz wrote:
> On 2016-02-12 11:18, Corinna Vinschen wrote:
> >On Feb 12 10:53, Yaakov Selkowitz wrote:
> >>On 2016-02-12 03:33, Corinna Vinschen wrote:
> >>>On Feb 11 20:38, Yaakov Selkowitz wrote:
> >>>>	winsup/cygwin/
> >>>>	* child_info.h (CURR_CHILD_INFO_MAGIC): Update.
> >>>
> >>>This needs an explanation.  CHILD_INFO_MAGIC is still 0x30ea98f6U
> >>>for me.
> >>
> >>Hmmm, in that case it's either one of the patches I just sent or it's gcc-5.
> >>How would either of those affect this?
> >
> >Off the top of my head, I don't know.  Usually only a change to
> >child_info.h should affect CHILD_INFO_MAGIC.  Unless the preprocessed
> >output of gcc differs for some reason.
> 
> It turns out it does.  Anything that is substituted by preprocessor is
> placed on its own line with gcc-5, e.g. with NULL and _SYMSTR:
> 
> @@ -47340,7 +47636,11 @@
>    char filler[4];
>    child_info_fork ();
>    void __attribute__((__stdcall__)) __attribute__ ((regparm (1)))
> handle_fork ();
> -  bool abort (const char *fmt = __null, ...);
> +  bool abort (const char *fmt =
> +                               __null
> +                                   , ...);
>    void alloc_stack ();
>  };
> 
> @@ -47422,6 +47722,14 @@
> 
>  extern "C" {
>  extern child_info *child_proc_info;
> -extern child_info_spawn *spawn_info asm ("_" "child_proc_info");
> -extern child_info_fork *fork_info asm ("_" "child_proc_info");
> +extern child_info_spawn *spawn_info asm (
> +                                        "_"
> +                                        "child_proc_info");
> +extern child_info_fork *fork_info asm (
> +                                      "_"
> +                                      "child_proc_info");
>  }

Is that deliberate or a bug?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] cygwin: update child info magic
  2016-02-12 20:05       ` Yaakov Selkowitz
  2016-02-12 20:31         ` Corinna Vinschen
@ 2016-02-12 20:32         ` Eric Blake
  2016-02-12 22:02           ` [PATCH v2] cygwin: work around GCC 5 preprocessor changes Yaakov Selkowitz
  1 sibling, 1 reply; 10+ messages in thread
From: Eric Blake @ 2016-02-12 20:32 UTC (permalink / raw)
  To: cygwin-patches

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

On 02/12/2016 01:05 PM, Yaakov Selkowitz wrote:

>> Off the top of my head, I don't know.  Usually only a change to
>> child_info.h should affect CHILD_INFO_MAGIC.  Unless the preprocessed
>> output of gcc differs for some reason.
> 
> It turns out it does.  Anything that is substituted by preprocessor is
> placed on its own line with gcc-5, e.g. with NULL and _SYMSTR:

Does the use of -P during preprocessing, to inhibit line markers, force
gcc to quit adding extra lines?

In my quick testing with Fedora's gcc 5.3.1:

$ printf '#include <stddef.h>\nstart NULL end\n' \
  | gcc -E    - | sed -n '/start/,$ p'
start
# 2 "<stdin>" 3 4
     ((void *)0)
# 2 "<stdin>"
          end

$ printf '#include <stddef.h>\nstart NULL end\n' \
  | gcc -E -P - | sed -n '/start/,$ p'
start ((void *)0) end

> -extern child_info_spawn *spawn_info asm ("_" "child_proc_info");
> -extern child_info_fork *fork_info asm ("_" "child_proc_info");
> +extern child_info_spawn *spawn_info asm (
> +                                        "_"

If it were merely a case of more vs. less whitespace, we could
postprocess (turn all newlines and space sequences into a single space);
but this is a case of introducing whitespace, making the problem
trickier, if -P doesn't work.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


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

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

* Re: [PATCH] cygwin: update child info magic
  2016-02-12 20:31         ` Corinna Vinschen
@ 2016-02-12 20:34           ` Eric Blake
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Blake @ 2016-02-12 20:34 UTC (permalink / raw)
  To: cygwin-patches

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

On 02/12/2016 01:31 PM, Corinna Vinschen wrote:

>>
>>  extern "C" {
>>  extern child_info *child_proc_info;
>> -extern child_info_spawn *spawn_info asm ("_" "child_proc_info");
>> -extern child_info_fork *fork_info asm ("_" "child_proc_info");
>> +extern child_info_spawn *spawn_info asm (
>> +                                        "_"
>> +                                        "child_proc_info");
>> +extern child_info_fork *fork_info asm (
>> +                                      "_"
>> +                                      "child_proc_info");
>>  }
> 
> Is that deliberate or a bug?

Deliberate. gcc 5 now adds additional #line directives around every
macro expansion that came from a different file, so that you can more
easily track which files were involved in macro expansion.  The output
here is show with #line directives filtered out, but it is a gcc feature.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


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

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

* [PATCH v2] cygwin: work around GCC 5 preprocessor changes
  2016-02-12 20:32         ` Eric Blake
@ 2016-02-12 22:02           ` Yaakov Selkowitz
  2016-02-13 15:59             ` Corinna Vinschen
  0 siblings, 1 reply; 10+ messages in thread
From: Yaakov Selkowitz @ 2016-02-12 22:02 UTC (permalink / raw)
  To: cygwin-patches

GCC 5 adds #line directives (and hence extra newlines) for macros
expansions, which confuses cygmagic.  Using the -P flag avoids
them entirely.

https://cygwin.com/ml/cygwin-patches/2016-q1/msg00016.html

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
---
 winsup/cygwin/cygmagic | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/cygmagic b/winsup/cygwin/cygmagic
index b945291..036c79c 100755
--- a/winsup/cygwin/cygmagic
+++ b/winsup/cygwin/cygmagic
@@ -24,7 +24,7 @@ sumit() {
 while [ -n "$1" ]; do
     define=$1; shift
     struct=$1; shift
-    sum=`$gcc -D__CYGMAGIC__ -E $file | sed -n "/^$struct/,/^};/p" | sed -e 's/[ 	]//g' -e '/^$/d' | sumit | awk '{printf "0x%xU", $1}'`
+    sum=`$gcc -D__CYGMAGIC__ -E -P $file | sed -n "/^$struct/,/^};/p" | sed -e 's/[ 	]//g' -e '/^$/d' | sumit | awk '{printf "0x%xU", $1}'`
     echo "#define $define $sum"
     curr=`sed -n "s/^#[ 	]*define CURR_$define[ 	][ 	]*\([^ 	][^ 	]*\)/\1/p" $file`
     [ "$curr" != "$sum" ] && echo "*** WARNING WARNING WARNING WARNING WARNING ***
-- 
2.7.0

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

* Re: [PATCH v2] cygwin: work around GCC 5 preprocessor changes
  2016-02-12 22:02           ` [PATCH v2] cygwin: work around GCC 5 preprocessor changes Yaakov Selkowitz
@ 2016-02-13 15:59             ` Corinna Vinschen
  0 siblings, 0 replies; 10+ messages in thread
From: Corinna Vinschen @ 2016-02-13 15:59 UTC (permalink / raw)
  To: cygwin-patches

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

On Feb 12 16:02, Yaakov Selkowitz wrote:
> GCC 5 adds #line directives (and hence extra newlines) for macros
> expansions, which confuses cygmagic.  Using the -P flag avoids
> them entirely.
> 
> https://cygwin.com/ml/cygwin-patches/2016-q1/msg00016.html
> 
> Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>

Applied.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-02-13 15:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-12  2:39 [PATCH] cygwin: update child info magic Yaakov Selkowitz
2016-02-12  9:34 ` Corinna Vinschen
2016-02-12 16:53   ` Yaakov Selkowitz
2016-02-12 17:18     ` Corinna Vinschen
2016-02-12 20:05       ` Yaakov Selkowitz
2016-02-12 20:31         ` Corinna Vinschen
2016-02-12 20:34           ` Eric Blake
2016-02-12 20:32         ` Eric Blake
2016-02-12 22:02           ` [PATCH v2] cygwin: work around GCC 5 preprocessor changes Yaakov Selkowitz
2016-02-13 15:59             ` Corinna Vinschen

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