]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Linux: Cleanups after librt move
authorFlorian Weimer <fweimer@redhat.com>
Mon, 28 Jun 2021 07:51:01 +0000 (09:51 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 28 Jun 2021 07:51:01 +0000 (09:51 +0200)
librt.so is no longer installed for PTHREAD_IN_LIBC, and tests
are not linked against it.  $(librt) is introduced globally for
shared tests that need to be linked for both PTHREAD_IN_LIBC
and !PTHREAD_IN_LIBC.

GLIBC_PRIVATE symbols that were needed during the transition are
removed again.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
20 files changed:
elf/Makefile
misc/Makefile
nptl/Makefile
rt/Makefile
rt/Versions
rt/aio_misc.c
rt/aio_notify.c
rt/aio_sigqueue.c
sysdeps/generic/aio_misc.h
sysdeps/htl/Makeconfig
sysdeps/nptl/Makeconfig
sysdeps/pthread/Makefile
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/Versions
sysdeps/unix/sysv/linux/aio_sigqueue.c
sysdeps/unix/sysv/linux/kernel-posix-timers.h
sysdeps/unix/sysv/linux/timer_create.c
sysdeps/unix/sysv/linux/timer_routines.c
sysvipc/Makefile
time/Makefile

index cdbcc14087b6bbee193c9a9fac9e0786b36fc041..698a6ab9852da56ca4a86e8da1b286d25b79fd5a 100644 (file)
@@ -1174,7 +1174,6 @@ localplt-built-dso := $(addprefix $(common-objpfx),\
                                  libc.so \
                                  elf/ld.so \
                                  math/libm.so \
-                                 rt/librt.so \
                                  dlfcn/libdl.so \
                                  resolv/libresolv.so \
                       )
@@ -1187,6 +1186,9 @@ endif
 ifeq ($(build-crypt),yes)
 localplt-built-dso += $(addprefix $(common-objpfx), crypt/libcrypt.so)
 endif
+ifneq ($(pthread-in-libc),yes)
+localplt-built-dso += $(addprefix $(common-objpfx), rt/librt.so)
+endif
 
 vpath localplt.data $(+sysdep_dirs)
 
index 66586bcc7e293122832e6c0037c7b49700cd24c5..ae03e26f1b5b447a53a57e1bf991d7467171ab23 100644 (file)
@@ -148,12 +148,6 @@ CFLAGS-brk.op = $(no-stack-protector)
 
 include ../Rules
 
-ifeq (yes,$(build-shared))
-librt = $(common-objpfx)rt/librt.so
-else
-librt = $(common-objpfx)rt/librt.a
-endif
-
 $(objpfx)libg.a: $(dep-dummy-lib); $(make-dummy-lib)
 
 $(objpfx)tst-tsearch: $(libm)
index c64e4af2f6804af2c4d751582645a76b792f6e08..9b94bfcd3126d1d7e81fc557b961db7a392dc16c 100644 (file)
@@ -535,15 +535,6 @@ $(objpfx)tst-tls6.out: tst-tls6.sh $(objpfx)tst-tls5 \
        $(evaluate-test)
 endif
 
-ifeq (yes,$(build-shared))
-librt = $(common-objpfx)rt/librt.so
-else
-librt = $(common-objpfx)rt/librt.a
-endif
-
-$(objpfx)tst-cancel17: $(librt)
-$(objpfx)tst-cancelx17: $(librt)
-
 LDLIBS-tst-cancel24 = -Wl,--no-as-needed -lstdc++
 LDLIBS-tst-cancel24-static = $(LDLIBS-tst-cancel24)
 
index f8a47622d0f72b28a7284e0641c453e81bac1e01..113cea03a5b75613423253573d920011c39edd84 100644 (file)
@@ -28,9 +28,7 @@ routines = \
   shm_open \
   shm_unlink \
 
-librt-routines = \
-  librt-compat \
-
+librt-routines = librt-compat
 librt-shared-only-routines = librt-compat
 
 $(librt-routines-var) += \
@@ -64,6 +62,13 @@ $(librt-routines-var) += \
   timer_gettime \
   timer_settime \
 
+ifeq ($(pthread-in-libc),yes)
+# Pretend that librt.so is a linker script, so that the symbolic
+# link is not installed.
+install-lib-ldscripts = librt.so
+$(inst_libdir)/librt.so:
+endif
+
 tests := tst-shm tst-timer tst-timer2 \
         tst-aio tst-aio64 tst-aio2 tst-aio3 tst-aio4 tst-aio5 tst-aio6 \
         tst-aio7 tst-aio8 tst-aio9 tst-aio10 \
@@ -98,6 +103,7 @@ LDFLAGS-rt.so = -Wl,--enable-new-dtags,-z,nodelete
 
 $(objpfx)librt.so: $(shared-thread-library)
 
+ifneq ($(pthread-in-libc),yes)
 ifeq (yes,$(build-shared))
 $(addprefix $(objpfx),$(tests) $(tests-internal)): \
        $(objpfx)librt.so $(shared-thread-library)
@@ -105,5 +111,6 @@ else
 $(addprefix $(objpfx),$(tests)) $(tests-internal): \
        $(objpfx)librt.a $(static-thread-library)
 endif
+endif # !$(pthread-in-libc)
 
 tst-mqueue7-ARGS = -- $(host-test-program-cmd)
index 7e41beae06c31c06cea74005d916235c1d2fbe0b..a3dc72cff4224d2842da8f53f0f58a734d787731 100644 (file)
@@ -95,19 +95,6 @@ libc {
     shm_open;
     shm_unlink;
   }
-%if PTHREAD_IN_LIBC
-  GLIBC_PRIVATE {
-    __aio_enqueue_request;
-    __aio_find_req;
-    __aio_find_req_fd;
-    __aio_free_request;
-    __aio_notify;
-    __aio_notify_only;
-    __aio_remove_request;
-    __aio_requests_mutex;
-    __aio_sigqueue;
-  }
-%endif
 }
 librt {
   GLIBC_2.1 {
index 953d6e761328dd867738971da55a307e3e3a4594..acbd4f3623ee7756220ec119085fec5c24bd6a5f 100644 (file)
@@ -735,24 +735,10 @@ add_request_to_runlist (struct requestlist *newrequest)
 }
 
 #if PTHREAD_IN_LIBC
-libc_hidden_data_def (__aio_requests_mutex)
-libc_hidden_def (__aio_enqueue_request)
-libc_hidden_def (__aio_find_req)
-libc_hidden_def (__aio_find_req_fd)
-libc_hidden_def (__aio_free_request)
-libc_hidden_def (__aio_remove_request)
-
 versioned_symbol (libc, __aio_init, aio_init, GLIBC_2_34);
 # if OTHER_SHLIB_COMPAT (librt, GLIBC_2_1, GLIBC_2_34)
 compat_symbol (librt, __aio_init, aio_init, GLIBC_2_1);
 # endif
-
 #else /* !PTHREAD_IN_LIBC */
-librt_hidden_data_def (__aio_requests_mutex)
-librt_hidden_def (__aio_enqueue_request)
-librt_hidden_def (__aio_find_req)
-librt_hidden_def (__aio_find_req_fd)
-librt_hidden_def (__aio_free_request)
-librt_hidden_def (__aio_remove_request)
 weak_alias (__aio_init, aio_init)
 #endif /* !PTHREAD_IN_LIBC */
index 432000e34b38e35b4f797b1d82c4b93333a64c9f..0fa84f203c1d2fd78338c16b55b7c7a33d43e34e 100644 (file)
@@ -160,11 +160,3 @@ __aio_notify (struct requestlist *req)
       waitlist = next;
     }
 }
