public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Remove the ptw-% patterns
@ 2016-08-14 12:59 Florian Weimer
  0 siblings, 0 replies; 8+ messages in thread
From: Florian Weimer @ 2016-08-14 12:59 UTC (permalink / raw)
  To: libc-alpha

Nothing depends on the PTW macro anymore, so the mechanism to define
PTW for recompliations of libc routines is no longer needed.

(Reducing the number of pattern rules in sysd-rules is critical for
improving make performance.)

2016-08-14  Florian Weimer  <fweimer@redhat.com>

	Remove support for compiling wrappers with PTW.
	* sysdeps/nptl/Makeconfig: Drop ptw- support.
	* nptl/Makefile (pthread-compat-wrappers): Define.
	(libpthread-routines): Use pthread-compat-wrappers.
	* sysdeps/unix/sysv/linux/alpha/Makefile
	(libpthread-routines, libpthread-shared-only-routines): Remove
	ptw- prefix.
	* sysdeps/s390/nptl/Makefile
	(libpthread-routines, libpthread-shared-only-routines): Likewise.
	* sysdeps/ia64/nptl/Makefile
	(libpthread-routines, libpthread-shared-only-routines): Likewise.
	* sysdeps/nacl/Makefile (libpthread-routines): Use
	pthread-compat-wrappers to filter the routines list instead of the
	ptw- prefix.

diff --git a/nptl/Makefile b/nptl/Makefile
index 2ddcd2b..e8de1bc 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -33,6 +33,18 @@ routines = alloca_cutoff forward libc-lowlevellock libc-cancellation \
 	   register-atfork unregister-atfork
 shared-only-routines = forward
 
+# We need to provide certain routines for compatibility with existing
+# binaries.
+pthread-compat-wrappers = \
+		      write read close fcntl accept \
+		      connect recv recvfrom send \
+		      sendto fsync lseek llseek \
+		      msync nanosleep open open64 pause \
+		      pread pread64 pwrite pwrite64 \
+		      tcdrain wait waitpid msgrcv msgsnd \
+		      sigwait sigsuspend \
+		      recvmsg sendmsg
+
 libpthread-routines = nptl-init vars events version pt-interp \
 		      pthread_create pthread_exit pthread_detach \
 		      pthread_join pthread_tryjoin pthread_timedjoin \
@@ -108,14 +120,7 @@ libpthread-routines = nptl-init vars events version pt-interp \
 		      lowlevellock lowlevelrobustlock \
 		      lll_timedlock_wait lll_timedwait_tid \
 		      pt-fork pt-vfork \
-		      ptw-write ptw-read ptw-close ptw-fcntl ptw-accept \
-		      ptw-connect ptw-recv ptw-recvfrom ptw-send \
-		      ptw-sendto ptw-fsync ptw-lseek ptw-llseek \
-		      ptw-msync ptw-nanosleep ptw-open ptw-open64 ptw-pause \
-		      ptw-pread ptw-pread64 ptw-pwrite ptw-pwrite64 \
-		      ptw-tcdrain ptw-wait ptw-waitpid ptw-msgrcv ptw-msgsnd \
-		      ptw-sigwait ptw-sigsuspend \
-		      ptw-recvmsg ptw-sendmsg \
+		      $(pthread-compat-wrappers) \
 		      pt-raise pt-system \
 		      flockfile ftrylockfile funlockfile \
 		      sigaction \
diff --git a/sysdeps/ia64/nptl/Makefile b/sysdeps/ia64/nptl/Makefile
index 1e6be8e..4bc1a18 100644
--- a/sysdeps/ia64/nptl/Makefile
+++ b/sysdeps/ia64/nptl/Makefile
@@ -20,6 +20,6 @@ gen-as-const-headers += tcb-offsets.sym
 endif
 
 ifeq ($(subdir),nptl)
-libpthread-routines += ptw-sysdep ptw-sigblock ptw-sigprocmask
-libpthread-shared-only-routines += ptw-sysdep ptw-sigblock ptw-sigprocmask
+libpthread-routines += sysdep sigblock sigprocmask
+libpthread-shared-only-routines += sysdep sigblock sigprocmask
 endif
diff --git a/sysdeps/nacl/Makefile b/sysdeps/nacl/Makefile
index 71a4f8f..a25bd69 100644
--- a/sysdeps/nacl/Makefile
+++ b/sysdeps/nacl/Makefile
@@ -123,7 +123,8 @@ endif
 
 ifeq ($(subdir),nptl)
 # We do not need any wrappers in libpthread.
-libpthread-routines := $(filter-out ptw-%,$(libpthread-routines))
+libpthread-routines := \
+  $(filter-out $(pthread-compat-wrappers),$(libpthread-routines))
 endif
 
 ifeq ($(subdir),misc)
