public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Assume that _IO_MTSAFE_IO is always defined in libio/stdfiles.c
@ 2018-06-19  9:03 Florian Weimer
  2018-06-19  9:14 ` Andreas Schwab
  0 siblings, 1 reply; 10+ messages in thread
From: Florian Weimer @ 2018-06-19  9:03 UTC (permalink / raw)
  To: libc-alpha

2018-06-19  Florian Weimer  <fweimer@redhat.com>

	* libio/stdfiles.c (DEF_STDFILE): Assume that _IO_MTSAFE_IO is
	always defined.

diff --git a/libio/stdfiles.c b/libio/stdfiles.c
index 8d96f0b65c..18e1172ad0 100644
--- a/libio/stdfiles.c
+++ b/libio/stdfiles.c
@@ -33,22 +33,13 @@
 
 #include "libioP.h"
 
-#ifdef _IO_MTSAFE_IO
-# define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
+#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
   static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
   static struct _IO_wide_data _IO_wide_data_##FD \
     = { ._wide_vtable = &_IO_wfile_jumps }; \
   struct _IO_FILE_plus NAME \
     = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, &_IO_wide_data_##FD), \
        &_IO_file_jumps};
-#else
-# define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
-  static struct _IO_wide_data _IO_wide_data_##FD \
-    = { ._wide_vtable = &_IO_wfile_jumps }; \
-  struct _IO_FILE_plus NAME \
-    = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, &_IO_wide_data_##FD), \
-       &_IO_file_jumps};
-#endif
 
 DEF_STDFILE(_IO_2_1_stdin_, 0, 0, _IO_NO_WRITES);
 DEF_STDFILE(_IO_2_1_stdout_, 1, &_IO_2_1_stdin_, _IO_NO_READS);

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

* Re: [PATCH] Assume that _IO_MTSAFE_IO is always defined in libio/stdfiles.c
  2018-06-19  9:03 [PATCH] Assume that _IO_MTSAFE_IO is always defined in libio/stdfiles.c Florian Weimer
@ 2018-06-19  9:14 ` Andreas Schwab
  2018-06-19  9:17   ` Florian Weimer
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2018-06-19  9:14 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:

> 	* libio/stdfiles.c (DEF_STDFILE): Assume that _IO_MTSAFE_IO is
> 	always defined.

Why only here?

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

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

* Re: [PATCH] Assume that _IO_MTSAFE_IO is always defined in libio/stdfiles.c
  2018-06-19  9:14 ` Andreas Schwab
@ 2018-06-19  9:17   ` Florian Weimer
  2018-06-19  9:27     ` Andreas Schwab
  0 siblings, 1 reply; 10+ messages in thread
From: Florian Weimer @ 2018-06-19  9:17 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-alpha

* Andreas Schwab:

> On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:
>
>> 	* libio/stdfiles.c (DEF_STDFILE): Assume that _IO_MTSAFE_IO is
>> 	always defined.
>
> Why only here?

_IO_MTSAFE_IO has a bit of a checkered history.  Previous attempts at
removal failed when they encountered resistance in the form of parts
of the library that were *not* compiled with _IO_MTSAFE_IO.

I need to change DEF_STDFILE to fix bug 23313.

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

* Re: [PATCH] Assume that _IO_MTSAFE_IO is always defined in libio/stdfiles.c
  2018-06-19  9:17   ` Florian Weimer
@ 2018-06-19  9:27     ` Andreas Schwab
  2018-06-19  9:29       ` Florian Weimer
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2018-06-19  9:27 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:

> * Andreas Schwab:
>
>> On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:
>>
>>> 	* libio/stdfiles.c (DEF_STDFILE): Assume that _IO_MTSAFE_IO is
>>> 	always defined.
>>
>> Why only here?
>
> _IO_MTSAFE_IO has a bit of a checkered history.  Previous attempts at
> removal failed when they encountered resistance in the form of parts
> of the library that were *not* compiled with _IO_MTSAFE_IO.
>
> I need to change DEF_STDFILE to fix bug 23313.

That bug isn't even referenced here.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

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

* Re: [PATCH] Assume that _IO_MTSAFE_IO is always defined in libio/stdfiles.c
  2018-06-19  9:27     ` Andreas Schwab
@ 2018-06-19  9:29       ` Florian Weimer
  2018-06-19  9:31         ` Andreas Schwab
  0 siblings, 1 reply; 10+ messages in thread
From: Florian Weimer @ 2018-06-19  9:29 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-alpha

* Andreas Schwab:

> On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:
>
>> * Andreas Schwab:
>>
>>> On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:
>>>
>>>> 	* libio/stdfiles.c (DEF_STDFILE): Assume that _IO_MTSAFE_IO is
>>>> 	always defined.
>>>
>>> Why only here?
>>
>> _IO_MTSAFE_IO has a bit of a checkered history.  Previous attempts at
>> removal failed when they encountered resistance in the form of parts
>> of the library that were *not* compiled with _IO_MTSAFE_IO.
>>
>> I need to change DEF_STDFILE to fix bug 23313.
>
> That bug isn't even referenced here.

Yes, it's an independent change.

Is the patch okay?  I can rework the upcoming patch to change the dead
code, but I'd prefer the cleanup.

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