-
-#if PTHREAD_IN_LIBC
-libc_hidden_def (__aio_notify)
-libc_hidden_def (__aio_notify_only)
-#else
-librt_hidden_def (__aio_notify)
-librt_hidden_def (__aio_notify_only)
-#endif
index 0ad95ae04c6754ccb62ffc07dace52263a5ca127..84848bacd80be5aaf4f7c5a176e8846b48653341 100644 (file)
@@ -28,5 +28,4 @@ __aio_sigqueue (int sig, const union sigval val, pid_t caller_pid)
   __set_errno (ENOSYS);
   return -1;
 }
-librt_hidden_def (__aio_sigqueue)
 stub_warning (__aio_sigqueue)
index d9bff36e5028c750dfdb3d2cf8e5952f36ec8190..4d05b8cdd6f97b1f39e5fbb44d52afe09d97e60d 100644 (file)
@@ -87,55 +87,36 @@ struct requestlist
 
 
 /* Lock for global I/O list of requests.  */
-extern pthread_mutex_t __aio_requests_mutex;
+extern pthread_mutex_t __aio_requests_mutex attribute_hidden;
 
 
 /* Enqueue request.  */
 extern struct requestlist *__aio_enqueue_request (aiocb_union *aiocbp,
-                                                 int operation);
+                                                 int operation)
+  attribute_hidden;
 
 /* Find request entry for given AIO control block.  */