diff --git a/sysdeps/nptl/Makeconfig b/sysdeps/nptl/Makeconfig
index 2f4918d..babee94 100644
--- a/sysdeps/nptl/Makeconfig
+++ b/sysdeps/nptl/Makeconfig
@@ -26,7 +26,3 @@ shared-thread-library = $(common-objpfx)nptl/libpthread_nonshared.a \
 static-thread-library = $(common-objpfx)nptl/libpthread.a
 
 rpath-dirs += nptl
-
-# This makes for ptw-*.? object rules in sysd-rules.
-ptw-CPPFLAGS := -DPTW
-sysd-rules-patterns += ptw-%:%
diff --git a/sysdeps/s390/nptl/Makefile b/sysdeps/s390/nptl/Makefile
index 3a391c8..352edc0 100644
--- a/sysdeps/s390/nptl/Makefile
+++ b/sysdeps/s390/nptl/Makefile
@@ -20,6 +20,6 @@ gen-as-const-headers += tcb-offsets.sym
 endif
 
 ifeq ($(subdir),nptl)
-libpthread-routines += ptw-sysdep
-libpthread-shared-only-routines += ptw-sysdep
+libpthread-routines += sysdep
+libpthread-shared-only-routines += sysdep
 endif
diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile
index 3b523b7..1e858ce 100644
--- a/sysdeps/unix/sysv/linux/alpha/Makefile
+++ b/sysdeps/unix/sysv/linux/alpha/Makefile
@@ -39,6 +39,6 @@ endif   # math
 
 ifeq ($(subdir),nptl)
 # pull in __syscall_error routine, __sigprocmask, __syscall_rt_sigaction
-libpthread-routines += ptw-sysdep ptw-sigprocmask ptw-rt_sigaction
-libpthread-shared-only-routines += ptw-sysdep ptw-sigprocmask ptw-rt_sigaction
+libpthread-routines += sysdep sigprocmask rt_sigaction
+libpthread-shared-only-routines += sysdep sigprocmask rt_sigaction
 endif

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

* Re: [PATCH] Remove the ptw-% patterns
  2016-09-14 14:12         ` Florian Weimer
@ 2016-09-14 16:52           ` Carlos O'Donell
  0 siblings, 0 replies; 8+ messages in thread
From: Carlos O'Donell @ 2016-09-14 16:52 UTC (permalink / raw)
  To: Florian Weimer, Andreas Schwab; +Cc: libc-alpha

On 09/14/2016 10:12 AM, Florian Weimer wrote:
> On 09/13/2016 07:19 PM, Andreas Schwab wrote:
>> If that doesn't create any problems due to the duplicated module
>> names then this is ok.
> 
> We already duplicate sigaction (and likely others) in this way, so I
> don't expect any problems.  I also checked libpthread.a and
> libpthread.so before and after this change using “objdump -d”, and
> there are no changes in the disassembly.  Committed.

I'm happy to see us cut down on the number of auto-generated rules.

I think that if you can show no difference before an after on the generated
binary, that is should be an easy matter to just commit the changes. Since
these changes are usually generic. A quick grep might show any arch-specific
uses of some rules.

-- 
Cheers,
Carlos.

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

* Re: [PATCH] Remove the ptw-% patterns
  2016-09-13 17:20       ` Andreas Schwab
@ 2016-09-14 14:12         ` Florian Weimer
  2016-09-14 16:52           ` Carlos O'Donell
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Weimer @ 2016-09-14 14:12 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-alpha

On 09/13/2016 07:19 PM, Andreas Schwab wrote:
> If that doesn't create any problems due to the duplicated module names
> then this is ok.

We already duplicate sigaction (and likely others) in this way, so I 
don't expect any problems.  I also checked libpthread.a and 
libpthread.so before and after this change using “objdump -d”, and there 
are no changes in the disassembly.  Committed.

Thanks,
Florian

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

* Re: [PATCH] Remove the ptw-% patterns
  2016-09-13 13:10     ` Florian Weimer
@ 2016-09-13 17:20       ` Andreas Schwab
  2016-09-14 14:12         ` Florian Weimer
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2016-09-13 17:20 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

