]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add pthread-in-libc, libpthread-routines-var, librt-routines-var
authorFlorian Weimer <fweimer@redhat.com>
Mon, 3 May 2021 06:12:11 +0000 (08:12 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 3 May 2021 06:13:32 +0000 (08:13 +0200)
These make variables can be used to add routines to different
libraries for the Hurd and Linux builds.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Makeconfig
config.h.in
config.make.in
configure
configure.ac
rt/Makefile
sysdeps/mach/hurd/configure
sysdeps/mach/hurd/configure.ac
sysdeps/pthread/Makefile

index 01f8638c2e12bd7a82ac90869d909e7438e63177..1d5e45926ca78d07980bb8fb47d2eae46f9f9a01 100644 (file)
@@ -1328,6 +1328,17 @@ endif
 sysd-rules-targets := $(sort $(foreach p,$(sysd-rules-patterns),\
                                         $(firstword $(subst :, ,$p))))
 
+# $(libpthread-routines-var) and $(librt-routines-var) are the make
+# variable to which pthread routines need to be added to land in the
+# right library.
+ifeq ($(pthread-in-libc),yes)
+libpthread-routines-var = routines
+librt-routines-var = routines
+else
+libpthread-routines-var = libpthread-routines
+librt-routines-var = libpthread-routines
+endif
+
 # A sysdeps Makeconfig fragment may set libc-reentrant to yes.
 ifeq (yes,$(libc-reentrant))
 defines += -D_LIBC_REENTRANT
index ea56e5b4a447c4b86265acc84f46a406ce348930..99036b887ffd508093a20a0792d383023ffd6bd9 100644 (file)
    multiple symbol versions for one symbol.  */
 #define SYMVER_NEEDS_ALIAS 0
 
+/* Define to 1 if libpthread actually resides in libc.  */
+#define PTHREAD_IN_LIBC 0
+
 /*
 \f */
 
index 7f47f0caa410691d61f6dbcb1e96608604d8b755..cbf59114b0b9ae4fdb8ec0cf0c39d11785562c05 100644 (file)
@@ -103,6 +103,7 @@ use-nscd = @use_nscd@
 build-hardcoded-path-in-tests= @hardcoded_path_in_tests@
 build-pt-chown = @build_pt_chown@
 have-tunables = @have_tunables@
+pthread-in-libc = @pthread_in_libc@
 
 # Build tools.
 CC = @CC@
index e64b7f8efed7494d01b79db020f19d9d9000e1e6..4cc462613c9f9e18c4a9d859445b1fe6404209c1 100755 (executable)
--- a/configure
+++ b/configure
@@ -588,6 +588,7 @@ ac_unique_file="include/features.h"
 enable_option_checking=no
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
+pthread_in_libc
 RELEASE
 VERSION
 mach_interface_list
@@ -6780,6 +6781,7 @@ libc_cv_sysconfdir=$sysconfdir
 libc_cv_localstatedir=$localstatedir
 libc_cv_gcc_unwind_find_fde=no
 libc_cv_idn=no
+pthread_in_libc=yes
 
 # Iterate over all the sysdep directories we will use, running their
 # configure fragments.
@@ -6939,6 +6941,12 @@ RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
 
 
 
+if test "$pthread_in_libc" = yes; then
+  $as_echo "#define PTHREAD_IN_LIBC 1" >>confdefs.h
+
+fi
+
+
 ac_config_files="$ac_config_files config.make Makefile"
 
 ac_config_commands="$ac_config_commands default"
index cc47e56e823437c1c436e7996f7c7f1b648444c5..64be29d87777bbede92507f25e8b484cafb0ae1b 100644 (file)
@@ -1777,6 +1777,7 @@ libc_cv_sysconfdir=$sysconfdir
 libc_cv_localstatedir=$localstatedir
 libc_cv_gcc_unwind_find_fde=no
 libc_cv_idn=no
+pthread_in_libc=yes
 
 # Iterate over all the sysdep directories we will use, running their
 # configure fragments.
@@ -1903,6 +1904,11 @@ RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
 AC_SUBST(VERSION)
 AC_SUBST(RELEASE)
 
+if test "$pthread_in_libc" = yes; then
+  AC_DEFINE(PTHREAD_IN_LIBC)
+fi
+AC_SUBST(pthread_in_libc)
+
 AC_CONFIG_FILES([config.make Makefile])
 AC_CONFIG_COMMANDS([default],[[
 case $CONFIG_FILES in *config.make*)
index 7b374f207333f14dbce97f731cff24c60cd795b1..c1a0fdeb46e081695fde3eb9a3ade5874f26f937 100644 (file)
@@ -39,6 +39,8 @@ librt-routines = $(aio-routines) \
                 $(timer-routines) \
                 $(shm-routines) $(mq-routines)
 
+$(librt-routines-var) = \
+
 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 \
index 537f2350773e519ece17c8085dc69ee774e8c539..4876e1f1760064d5b06b2cdf0f74f038d43960be 100644 (file)
@@ -45,3 +45,6 @@ fi
 if test -n "$sysheaders"; then
   CPPFLAGS=$OLD_CPPFLAGS
 fi
+
+# Hurd has libpthread as a separate library.
+pthread_in_libc=no
index eab0e5b6c1b368e2e292b457b747939371540e28..9a049b1d86de8e260a08daf15eb46dafd7bbd1a9 100644 (file)
@@ -26,3 +26,6 @@ fi
 if test -n "$sysheaders"; then
   CPPFLAGS=$OLD_CPPFLAGS
 fi
+
+# Hurd has libpthread as a separate library.
+pthread_in_libc=no
index ed15c1e433624f3a18dee0c2e34c324655b85cf4..8133bcda8f146751eb3c64842a4fd5a847694ce9 100644 (file)
@@ -39,6 +39,9 @@ libpthread-routines += thrd_create thrd_detach thrd_exit thrd_join \
                       cnd_destroy cnd_init cnd_signal cnd_timedwait cnd_wait \
                       tss_create tss_delete tss_get tss_set
 
+$(libpthread-routines-var) += \
+
+
 tests += tst-cnd-basic tst-mtx-trylock tst-cnd-broadcast \
         tst-cnd-timedwait tst-thrd-detach tst-mtx-basic tst-thrd-sleep \
         tst-mtx-recursive tst-tss-basic tst-call-once tst-mtx-timedlock \