public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Linux: Fix fcntl, ioctl, prctl redirects for _TIME_BITS=64 (bug 28182)
@ 2021-08-04  9:36 Florian Weimer
  2021-08-04 11:19 ` Andreas Schwab
  2021-08-05 13:47 ` Carlos O'Donell
  0 siblings, 2 replies; 6+ messages in thread
From: Florian Weimer @ 2021-08-04  9:36 UTC (permalink / raw)
  To: libc-alpha

__REDIRECT and __THROW are not compatible with C++ due to the ordering of the
__asm__ alias and the throw specifier. __REDIRECT_NTH has to be used
instead.

Fixes commit 8a40aff86ba5f64a3a84883e539cb67b ("io: Add time64 alias
for fcntl"), commit 82c395d91ea4f69120d453aeec398e30 ("misc: Add
time64 alias for ioctl"), commit b39ffab860cd743a82c91946619f1b8158
("Linux: Add time64 alias for prctl").

Tested on i686-linux-gnu and x86_64-linux-gnu.  Built with
build-many-glibcs.py.

---
 io/fcntl.h                          | 8 ++++----
 misc/sys/ioctl.h                    | 4 ++--
 sysdeps/unix/sysv/linux/sys/prctl.h | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/io/fcntl.h b/io/fcntl.h
index 8917a73b42..1c96f98f4d 100644
--- a/io/fcntl.h
+++ b/io/fcntl.h
@@ -187,10 +187,10 @@ extern int fcntl64 (int __fd, int __cmd, ...);
 # endif
 #else /* __USE_TIME_BITS64 */
 # ifdef __REDIRECT
-extern int __REDIRECT (fcntl, (int __fd, int __request, ...),
-		       __fcntl_time64)  __THROW;
-extern int __REDIRECT (fcntl64, (int __fd, int __request, ...),
-		       __fcntl_time64)  __THROW;
+extern int __REDIRECT_NTH (fcntl, (int __fd, int __request, ...),
+			   __fcntl_time64);
+extern int __REDIRECT_NTH (fcntl64, (int __fd, int __request, ...),
+			   __fcntl_time64);
 # else
 extern int __fcntl_time64 (int __fd, int __request, ...) __THROW;
 #  define fcntl64 __fcntl_time64
diff --git a/misc/sys/ioctl.h b/misc/sys/ioctl.h
index 6884d9925f..9945c1e918 100644
--- a/misc/sys/ioctl.h
+++ b/misc/sys/ioctl.h
@@ -42,8 +42,8 @@ __BEGIN_DECLS
 extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
 #else
 # ifdef __REDIRECT
-extern int __REDIRECT (ioctl, (int __fd, unsigned long int __request, ...),
-		       __ioctl_time64) __THROW;
+extern int __REDIRECT_NTH (ioctl, (int __fd, unsigned long int __request, ...),
+			   __ioctl_time64);
 # else
 extern int __ioctl_time64 (int __fd, unsigned long int __request, ...) __THROW;
 #  define ioctl __ioctl_time64
diff --git a/sysdeps/unix/sysv/linux/sys/prctl.h b/sysdeps/unix/sysv/linux/sys/prctl.h
index db88938b3a..f0e0d2f27f 100644
--- a/sysdeps/unix/sysv/linux/sys/prctl.h
+++ b/sysdeps/unix/sysv/linux/sys/prctl.h
@@ -42,7 +42,7 @@ __BEGIN_DECLS
 extern int prctl (int __option, ...) __THROW;
 #else
 # ifdef __REDIRECT
-extern int __REDIRECT (prctl, (int __option, ...), __prctl_time64) __THROW;
+extern int __REDIRECT_NTH (prctl, (int __option, ...), __prctl_time64);
 # else
 extern int __prctl_time64 (int __option,d ...) __THROW;
 #  define ioctl __prctl_time64


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

* Re: [PATCH] Linux: Fix fcntl, ioctl, prctl redirects for _TIME_BITS=64 (bug 28182)
  2021-08-04  9:36 [PATCH] Linux: Fix fcntl, ioctl, prctl redirects for _TIME_BITS=64 (bug 28182) Florian Weimer
@ 2021-08-04 11:19 ` Andreas Schwab
  2021-08-04 12:08   ` Zack Weinberg
  2021-08-05 13:49   ` Carlos O'Donell
  2021-08-05 13:47 ` Carlos O'Donell
  1 sibling, 2 replies; 6+ messages in thread
From: Andreas Schwab @ 2021-08-04 11:19 UTC (permalink / raw)
  To: Florian Weimer via Libc-alpha; +Cc: Florian Weimer

On Aug 04 2021, Florian Weimer via Libc-alpha wrote:

> __REDIRECT and __THROW are not compatible with C++ due to the ordering of the
> __asm__ alias and the throw specifier. __REDIRECT_NTH has to be used
> instead.

There should be a test so that this won't happen again.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH] Linux: Fix fcntl,  ioctl,  prctl redirects for _TIME_BITS=64 (bug 28182)
  2021-08-04 11:19 ` Andreas Schwab
@ 2021-08-04 12:08   ` Zack Weinberg
  2021-08-05 13:49   ` Carlos O'Donell
  1 sibling, 0 replies; 6+ messages in thread
From: Zack Weinberg @ 2021-08-04 12:08 UTC (permalink / raw)
  To: libc-alpha

On Wed, Aug 4, 2021, at 7:19 AM, Andreas Schwab wrote:
> On Aug 04 2021, Florian Weimer via Libc-alpha wrote:
> 
> > __REDIRECT and __THROW are not compatible with C++ due to the ordering of the
> > __asm__ alias and the throw specifier. __REDIRECT_NTH has to be used
> > instead.
> 
> There should be a test so that this won't happen again.

scripts/check-installed-headers.sh already verifies that installed headers are compilable as C++. It doesn’t test -D_TIME_BITS=64 currently though.

zw

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

* Re: [PATCH] Linux: Fix fcntl, ioctl, prctl redirects for _TIME_BITS=64 (bug 28182)
  2021-08-04  9:36 [PATCH] Linux: Fix fcntl, ioctl, prctl redirects for _TIME_BITS=64 (bug 28182) Florian Weimer
  2021-08-04 11:19 ` Andreas Schwab
@ 2021-08-05 13:47 ` Carlos O'Donell
  1 sibling, 0 replies; 6+ messages in thread
From: Carlos O'Donell @ 2021-08-05 13:47 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 8/4/21 5:36 AM, Florian Weimer via Libc-alpha wrote:
> __REDIRECT and __THROW are not compatible with C++ due to the ordering of the
> __asm__ alias and the throw specifier. __REDIRECT_NTH has to be used
> instead.
> 
> Fixes commit 8a40aff86ba5f64a3a84883e539cb67b ("io: Add time64 alias
> for fcntl"), commit 82c395d91ea4f69120d453aeec398e30 ("misc: Add
> time64 alias for ioctl"), commit b39ffab860cd743a82c91946619f1b8158
> ("Linux: Add time64 alias for prctl").
> 
> Tested on i686-linux-gnu and x86_64-linux-gnu.  Built with
> build-many-glibcs.py.

LGTM. Please backport this to release/2.34/master. I commented down-thread
regarding Andreas' requirement for a test case.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
 
> ---
>  io/fcntl.h                          | 8 ++++----
>  misc/sys/ioctl.h                    | 4 ++--
>  sysdeps/unix/sysv/linux/sys/prctl.h | 2 +-
>  3 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/io/fcntl.h b/io/fcntl.h
> index 8917a73b42..1c96f98f4d 100644
> --- a/io/fcntl.h
> +++ b/io/fcntl.h
> @@ -187,10 +187,10 @@ extern int fcntl64 (int __fd, int __cmd, ...);
>  # endif
>  #else /* __USE_TIME_BITS64 */
>  # ifdef __REDIRECT
> -extern int __REDIRECT (fcntl, (int __fd, int __request, ...),
> -		       __fcntl_time64)  __THROW;
> -extern int __REDIRECT (fcntl64, (int __fd, int __request, ...),
> -		       __fcntl_time64)  __THROW;
> +extern int __REDIRECT_NTH (fcntl, (int __fd, int __request, ...),
> +			   __fcntl_time64);
> +extern int __REDIRECT_NTH (fcntl64, (int __fd, int __request, ...),
> +			   __fcntl_time64);

OK.

>  # else
>  extern int __fcntl_time64 (int __fd, int __request, ...) __THROW;
>  #  define fcntl64 __fcntl_time64
> diff --git a/misc/sys/ioctl.h b/misc/sys/ioctl.h
> index 6884d9925f..9945c1e918 100644
> --- a/misc/sys/ioctl.h
> +++ b/misc/sys/ioctl.h
> @@ -42,8 +42,8 @@ __BEGIN_DECLS
>  extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
>  #else
>  # ifdef __REDIRECT
> -extern int __REDIRECT (ioctl, (int __fd, unsigned long int __request, ...),
> -		       __ioctl_time64) __THROW;
> +extern int __REDIRECT_NTH (ioctl, (int __fd, unsigned long int __request, ...),
> +			   __ioctl_time64);

OK.

>  # else
>  extern int __ioctl_time64 (int __fd, unsigned long int __request, ...) __THROW;
>  #  define ioctl __ioctl_time64
> diff --git a/sysdeps/unix/sysv/linux/sys/prctl.h b/sysdeps/unix/sysv/linux/sys/prctl.h
> index db88938b3a..f0e0d2f27f 100644
> --- a/sysdeps/unix/sysv/linux/sys/prctl.h
> +++ b/sysdeps/unix/sysv/linux/sys/prctl.h
> @@ -42,7 +42,7 @@ __BEGIN_DECLS
>  extern int prctl (int __option, ...) __THROW;
>  #else
>  # ifdef __REDIRECT
> -extern int __REDIRECT (prctl, (int __option, ...), __prctl_time64) __THROW;
> +extern int __REDIRECT_NTH (prctl, (int __option, ...), __prctl_time64);

OK.

>  # else
>  extern int __prctl_time64 (int __option,d ...) __THROW;
>  #  define ioctl __prctl_time64
> 


-- 
Cheers,
Carlos.


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

* Re: [PATCH] Linux: Fix fcntl, ioctl, prctl redirects for _TIME_BITS=64 (bug 28182)
  2021-08-04 11:19 ` Andreas Schwab
  2021-08-04 12:08   ` Zack Weinberg
@ 2021-08-05 13:49   ` Carlos O'Donell
  2021-08-05 14:01     ` Andreas Schwab
  1 sibling, 1 reply; 6+ messages in thread
From: Carlos O'Donell @ 2021-08-05 13:49 UTC (permalink / raw)
  To: Andreas Schwab, Florian Weimer via Libc-alpha; +Cc: Florian Weimer

On 8/4/21 7:19 AM, Andreas Schwab wrote:
> On Aug 04 2021, Florian Weimer via Libc-alpha wrote:
> 
>> __REDIRECT and __THROW are not compatible with C++ due to the ordering of the
>> __asm__ alias and the throw specifier. __REDIRECT_NTH has to be used
>> instead.
> 
> There should be a test so that this won't happen again.

While I agree with this sentiment, as 2.34 RM I would like to see these fixes
go into master and release/2.34/master immediately in order to correct any
downstream distro issues that relate to these headers.

I spoke with Florian off-line about this, and we both would like to see a
broader set of changes that do more verification for the installed headers.
So I think we will do this for glibc 2.35 as a broader set of changes.

Does that work for you?

-- 
Cheers,
Carlos.


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

* Re: [PATCH] Linux: Fix fcntl, ioctl, prctl redirects for _TIME_BITS=64 (bug 28182)
  2021-08-05 13:49   ` Carlos O'Donell
@ 2021-08-05 14:01     ` Andreas Schwab
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2021-08-05 14:01 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: Florian Weimer via Libc-alpha, Florian Weimer

On Aug 05 2021, Carlos O'Donell wrote:

> Does that work for you?

Sure.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

end of thread, other threads:[~2021-08-05 14:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04  9:36 [PATCH] Linux: Fix fcntl, ioctl, prctl redirects for _TIME_BITS=64 (bug 28182) Florian Weimer
2021-08-04 11:19 ` Andreas Schwab
2021-08-04 12:08   ` Zack Weinberg
2021-08-05 13:49   ` Carlos O'Donell
2021-08-05 14:01     ` Andreas Schwab
2021-08-05 13:47 ` Carlos O'Donell

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