If that doesn't create any problems due to the duplicated module names
then this is ok.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [PATCH] Remove the ptw-% patterns
  2016-08-14 17:19   ` Florian Weimer
@ 2016-09-13 13:10     ` Florian Weimer
  2016-09-13 17:20       ` Andreas Schwab
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Weimer @ 2016-09-13 13:10 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-alpha

On 08/14/2016 07:19 PM, Florian Weimer wrote:
> On 08/14/2016 07:07 PM, Andreas Schwab wrote:
>> On Aug 14 2016, fweimer@redhat.com (Florian Weimer) wrote:
>>
>>> Nothing depends on the PTW macro anymore, so the mechanism to define
>>> PTW for recompliations of libc routines is no longer needed.
>>
>> There's more to them than that.  All the ptw-% objects are
>> IS_IN(libpthread) instead of IS_IN(libc).  Take a look at
>> sysdep-cancel.h for the difference.
>
> The objects are still recompiled.  I believe this is sufficient to make
> the IS_IN conditionals effective.

Andreas,

do you still object to the proposed change?

Thanks,
Florian

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

* Re: [PATCH] Remove the ptw-% patterns
  2016-08-14 17:08 ` Andreas Schwab
@ 2016-08-14 17:19   ` Florian Weimer
  2016-09-13 13:10     ` Florian Weimer
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Weimer @ 2016-08-14 17:19 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-alpha

On 08/14/2016 07:07 PM, Andreas Schwab wrote:
> On Aug 14 2016, fweimer@redhat.com (Florian Weimer) wrote:
>
>> Nothing depends on the PTW macro anymore, so the mechanism to define
>> PTW for recompliations of libc routines is no longer needed.
>
> There's more to them than that.  All the ptw-% objects are
> IS_IN(libpthread) instead of IS_IN(libc).  Take a look at
> sysdep-cancel.h for the difference.

The objects are still recompiled.  I believe this is sufficient to make 
the IS_IN conditionals effective.

Florian

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

* Re: [PATCH] Remove the ptw-% patterns
  2016-08-14 14:13 Florian Weimer
@ 2016-08-14 17:08 ` Andreas Schwab
  2016-08-14 17:19   ` Florian Weimer
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2016-08-14 17:08 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

On Aug 14 2016, fweimer@redhat.com (Florian Weimer) wrote:

> Nothing depends on the PTW macro anymore, so the mechanism to define
> PTW for recompliations of libc routines is no longer needed.