-extern struct requestlist *__aio_find_req (aiocb_union *elem);
+extern struct requestlist *__aio_find_req (aiocb_union *elem) attribute_hidden;
 
 /* Find request entry for given file descriptor.  */
-extern struct requestlist *__aio_find_req_fd (int fildes);
+extern struct requestlist *__aio_find_req_fd (int fildes) attribute_hidden;
 
 /* Remove request from the list.  */
 extern void __aio_remove_request (struct requestlist *last,
-                                 struct requestlist *req, int all);
+                                 struct requestlist *req, int all)
+  attribute_hidden;
 
 /* Release the entry for the request.  */
-extern void __aio_free_request (struct requestlist *req);
+extern void __aio_free_request (struct requestlist *req) attribute_hidden;
 
 /* Notify initiator of request and tell this everybody listening.  */
-extern void __aio_notify (struct requestlist *req);
+extern void __aio_notify (struct requestlist *req) attribute_hidden;
 
 /* Notify initiator of request.  */
-extern int __aio_notify_only (struct sigevent *sigev);
+extern int __aio_notify_only (struct sigevent *sigev) attribute_hidden;
 
 /* Send the signal.  */
-extern int __aio_sigqueue (int sig, const union sigval val, pid_t caller_pid);
-
-#if PTHREAD_IN_LIBC
-libc_hidden_proto (__aio_enqueue_request)
-libc_hidden_proto (__aio_find_req)
-libc_hidden_proto (__aio_find_req_fd)
-libc_hidden_proto (__aio_free_request)
-libc_hidden_proto (__aio_notify)
-libc_hidden_proto (__aio_notify_only)
-libc_hidden_proto (__aio_remove_request)
-libc_hidden_proto (__aio_requests_mutex)
-libc_hidden_proto (__aio_sigqueue)
-#else
-librt_hidden_proto (__aio_enqueue_request)
-librt_hidden_proto (__aio_find_req)
-librt_hidden_proto (__aio_find_req_fd)
-librt_hidden_proto (__aio_free_request)
-librt_hidden_proto (__aio_notify)
-librt_hidden_proto (__aio_notify_only)
-librt_hidden_proto (__aio_remove_request)
-librt_hidden_proto (__aio_requests_mutex)
-librt_hidden_proto (__aio_sigqueue)
-#endif
+extern int __aio_sigqueue (int sig, const union sigval val, pid_t caller_pid)
+  attribute_hidden;
 
 #endif /* aio_misc.h */
index e8a8f405b09d630e29310799855392d7fb191717..b5c5d62b74b31d082d90e0afb9f8ab8eaab4e695 100644 (file)
@@ -7,4 +7,10 @@ shared-thread-library = $(common-objpfx)htl/libpthread.so
 static-thread-library = $(..)htl/libpthread_syms.a $(common-objpfx)htl/libpthread.a
 bounded-thread-library = $(static-thread-library)
 
+ifeq (yes,$(build-shared))
+librt = $(common-objpfx)rt/librt.so
+else
+librt = $(common-objpfx)rt/librt.a $(static-thread-library)
+endif
+
 rpath-dirs += htl
index 8a9407925c0097585ec554f726d631672e2a15c0..613bd7b95bc68b9aa3872149d91c3fd3800efe90 100644 (file)
@@ -24,6 +24,7 @@ have-thread-library = yes
 # The thread library is integrated.
 shared-thread-library =
 static-thread-library =
+librt =
 
 # Some tests need this to load their own test objects, and system
 # libraries used by memusagestat need to link against the empty
index fedb785d38da331ee0064b3c19d8d3198522e24a..9b862b93c4c011789aaf13d0e5bbee04d09aa1f6 100644 (file)
 # <https://www.gnu.org/licenses/>.
 
 ifeq ($(subdir),rt)