* Re: [PATCH] Assume that _IO_MTSAFE_IO is always defined in libio/stdfiles.c
  2018-06-19  9:29       ` Florian Weimer
@ 2018-06-19  9:31         ` Andreas Schwab
  2018-06-19  9:57           ` Florian Weimer
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2018-06-19  9:31 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:

> * Andreas Schwab:
>
>> On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:
>>
>>> * Andreas Schwab:
>>>
>>>> On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:
>>>>
>>>>> 	* libio/stdfiles.c (DEF_STDFILE): Assume that _IO_MTSAFE_IO is
>>>>> 	always defined.
>>>>
>>>> Why only here?
>>>
>>> _IO_MTSAFE_IO has a bit of a checkered history.  Previous attempts at
>>> removal failed when they encountered resistance in the form of parts
>>> of the library that were *not* compiled with _IO_MTSAFE_IO.
>>>
>>> I need to change DEF_STDFILE to fix bug 23313.
>>
>> That bug isn't even referenced here.
>
> Yes, it's an independent change.

I don't understand.  Either it fixes a bug or it is pointless.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

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

* Re: [PATCH] Assume that _IO_MTSAFE_IO is always defined in libio/stdfiles.c
  2018-06-19  9:31         ` Andreas Schwab
@ 2018-06-19  9:57           ` Florian Weimer
  2018-06-19 10:16             ` Andreas Schwab
  0 siblings, 1 reply; 10+ messages in thread
From: Florian Weimer @ 2018-06-19  9:57 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-alpha

* Andreas Schwab:

> On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:
>
>> * Andreas Schwab:
>>
>>> On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:
>>>
>>>> * Andreas Schwab:
>>>>
>>>>> On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:
>>>>>
>>>>>> 	* libio/stdfiles.c (DEF_STDFILE): Assume that _IO_MTSAFE_IO is
>>>>>> 	always defined.
>>>>>
>>>>> Why only here?
>>>>
>>>> _IO_MTSAFE_IO has a bit of a checkered history.  Previous attempts at
>>>> removal failed when they encountered resistance in the form of parts
>>>> of the library that were *not* compiled with _IO_MTSAFE_IO.
>>>>
>>>> I need to change DEF_STDFILE to fix bug 23313.
>>>
>>> That bug isn't even referenced here.
>>
>> Yes, it's an independent change.
>
> I don't understand.  Either it fixes a bug or it is pointless.

Please look at the other patch:

  <https://sourceware.org/ml/libc-alpha/2018-06/msg00543.html>

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

* Re: [PATCH] Assume that _IO_MTSAFE_IO is always defined in libio/stdfiles.c
  2018-06-19  9:57           ` Florian Weimer
@ 2018-06-19 10:16             ` Andreas Schwab
  2018-06-19 10:18               ` Florian Weimer
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2018-06-19 10:16 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:

> Please look at the other patch:
>
>   <https://sourceware.org/ml/libc-alpha/2018-06/msg00543.html>

And what do I see there?

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

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

* Re: [PATCH] Assume that _IO_MTSAFE_IO is always defined in libio/stdfiles.c
  2018-06-19 10:16             ` Andreas Schwab
@ 2018-06-19 10:18               ` Florian Weimer
  2018-06-19 10:30                 ` Andreas Schwab
  0 siblings, 1 reply; 10+ messages in thread
From: Florian Weimer @ 2018-06-19 10:18 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-alpha

* Andreas Schwab:

> On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:
>
>> Please look at the other patch:
>>
>>   <https://sourceware.org/ml/libc-alpha/2018-06/msg00543.html>
>
> And what do I see there?

The first hunk changes the definition of DEF_STDFILE:

| diff --git a/libio/stdfiles.c b/libio/stdfiles.c
| index 18e1172ad0..2435f412f2 100644
| --- a/libio/stdfiles.c
| +++ b/libio/stdfiles.c
| @@ -33,11 +33,19 @@
|  
|  #include "libioP.h"
|  
| +#ifdef SHARED
| +/* Place the variables defined below in a separate section for the
| +   interposition check in vtables.c.  */
| +# define STDFILE_SECTION __attribute__ ((section ("__libc_IO_stdfiles")))
| +#else
| +# define STDFILE_SECTION
| +#endif
| +
|  #define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
|    static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
|    static struct _IO_wide_data _IO_wide_data_##FD \
|      = { ._wide_vtable = &_IO_wfile_jumps }; \
| -  struct _IO_FILE_plus NAME \
| +  struct _IO_FILE_plus NAME STDFILE_SECTION \
|      = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, &_IO_wide_data_##FD), \
|         &_IO_file_jumps};

Without the cleanup, the change would have to happen in two places.

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

* Re: [PATCH] Assume that _IO_MTSAFE_IO is always defined in libio/stdfiles.c
  2018-06-19 10:18               ` Florian Weimer
@ 2018-06-19 10:30                 ` Andreas Schwab
  0 siblings, 0 replies; 10+ messages in thread
From: Andreas Schwab @ 2018-06-19 10:30 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

On Jun 19 2018, Florian Weimer <fw@deneb.enyo.de> wrote:

> Without the cleanup, the change would have to happen in two places.

And what's wrong with that?

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

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

end of thread, other threads:[~2018-06-19 10:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-19  9:03 [PATCH] Assume that _IO_MTSAFE_IO is always defined in libio/stdfiles.c Florian Weimer
2018-06-19  9:14 ` Andreas Schwab
2018-06-19  9:17   ` Florian Weimer
2018-06-19  9:27     ` Andreas Schwab
2018-06-19  9:29       ` Florian Weimer
2018-06-19  9:31         ` Andreas Schwab
2018-06-19  9:57           ` Florian Weimer
2018-06-19 10:16             ` Andreas Schwab
2018-06-19 10:18               ` Florian Weimer
2018-06-19 10:30                 ` Andreas Schwab

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