There's more to them than that.  All the ptw-% objects are
IS_IN(libpthread) instead of IS_IN(libc).  Take a look at
sysdep-cancel.h for the difference.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* [PATCH] Remove the ptw-% patterns
@ 2016-08-14 14:13 Florian Weimer
  2016-08-14 17:08 ` Andreas Schwab
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Weimer @ 2016-08-14 14:13 UTC (permalink / raw)
  To: libc-alpha

Nothing depends on the PTW macro anymore, so the mechanism to define
PTW for recompliations of libc routines is no longer needed.

(Reducing the number of pattern rules in sysd-rules is critical for
improving make performance.)

2016-08-14  Florian Weimer  <fweimer@redhat.com>

	Remove support for compiling wrappers with PTW.
	* sysdeps/nptl/Makeconfig: Drop ptw- support.
	* nptl/Makefile (pthread-compat-wrappers): Define.
	(libpthread-routines): Use pthread-compat-wrappers.
	* sysdeps/unix/sysv/linux/alpha/Makefile
	(libpthread-routines, libpthread-shared-only-routines): Remove
	ptw- prefix.
	* sysdeps/s390/nptl/Makefile
	(libpthread-routines, libpthread-shared-only-routines): Likewise.
	* sysdeps/ia64/nptl/Makefile
	(libpthread-routines, libpthread-shared-only-routines): Likewise.
	* sysdeps/nacl/Makefile (libpthread-routines): Use
	pthread-compat-wrappers to filter the routines list instead of the
	ptw- prefix.

diff --git a/nptl/Makefile b/nptl/Makefile
index 2ddcd2b..e8de1bc 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -33,6 +33,18 @@ routines = alloca_cutoff forward libc-lowlevellock libc-cancellation \
 	   register-atfork unregister-atfork
 shared-only-routines = forward
 
+# We need to provide certain routines for compatibility with existing
+# binaries.
+pthread-compat-wrappers = \
+		      write read close fcntl accept \
+		      connect recv recvfrom send \
+		      sendto fsync lseek llseek \
+		      msync nanosleep open open64 pause \
+		      pread pread64 pwrite pwrite64 \
+		      tcdrain wait waitpid msgrcv msgsnd \
+		      sigwait sigsuspend \
+		      recvmsg sendmsg
+
 libpthread-routines = nptl-init vars events version pt-interp \
 		      pthread_create pthread_exit pthread_detach \
 		      pthread_join pthread_tryjoin pthread_timedjoin \
@@ -108,14 +120,7 @@ libpthread-routines = nptl-init vars events version pt-interp \
 		      lowlevellock lowlevelrobustlock \
 		      lll_timedlock_wait lll_timedwait_tid \
 		      pt-fork pt-vfork \
-		      ptw-write ptw-read ptw-close ptw-fcntl ptw-accept \
-		      ptw-connect ptw-recv ptw-recvfrom ptw-send \
-		      ptw-sendto ptw-fsync ptw-lseek ptw-llseek \
-		      ptw-msync ptw-nanosleep ptw-open ptw-open64 ptw-pause \
-		      ptw-pread ptw-pread64 ptw-pwrite ptw-pwrite64 \
-		      ptw-tcdrain ptw-wait ptw-waitpid ptw-msgrcv ptw-msgsnd \
-		      ptw-sigwait ptw-sigsuspend \
-		      ptw-recvmsg ptw-sendmsg \
+		      $(pthread-compat-wrappers) \
 		      pt-raise pt-system \
 		      flockfile ftrylockfile funlockfile \
 		      sigaction \
diff --git a/sysdeps/ia64/nptl/Makefile b/sysdeps/ia64/nptl/Makefile
index 1e6be8e..4bc1a18 100644
--- a/sysdeps/ia64/nptl/Makefile
+++ b/sysdeps/ia64/nptl/Makefile
@@ -20,6 +20,6 @@ gen-as-const-headers += tcb-offsets.sym
 endif
 
 ifeq ($(subdir),nptl)
-libpthread-routines += ptw-sysdep ptw-sigblock ptw-sigprocmask
-libpthread-shared-only-routines += ptw-sysdep ptw-sigblock ptw-sigprocmask
+libpthread-routines += sysdep sigblock sigprocmask
+libpthread-shared-only-routines += sysdep sigblock sigprocmask
 endif
diff --git a/sysdeps/nacl/Makefile b/sysdeps/nacl/Makefile
index 71a4f8f..a25bd69 100644
--- a/sysdeps/nacl/Makefile
+++ b/sysdeps/nacl/Makefile
@@ -123,7 +123,8 @@ endif
 
 ifeq ($(subdir),nptl)
 # We do not need any wrappers in libpthread.
-libpthread-routines := $(filter-out ptw-%,$(libpthread-routines))
+libpthread-routines := \
+  $(filter-out $(pthread-compat-wrappers),$(libpthread-routines))
 endif
 
 ifeq ($(subdir),misc)
diff --git a/sysdeps/nptl/Makeconfig b/sysdeps/nptl/Makeconfig
index 2f4918d..babee94 100644
--- a/sysdeps/nptl/Makeconfig
+++ b/sysdeps/nptl/Makeconfig
@@ -26,7 +26,3 @@ shared-thread-library = $(common-objpfx)nptl/libpthread_nonshared.a \
 static-thread-library = $(common-objpfx)nptl/libpthread.a
 
 rpath-dirs += nptl
-
-# This makes for ptw-*.? object rules in sysd-rules.
-ptw-CPPFLAGS := -DPTW
-sysd-rules-patterns += ptw-%:%
diff --git a/sysdeps/s390/nptl/Makefile b/sysdeps/s390/nptl/Makefile
index 3a391c8..352edc0 100644
--- a/sysdeps/s390/nptl/Makefile
+++ b/sysdeps/s390/nptl/Makefile
@@ -20,6 +20,6 @@ gen-as-const-headers += tcb-offsets.sym
 endif
 
 ifeq ($(subdir),nptl)
-libpthread-routines += ptw-sysdep
-libpthread-shared-only-routines += ptw-sysdep
+libpthread-routines += sysdep
+libpthread-shared-only-routines += sysdep
 endif
diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile
index 3b523b7..1e858ce 100644
--- a/sysdeps/unix/sysv/linux/alpha/Makefile
+++ b/sysdeps/unix/sysv/linux/alpha/Makefile
@@ -39,6 +39,6 @@ endif   # math
 
 ifeq ($(subdir),nptl)
 # pull in __syscall_error routine, __sigprocmask, __syscall_rt_sigaction
-libpthread-routines += ptw-sysdep ptw-sigprocmask ptw-rt_sigaction
-libpthread-shared-only-routines += ptw-sysdep ptw-sigprocmask ptw-rt_sigaction
+libpthread-routines += sysdep sigprocmask rt_sigaction
+libpthread-shared-only-routines += sysdep sigprocmask rt_sigaction
 endif

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

end of thread, other threads:[~2016-09-14 16:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-14 12:59 [PATCH] Remove the ptw-% patterns Florian Weimer
2016-08-14 14:13 Florian Weimer
2016-08-14 17:08 ` Andreas Schwab
2016-08-14 17:19   ` Florian Weimer
2016-09-13 13:10     ` Florian Weimer
2016-09-13 17:20       ` Andreas Schwab
2016-09-14 14:12         ` Florian Weimer
2016-09-14 16:52           ` 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).