-
-ifeq (yes,$(build-shared))
-$(objpfx)tst-timer: $(objpfx)librt.so $(shared-thread-library)
-else
-$(objpfx)tst-timer: $(objpfx)librt.a $(static-thread-library)
-endif
-
+$(objpfx)tst-timer: $(librt)
 endif
 
 ifneq (,$(filter $(subdir),htl nptl))
@@ -232,12 +226,10 @@ $(objpfx)tst-cleanup0.out: /dev/null $(objpfx)tst-cleanup0
 $(objpfx)tst-cleanup0-cmp.out: $(..)sysdeps/pthread/tst-cleanup0.expect $(objpfx)tst-cleanup0.out
        cmp $^ > $@; \
        $(evaluate-test)
-
-$(objpfx)tst-cancel28: $(common-objpfx)rt/librt.so
-else
-$(objpfx)tst-cancel28: $(common-objpfx)rt/librt.a
 endif
 
+$(objpfx)tst-cancel28: $(librt)
+
 $(objpfx)tst-fini1: $(shared-thread-library) $(objpfx)tst-fini1mod.so
 
 $(objpfx)tst-fini1mod.so: $(shared-thread-library)
index 88d7cd7c1ba2ca2f5e99e97e2feb399641aac3e0..faea02bd1be940b6766434b837ac6f99513e499e 100644 (file)
@@ -137,19 +137,6 @@ tests-time64 += \
 
 CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables
 
-ifeq (yes,$(build-shared))
-librt = $(common-objpfx)rt/librt.so
-else
-librt = $(common-objpfx)rt/librt.a
-endif
-
-$(objpfx)tst-ppoll: $(librt)
-$(objpfx)tst-ppoll-time64: $(librt)
-$(objpfx)tst-sigtimedwait: $(librt)
-$(objpfx)tst-sigtimedwait-time64: $(librt)
-$(objpfx)tst-timerfd: $(librt)
-$(objpfx)tst-timerfd-time64: $(librt)
-
 # Generate the list of SYS_* macros for the system calls (__NR_*
 # macros).  The file syscall-names.list contains all possible system
 # call names, and the generated header file produces SYS_* macros for
index 578d55e7fde9ad9a5ef124b47d888a12d23894b7..29ed24591d40443a000a2e7fe5263257715020c7 100644 (file)
@@ -291,12 +291,6 @@ libc {
     __pread64_nocancel;
     __close_nocancel;
     __sigtimedwait;
-    __timer_active_sigev_thread;
-    __timer_active_sigev_thread_lock;
-    __timer_compat_list;
-    __timer_helper_once;
-    __timer_helper_tid;
-    __timer_start_helper_thread;
     # functions used by nscd
     __netlink_assert_response;
   }
index bd0da6e763b11f5f6f848071a3af6e0d0d9c618c..0b0f3471978d59215e613e01b4ca86ac07b8d89d 100644 (file)
@@ -44,4 +44,3 @@ __aio_sigqueue (int sig, const union sigval val, pid_t caller_pid)
 
   return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid, sig, &info);
 }
-libc_hidden_def (__aio_sigqueue)
index 5799c1eaa3a9232fae0843c19026b421021a7101..9109166f298cd31949c30089000f15cc426ca027 100644 (file)
 extern int __no_posix_timers attribute_hidden;
 
 /* Callback to start helper thread.  */
-extern void __timer_start_helper_thread (void);
-libc_hidden_proto (__timer_start_helper_thread)
+extern void __timer_start_helper_thread (void) attribute_hidden;
 
 /* Control variable for helper thread creation.  */
-extern pthread_once_t __timer_helper_once;
-libc_hidden_proto (__timer_helper_once)
+extern pthread_once_t __timer_helper_once attribute_hidden;
 
 /* Called from fork so that the new subprocess re-creates the
    notification thread if necessary.  */
 void __timer_fork_subprocess (void) attribute_hidden;
 
 /* TID of the helper thread.  */
-extern pid_t __timer_helper_tid;
-libc_hidden_proto (__timer_helper_tid)
+extern pid_t __timer_helper_tid attribute_hidden;
 
 /* List of active SIGEV_THREAD timers.  */
-extern struct timer *__timer_active_sigev_thread;
-libc_hidden_proto (__timer_active_sigev_thread)
+extern struct timer *__timer_active_sigev_thread attribute_hidden;
+
 /* Lock for __timer_active_sigev_thread.  */
-extern pthread_mutex_t __timer_active_sigev_thread_lock;
-libc_hidden_proto (__timer_active_sigev_thread_lock)
+extern pthread_mutex_t __timer_active_sigev_thread_lock attribute_hidden;
 
 extern __typeof (timer_create) __timer_create;
 libc_hidden_proto (__timer_create)
@@ -118,5 +114,4 @@ timerid_to_kernel_timer (timer_t timerid)
 #if TIMER_T_WAS_INT_COMPAT
 # define OLD_TIMER_MAX 256
 extern timer_t __timer_compat_list[OLD_TIMER_MAX];
-libc_hidden_proto (__timer_compat_list)
 #endif
index 58099e32045761cfe7e6b3dc240ae30e930de30e..fb904a86e3496a093042da96d938ae24ef861e28 100644 (file)
@@ -146,8 +146,7 @@ compat_symbol (librt, ___timer_create, timer_create, GLIBC_2_3_3);
 # endif
 
 # if OTHER_SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_3_3)
-timer_t __timer_compat_list[OLD_TIMER_MAX] __attribute__ ((nocommon));
-libc_hidden_data_def (__timer_compat_list)
+timer_t __timer_compat_list[OLD_TIMER_MAX];
 
 int
 __timer_create_old (clockid_t clock_id, struct sigevent *evp, int *timerid)
index e0bb16937080dc50bed435fd217e3224d90d935b..30ad32b4fcae528ec2a5ec25b898d9b9494bea70 100644 (file)
 
 
 /* List of active SIGEV_THREAD timers.  */
-struct timer *__timer_active_sigev_thread __attribute__ ((nocommon));
-libc_hidden_data_def (__timer_active_sigev_thread)
+struct timer *__timer_active_sigev_thread;
 
 /* Lock for _timer_active_sigev_thread.  */
-pthread_mutex_t __timer_active_sigev_thread_lock __attribute__ ((nocommon))
-  = PTHREAD_MUTEX_INITIALIZER;
-libc_hidden_data_def (__timer_active_sigev_thread_lock)
+pthread_mutex_t __timer_active_sigev_thread_lock = PTHREAD_MUTEX_INITIALIZER;
 
 struct thread_start_data
 {
@@ -112,12 +109,10 @@ timer_helper_thread (void *arg)
 /* Control variable for helper thread creation.  */
 pthread_once_t __timer_helper_once __attribute__ ((nocommon))
   = PTHREAD_ONCE_INIT;
-libc_hidden_data_def (__timer_helper_once)
 
 
 /* TID of the helper thread.  */
 pid_t __timer_helper_tid __attribute__ ((nocommon));
-libc_hidden_data_def (__timer_helper_tid)
 
 
 /* Reset variables so that after a fork a new helper thread gets started.  */
@@ -159,4 +154,3 @@ __timer_start_helper_thread (void)
   /* No need for the attribute anymore.  */
   __pthread_attr_destroy (&attr);
 }
-libc_hidden_def (__timer_start_helper_thread)
index d2acb6a70b466932c891784a707f439744917e28..5f1995c05fb4a02aa9eca74358e24dbc28137917 100644 (file)
@@ -39,11 +39,5 @@ include ../Rules
 CFLAGS-msgrcv.c += -fexceptions -fasynchronous-unwind-tables
 CFLAGS-msgsnd.c += -fexceptions -fasynchronous-unwind-tables
 
-ifeq (yes,$(build-shared))
-librt = $(common-objpfx)rt/librt.so
-else
-librt = $(common-objpfx)rt/librt.a
-endif
-
 $(objpfx)test-sysvsem: $(librt)
 $(objpfx)test-sysvsem-time64: $(librt)
index 0bea84966c37805b65441884d1d37f0e0c48de5c..38e3a7f4c77ea27f1caf041b10e72251c2316a19 100644 (file)
@@ -86,12 +86,6 @@ $(objpfx)tst-strftime2.out: $(gen-locales)
 $(objpfx)tst-strftime3.out: $(gen-locales)
 endif
 
-ifeq (yes,$(build-shared))
-librt = $(common-objpfx)rt/librt.so
-else
-librt = $(common-objpfx)rt/librt.a
-endif
-
 $(objpfx)tst-clock_nanosleep: $(librt)
 $(objpfx)tst-clock_nanosleep-time64: $(librt)