public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 09/19] Remove IS_IN_nscd
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (5 preceding siblings ...)
  2014-08-21 10:58 ` [PATCH 11/19] Remove IS_IN_librt Siddhesh Poyarekar
@ 2014-08-21 10:58 ` Siddhesh Poyarekar
  2014-08-22 18:30   ` Roland McGrath
  2014-08-21 10:58 ` [PATCH 03/19] Auto-generate libc-modules.h Siddhesh Poyarekar
                   ` (13 subsequent siblings)
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Replace with IS_IN_MODULE (nscd).  Generated code unchanged on x86_64.

	* include/ifaddrs.h: Use IS_IN.
	* inet/check_pf.c: Likewise.
	* sysdeps/unix/sysv/linux/check_pf.c: Likewise.
	* nscd/Makefile (CPPFLAGS-nscd): Remove IS_IN_nscd.
---
 include/ifaddrs.h                  | 2 +-
 inet/check_pf.c                    | 2 +-
 nscd/Makefile                      | 2 +-
 sysdeps/unix/sysv/linux/check_pf.c | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/ifaddrs.h b/include/ifaddrs.h
index e1c6cac..2787f21 100644
--- a/include/ifaddrs.h
+++ b/include/ifaddrs.h
@@ -26,7 +26,7 @@ extern void __check_native (uint32_t a1_index, int *a1_native,
 			    uint32_t a2_index, int *a2_native)
   attribute_hidden;
 
-#ifdef IS_IN_nscd
+#if IS_IN (nscd)
 extern uint32_t __bump_nl_timestamp (void) attribute_hidden;
 #endif
 
diff --git a/inet/check_pf.c b/inet/check_pf.c
index b2934f7..c129463 100644
--- a/inet/check_pf.c
+++ b/inet/check_pf.c
@@ -62,7 +62,7 @@ __free_in6ai (struct in6addrinfo *in6ai)
 }
 
 
-#ifdef IS_IN_nscd
+#if IS_IN (nscd)
 uint32_t
 __bump_nl_timestamp (void)
 {
diff --git a/nscd/Makefile b/nscd/Makefile
index 7ab4e9d..40e99aa 100644
--- a/nscd/Makefile
+++ b/nscd/Makefile
@@ -79,7 +79,7 @@ CFLAGS-nscd_gethst_r.c = -fexceptions
 CFLAGS-nscd_getai.c = -fexceptions
 CFLAGS-nscd_initgroups.c = -fexceptions
 
-CPPFLAGS-nscd += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2 -DNOT_IN_libc=1
+CPPFLAGS-nscd += -D_FORTIFY_SOURCE=2 -DNOT_IN_libc
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
 CFLAGS-nscd += $(pie-ccflag)
diff --git a/sysdeps/unix/sysv/linux/check_pf.c b/sysdeps/unix/sysv/linux/check_pf.c
index c7fd9b0..8ec582e 100644
--- a/sysdeps/unix/sysv/linux/check_pf.c
+++ b/sysdeps/unix/sysv/linux/check_pf.c
@@ -65,7 +65,7 @@ static struct cached_data *cache;
 __libc_lock_define_initialized (static, lock);
 
 
-#ifdef IS_IN_nscd
+#if IS_IN (nscd)
 static uint32_t nl_timestamp;
 
 uint32_t
@@ -81,7 +81,7 @@ __bump_nl_timestamp (void)
 static inline uint32_t
 get_nl_timestamp (void)
 {
-#ifdef IS_IN_nscd
+#if IS_IN (nscd)
   return nl_timestamp;
 #elif defined USE_NSCD
   return __nscd_get_nl_timestamp ();
-- 
1.9.3

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

* [PATCH 05/19] Remove IN_LIB
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (9 preceding siblings ...)
  2014-08-21 10:58 ` [PATCH 06/19] Define IN_MODULE for translation units that define NOT_IN_libc Siddhesh Poyarekar
@ 2014-08-21 10:58 ` Siddhesh Poyarekar
  2014-08-22 18:26   ` Roland McGrath
  2014-08-21 10:58 ` [PATCH 17/19] Provide default definition for IS_IN when _LIBC is not defined Siddhesh Poyarekar
                   ` (9 subsequent siblings)
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Replace with IS_IN and IS_IN_LIB macros instead.  This change results
in a change in generated code, because it fixes a subtle bug.  The bug
was introduced when systemtap probes were added to lowlevellock.h,
which resulted in stap-probe.h being included in a number of places.
stap-probe.h always defines IN_LIB, which breaks a check in errno.h
and netdb.h since they rely on that macro to decide whether to
implement an internal version of a declaration or an external one.

The components that see a code change due to this are:

iconv_prog
libmemusage.so
libpcprofile.so
libSegFault.so
libutil.so.1
locale
localedef
nscd

All other built components (i.e. libc, libpthread, etc.) remain
unchanged by this on x86_64.

	* elf/Makefile (CPPFLAGS-.os): Remove IN_LIB.
	* elf/rtld-Rules (rtld-CPPFLAGS): Likewise.
	* extra-lib.mk (CPPFLAGS-$(lib)): Likewise.
	* include/libc-symbols.h (IS_IN_LIB): New macro.
	* include/errno.h: Use IS_IN_LIB instead of IN_LIB.
	* include/netdb.h: Likewise.
	* include/stap-probe.h: Remove all uses of IN_LIB.
---
 elf/Makefile           |  2 +-
 elf/rtld-Rules         |  2 +-
 extra-lib.mk           |  2 +-
 include/errno.h        |  4 ++--
 include/libc-symbols.h |  5 +++++
 include/netdb.h        |  4 ++--
 include/stap-probe.h   | 12 ------------
 7 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/elf/Makefile b/elf/Makefile
index f7d384d..c25bec0 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -437,7 +437,7 @@ CFLAGS-cache.c = $(SYSCONF-FLAGS)
 CFLAGS-rtld.c = $(SYSCONF-FLAGS)
 
 CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
-		     -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
+		     -DNOT_IN_libc=1 -DIS_IN_rtld=1)
 
 cpp-srcs-left := $(all-rtld-routines:=.os)
 lib := rtld
diff --git a/elf/rtld-Rules b/elf/rtld-Rules
index 4d78d90..d106048 100644
--- a/elf/rtld-Rules
+++ b/elf/rtld-Rules
@@ -144,6 +144,6 @@ lib := rtld
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
 # This here is the whole point of all the shenanigans.
-rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld
+rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1
 
 endif
diff --git a/extra-lib.mk b/extra-lib.mk
index fd8812c..c719bd9 100644
--- a/extra-lib.mk
+++ b/extra-lib.mk
@@ -106,4 +106,4 @@ ifneq (,$(cpp-srcs-left))
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 endif
 
-CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1 -DIN_LIB=$(lib)
+CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1
diff --git a/include/errno.h b/include/errno.h
index dbf2a61..8e60288 100644
--- a/include/errno.h
+++ b/include/errno.h
@@ -22,7 +22,7 @@
 #  define errno rtld_errno
 extern int rtld_errno attribute_hidden;
 
-# elif !defined NOT_IN_libc || defined IN_LIB
+# elif !defined NOT_IN_libc || IS_IN_LIB
 
 #  include <tls.h>
 
@@ -34,7 +34,7 @@ extern int rtld_errno attribute_hidden;
 #  endif
 extern __thread int errno attribute_tls_model_ie;
 
-# endif	/* !NOT_IN_libc || IN_LIB */
+# endif	/* !NOT_IN_libc || IS_IN_LIB */
 
 # define __set_errno(val) (errno = (val))
 
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 131d7eb..34702a7 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -24,6 +24,11 @@
 
 #define IS_IN(lib) (IN_MODULE == MODULE_##lib)
 
+/* Returns true if the current module is a versioned library.  Versioned
+   library names are culled from shlib-versions files are assigned a MODULE_*
+   value lower than MODULE_OTHERS_BEGIN.  */
+#define IS_IN_LIB (IN_MODULE < MODULE_OTHERS_BEGIN)
+
 /* This file's macros are included implicitly in the compilation of every
    file in the C library by -imacros.
 
diff --git a/include/netdb.h b/include/netdb.h
index a7960eb..eccdbe6 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -4,7 +4,7 @@
 
 #ifndef _ISOMAC
 /* Macros for accessing h_errno from inside libc.  */
-# if !defined NOT_IN_libc || defined IN_LIB
+# if !defined NOT_IN_libc || IS_IN_LIB
 #  undef  h_errno
 #  ifndef NOT_IN_libc
 #   define h_errno __libc_h_errno
@@ -12,7 +12,7 @@
 #   define h_errno h_errno	/* For #ifndef h_errno tests.  */
 #  endif
 extern __thread int h_errno attribute_tls_model_ie;
-# endif /* !NOT_IN_libc || IN_LIB */
+# endif /* !NOT_IN_libc || IS_IN_LIB */
 # define __set_h_errno(x) (h_errno = (x))
 
 libc_hidden_proto (hstrerror)
diff --git a/include/stap-probe.h b/include/stap-probe.h
index 150fc1e..6532b37 100644
--- a/include/stap-probe.h
+++ b/include/stap-probe.h
@@ -40,18 +40,6 @@
    architecture specific and can be found in the gdb and SystemTap
    source code.  */
 
-# ifndef NOT_IN_libc
-#  define IN_LIB	libc
-# elif !defined IN_LIB
-/* This is intentionally defined with extra unquoted commas in it so
-   that macro substitution will bomb out when it is used.  We don't
-   just use #error here, so that this header can be included by
-   other headers that use LIBC_PROBE inside their own macros.  We
-   only want such headers to fail to compile if those macros are
-   actually used in a context where IN_LIB has not been defined.  */
-#  define IN_LIB	,,,missing -DIN_LIB=... -- not extra-lib.mk?,,,
-# endif
-
 # define LIBC_PROBE(name, n, ...)	\
   LIBC_PROBE_1 (MODULE_NAME, name, n, ## __VA_ARGS__)
 
-- 
1.9.3

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

* [PATCH 14/19] Remove IS_IN_rtld
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (13 preceding siblings ...)
  2014-08-21 10:58 ` [PATCH 01/19] Add new macro IN_MODULE to identify module in which source is built Siddhesh Poyarekar
@ 2014-08-21 10:58 ` Siddhesh Poyarekar
  2014-08-22 19:34   ` Roland McGrath
  2014-08-21 11:17 ` [PATCH 19/19] Define NOT_IN when building outside glibc Siddhesh Poyarekar
                   ` (5 subsequent siblings)
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Replace with IS_IN (rtld).  Generated code is unchanged on
x86_64.

        * elf/Makefile (CPPFLAGS-.os): Remove IS_IN_rtld.
        * elf/dl-open.c: Use IS_IN (rtld) instead if IS_IN_rtld.
        * elf/rtld-Rules: Likewise.
        * elf/setup-vdso.h: Likewise.
        * include/assert.h: Likewise.
        * include/bits/stdlib-float.h: Likewise.
        * include/errno.h: Likewise.
        * include/sys/stat.h: Likewise.
        * include/unistd.h: Likewise.
        * sysdeps/aarch64/setjmp.S: Likewise.
        * sysdeps/alpha/setjmp.S: Likewise.
        * sysdeps/arm/__longjmp.S: Likewise.
        * sysdeps/arm/aeabi_unwind_cpp_pr1.c: Likewise.
        * sysdeps/arm/setjmp.S: Likewise.
        * sysdeps/arm/sysdep.h: Likewise.
        * sysdeps/generic/_itoa.h: Likewise.
        * sysdeps/generic/dl-sysdep.h: Likewise.
        * sysdeps/generic/ldsodefs.h: Likewise.
        * sysdeps/i386/dl-tls.h: Likewise.
        * sysdeps/i386/setjmp.S: Likewise.
        * sysdeps/m68k/setjmp.c: Likewise.
        * sysdeps/mach/hurd/dl-execstack.c: Likewise.
        * sysdeps/mach/hurd/opendir.c: Likewise.
        * sysdeps/posix/getcwd.c: Likewise.
        * sysdeps/posix/opendir.c: Likewise.
        * sysdeps/posix/profil.c: Likewise.
        * sysdeps/powerpc/dl-procinfo.h: Likewise.
        * sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S: Likewise.
        * sysdeps/powerpc/powerpc32/fpu/setjmp-common.S: Likewise.
        * sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h: Likewise.
        * sysdeps/powerpc/powerpc32/setjmp-common.S: Likewise.
        * sysdeps/powerpc/powerpc64/__longjmp-common.S: Likewise.
        * sysdeps/powerpc/powerpc64/setjmp-common.S: Likewise.
        * sysdeps/s390/dl-tls.h: Likewise.
        * sysdeps/s390/s390-32/setjmp.S: Likewise.
        * sysdeps/s390/s390-64/setjmp.S: Likewise.
        * sysdeps/sh/sh3/setjmp.S: Likewise.
        * sysdeps/sh/sh4/setjmp.S: Likewise.
        * sysdeps/unix/alpha/sysdep.h: Likewise.
        * sysdeps/unix/arm/sysdep.S: Likewise.
        * sysdeps/unix/i386/sysdep.S: Likewise.
        * sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise.
        * sysdeps/unix/sysv/linux/getcwd.c: Likewise.
        * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Likewise.
        * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
        * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise.
        * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
        * sysdeps/unix/sysv/linux/ia64/setjmp.S: Likewise.
        * sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise.
        * sysdeps/unix/sysv/linux/lowlevellock-futex.h: Likewise.
        * sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h: Likewise.
        * sysdeps/unix/sysv/linux/m68k/m68k-helpers.S: Likewise.
        * sysdeps/unix/sysv/linux/microblaze/lowlevellock.h: Likewise.
        * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
        * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Likewise.
        * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise.
        * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
        * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise.
        * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise.
        * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
        * sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise.
        * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
        * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise.
        * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
        * sysdeps/unix/sysv/linux/tile/lowlevellock.h: Likewise.
        * sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise.
        * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
        * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
        * sysdeps/unix/x86_64/sysdep.S: Likewise.
        * sysdeps/x86_64/setjmp.S: Likewise.
---
 elf/Makefile                                           |  2 +-
 elf/dl-open.c                                          |  2 +-
 elf/rtld-Rules                                         |  2 +-
 elf/setup-vdso.h                                       |  2 +-
 include/assert.h                                       |  2 +-
 include/bits/stdlib-float.h                            |  2 +-
 include/errno.h                                        |  2 +-
 include/sys/stat.h                                     |  2 +-
 include/unistd.h                                       |  2 +-
 sysdeps/aarch64/setjmp.S                               |  2 +-
 sysdeps/alpha/setjmp.S                                 |  2 +-
 sysdeps/arm/__longjmp.S                                |  4 ++--
 sysdeps/arm/aeabi_unwind_cpp_pr1.c                     |  6 +++---
 sysdeps/arm/setjmp.S                                   |  4 ++--
 sysdeps/arm/sysdep.h                                   |  2 +-
 sysdeps/generic/_itoa.h                                |  2 +-
 sysdeps/generic/dl-sysdep.h                            |  2 +-
 sysdeps/generic/ldsodefs.h                             | 14 +++++++-------
 sysdeps/i386/dl-tls.h                                  |  2 +-
 sysdeps/i386/setjmp.S                                  |  2 +-
 sysdeps/m68k/setjmp.c                                  |  2 +-
 sysdeps/mach/hurd/dl-execstack.c                       |  2 +-
 sysdeps/mach/hurd/opendir.c                            |  2 +-
 sysdeps/posix/getcwd.c                                 |  2 +-
 sysdeps/posix/opendir.c                                |  2 +-
 sysdeps/posix/profil.c                                 |  2 +-
 sysdeps/powerpc/dl-procinfo.h                          |  2 +-
 sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S       |  2 +-
 sysdeps/powerpc/powerpc32/fpu/setjmp-common.S          |  2 +-
 sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h |  2 +-
 sysdeps/powerpc/powerpc32/setjmp-common.S              |  2 +-
 sysdeps/powerpc/powerpc64/__longjmp-common.S           |  4 ++--
 sysdeps/powerpc/powerpc64/setjmp-common.S              |  8 ++++----
 sysdeps/s390/dl-tls.h                                  |  6 +++---
 sysdeps/s390/s390-32/setjmp.S                          | 10 +++++-----
 sysdeps/s390/s390-64/setjmp.S                          | 10 +++++-----
 sysdeps/sh/sh3/setjmp.S                                |  2 +-
 sysdeps/sh/sh4/setjmp.S                                |  2 +-
 sysdeps/unix/alpha/sysdep.h                            |  6 +++---
 sysdeps/unix/arm/sysdep.S                              |  4 ++--
 sysdeps/unix/i386/sysdep.S                             |  2 +-
 sysdeps/unix/sysv/linux/aarch64/sysdep.h               |  2 +-
 sysdeps/unix/sysv/linux/getcwd.c                       |  2 +-
 sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h       |  2 +-
 sysdeps/unix/sysv/linux/i386/lowlevellock.h            |  2 +-
 sysdeps/unix/sysv/linux/i386/sysdep.h                  |  2 +-
 sysdeps/unix/sysv/linux/ia64/lowlevellock.h            |  2 +-
 sysdeps/unix/sysv/linux/ia64/setjmp.S                  |  2 +-
 sysdeps/unix/sysv/linux/ia64/sysdep.h                  |  2 +-
 sysdeps/unix/sysv/linux/lowlevellock-futex.h           |  2 +-
 sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h          | 10 +++++-----
 sysdeps/unix/sysv/linux/m68k/m68k-helpers.S            |  2 +-
 sysdeps/unix/sysv/linux/microblaze/lowlevellock.h      |  2 +-
 sysdeps/unix/sysv/linux/powerpc/lowlevellock.h         |  2 +-
 sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h     |  2 +-
 sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h     |  2 +-
 sysdeps/unix/sysv/linux/s390/lowlevellock.h            |  2 +-
 sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h          |  2 +-
 sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h          |  2 +-
 sysdeps/unix/sysv/linux/sh/lowlevellock.h              |  2 +-
 sysdeps/unix/sysv/linux/sh/sysdep.h                    |  2 +-
 sysdeps/unix/sysv/linux/sparc/lowlevellock.h           |  2 +-
 sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h         |  4 ++--
 sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h         |  4 ++--
 sysdeps/unix/sysv/linux/tile/lowlevellock.h            |  2 +-
 sysdeps/unix/sysv/linux/tile/sysdep.h                  |  2 +-
 sysdeps/unix/sysv/linux/x86_64/lowlevellock.h          |  2 +-
 sysdeps/unix/sysv/linux/x86_64/sysdep.h                |  4 ++--
 sysdeps/unix/x86_64/sysdep.S                           |  2 +-
 sysdeps/x86_64/setjmp.S                                |  2 +-
 70 files changed, 104 insertions(+), 104 deletions(-)

diff --git a/elf/Makefile b/elf/Makefile
index 2781cc3..b739a97 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -439,7 +439,7 @@ CFLAGS-cache.c = $(SYSCONF-FLAGS)
 CFLAGS-rtld.c = $(SYSCONF-FLAGS)
 
 CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
-		     -DNOT_IN_libc=1 -DIS_IN_rtld=1)
+		     -DNOT_IN_libc=1)
 
 cpp-srcs-left := $(all-rtld-routines:=.os)
 lib := rtld
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 7cc4cc1..dec3d32 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -737,7 +737,7 @@ _dl_show_scope (struct link_map *l, int from)
   _dl_debug_printf ("\n");
 }
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 /* Return non-zero if ADDR lies within one of L's segments.  */
 int
 internal_function
diff --git a/elf/rtld-Rules b/elf/rtld-Rules
index d106048..4e7c9ef 100644
--- a/elf/rtld-Rules
+++ b/elf/rtld-Rules
@@ -144,6 +144,6 @@ lib := rtld
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
 # This here is the whole point of all the shenanigans.
-rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1
+rtld-CPPFLAGS := -DNOT_IN_libc=1
 
 endif
diff --git a/elf/setup-vdso.h b/elf/setup-vdso.h
index 1057cf0..a6dcc4e 100644
--- a/elf/setup-vdso.h
+++ b/elf/setup-vdso.h
@@ -99,7 +99,7 @@ setup_vdso (struct link_map *main_map __attribute__ ((unused)),
       /* Add the vDSO to the object list.  */
       _dl_add_to_namespace_list (l, LM_ID_BASE);
 
-# ifdef IS_IN_rtld
+# if IS_IN (rtld)
       /* Rearrange the list so this DSO appears after rtld_map.  */
       assert (l->l_next == NULL);
       assert (l->l_prev == main_map);
diff --git a/include/assert.h b/include/assert.h
index d0d9259..abe182f 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -20,7 +20,7 @@ extern void __assert_fail_base (const char *fmt, const char *assertion,
 				const char *function)
      __THROW  __attribute__ ((__noreturn__));
 
-# if !defined NOT_IN_libc || defined IS_IN_rtld
+# if !defined NOT_IN_libc || IS_IN (rtld)
 hidden_proto (__assert_fail)
 hidden_proto (__assert_perror_fail)
 # endif
diff --git a/include/bits/stdlib-float.h b/include/bits/stdlib-float.h
index d3f5c5b..3466314 100644
--- a/include/bits/stdlib-float.h
+++ b/include/bits/stdlib-float.h
@@ -1,4 +1,4 @@
 /* No floating-point inline functions in rtld.  */
-#ifndef IS_IN_rtld
+#if !IS_IN (rtld)
 # include <stdlib/bits/stdlib-float.h>
 #endif
diff --git a/include/errno.h b/include/errno.h
index 8e60288..d650a15 100644
--- a/include/errno.h
+++ b/include/errno.h
@@ -4,7 +4,7 @@
 
 #if defined _ERRNO_H && !defined _ISOMAC && !defined __cplusplus
 
-# ifdef IS_IN_rtld
+# if IS_IN (rtld)
 #  include <dl-sysdep.h>
 #  ifndef RTLD_PRIVATE_ERRNO
 #   error "dl-sysdep.h must define RTLD_PRIVATE_ERRNO!"
diff --git a/include/sys/stat.h b/include/sys/stat.h
index 7a65d60..a44fbec 100644
--- a/include/sys/stat.h
+++ b/include/sys/stat.h
@@ -12,7 +12,7 @@ extern __mode_t __umask (__mode_t __mask);
 extern int __mkdir (const char *__path, __mode_t __mode);
 extern int __mknod (const char *__path,
 		    __mode_t __mode, __dev_t __dev);
-#if !defined NOT_IN_libc || defined IS_IN_rtld
+#if !defined NOT_IN_libc || IS_IN (rtld)
 hidden_proto (__fxstat)
 hidden_proto (__fxstat64)
 hidden_proto (__lxstat)
diff --git a/include/unistd.h b/include/unistd.h
index 5a016b1..e63ee1c 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -151,7 +151,7 @@ libc_hidden_proto (__sbrk)
    environment variables that normally affect them.  */
 extern int __libc_enable_secure attribute_relro;
 extern int __libc_enable_secure_decided;
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 /* XXX The #ifdef should go.  */
 extern int __libc_enable_secure_internal attribute_relro attribute_hidden;
 #endif
diff --git a/sysdeps/aarch64/setjmp.S b/sysdeps/aarch64/setjmp.S
index d548dd5..8251868 100644
--- a/sysdeps/aarch64/setjmp.S
+++ b/sysdeps/aarch64/setjmp.S
@@ -63,7 +63,7 @@ ENTRY (__sigsetjmp)
 	mov	x2,  sp
 	str	x2,  [x0, #JB_SP<<3]
 #endif
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 	/* In ld.so we never save the signal mask */
 	mov	w0, #0
 	RET
diff --git a/sysdeps/alpha/setjmp.S b/sysdeps/alpha/setjmp.S
index 840b560..dfa147b 100644
--- a/sysdeps/alpha/setjmp.S
+++ b/sysdeps/alpha/setjmp.S
@@ -86,7 +86,7 @@ $sigsetjmp_local:
 	ldq	ra, 0(sp)
 	addq	sp, 16, sp
 	ret
-#elif defined IS_IN_rtld
+#elif IS_IN (rtld)
 	/* In ld.so we never save the signal mask.  */
 	mov	0, v0
 	ret
diff --git a/sysdeps/arm/__longjmp.S b/sysdeps/arm/__longjmp.S
index 27d1b71..1047cbe 100644
--- a/sysdeps/arm/__longjmp.S
+++ b/sysdeps/arm/__longjmp.S
@@ -76,7 +76,7 @@ ENTRY (__longjmp)
 #endif
 
 #ifdef NEED_HWCAP
-# ifdef IS_IN_rtld
+# if IS_IN (rtld)
 	ldr	a4, 1f
 	ldr	a3, .Lrtld_local_ro
 0:	add	a4, pc, a4
@@ -139,7 +139,7 @@ ENTRY (__longjmp)
 	DO_RET(lr)
 
 #ifdef NEED_HWCAP
-# ifdef IS_IN_rtld
+# if IS_IN (rtld)
 1:	.long	_GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
 .Lrtld_local_ro:
 	.long	C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
diff --git a/sysdeps/arm/aeabi_unwind_cpp_pr1.c b/sysdeps/arm/aeabi_unwind_cpp_pr1.c
index f650613..fa7e960 100644
--- a/sysdeps/arm/aeabi_unwind_cpp_pr1.c
+++ b/sysdeps/arm/aeabi_unwind_cpp_pr1.c
@@ -27,7 +27,7 @@ attribute_hidden
 void
 __aeabi_unwind_cpp_pr0 (void)
 {
-#ifndef IS_IN_rtld
+#if !IS_IN (rtld)
   abort ();
 #endif
 }
@@ -36,7 +36,7 @@ attribute_hidden
 void
 __aeabi_unwind_cpp_pr1 (void)
 {
-#ifndef IS_IN_rtld
+#if !IS_IN (rtld)
   abort ();
 #endif
 }
@@ -45,7 +45,7 @@ attribute_hidden
 void
 __aeabi_unwind_cpp_pr2 (void)
 {
-#ifndef IS_IN_rtld
+#if !IS_IN (rtld)
   abort ();
 #endif
 }
diff --git a/sysdeps/arm/setjmp.S b/sysdeps/arm/setjmp.S
index 17a16c9..59afb29 100644
--- a/sysdeps/arm/setjmp.S
+++ b/sysdeps/arm/setjmp.S
@@ -57,7 +57,7 @@ ENTRY (__sigsetjmp)
 
 #ifdef NEED_HWCAP
 	/* Check if we have a VFP unit.  */
-# ifdef IS_IN_rtld
+# if IS_IN (rtld)
 	ldr	a3, 1f
 	ldr	a4, .Lrtld_local_ro
 0:	add	a3, pc, a3
@@ -115,7 +115,7 @@ ENTRY (__sigsetjmp)
 	B	PLTJMP(C_SYMBOL_NAME(__sigjmp_save))
 
 #ifdef NEED_HWCAP
-# ifdef IS_IN_rtld
+# if IS_IN (rtld)
 1:	.long	_GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
 .Lrtld_local_ro:
 	.long	C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
diff --git a/sysdeps/arm/sysdep.h b/sysdeps/arm/sysdep.h
index f476d69..ebd6411 100644
--- a/sysdeps/arm/sysdep.h
+++ b/sysdeps/arm/sysdep.h
@@ -292,7 +292,7 @@
 #endif
 
 /* Pointer mangling support.  */
-#if (defined IS_IN_rtld || \
+#if (IS_IN (rtld) || \
      (!defined SHARED && (!defined NOT_IN_libc || IS_IN (libpthread))))
 # ifdef __ASSEMBLER__
 #  define PTR_MANGLE_LOAD(guard, tmp)					\
diff --git a/sysdeps/generic/_itoa.h b/sysdeps/generic/_itoa.h
index 98e91cc..8360baf 100644
--- a/sysdeps/generic/_itoa.h
+++ b/sysdeps/generic/_itoa.h
@@ -46,7 +46,7 @@ extern char *_itoa (unsigned long long int value, char *buflim,
 
 extern const char _itoa_upper_digits[];
 extern const char _itoa_lower_digits[];
-#if !defined NOT_IN_libc || defined IS_IN_rtld
+#if !defined NOT_IN_libc || IS_IN (rtld)
 hidden_proto (_itoa_upper_digits)
 hidden_proto (_itoa_lower_digits)
 #endif
diff --git a/sysdeps/generic/dl-sysdep.h b/sysdeps/generic/dl-sysdep.h
index ae0e4be..1d76aa6 100644
--- a/sysdeps/generic/dl-sysdep.h
+++ b/sysdeps/generic/dl-sysdep.h
@@ -27,7 +27,7 @@
    all the libc functions that ld.so uses are called without PLT and always
    get the versions linked into ld.so rather than the libc ones.  */
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 # define RTLD_PRIVATE_ERRNO 1
 #else
 # define RTLD_PRIVATE_ERRNO 0
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index e01df84..d3d4ff7 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -250,7 +250,7 @@ typedef void (*receiver_fct) (int, const char *, const char *);
 # define GL(name) _##name
 #else
 # define EXTERN
-# ifdef IS_IN_rtld
+# if IS_IN (rtld)
 #  define GL(name) _rtld_local._##name
 # else
 #  define GL(name) _rtld_global._##name
@@ -409,7 +409,7 @@ struct rtld_global
 #ifdef SHARED
 };
 # define __rtld_global_attribute__
-# ifdef IS_IN_rtld
+# if IS_IN (rtld)
 #  ifdef HAVE_SDATA_SECTION
 #   define __rtld_local_attribute__ \
 	    __attribute__ ((visibility ("hidden"), section (".sdata")))
@@ -428,7 +428,7 @@ extern struct rtld_global _rtld_global __rtld_global_attribute__;
 #ifndef SHARED
 # define GLRO(name) _##name
 #else
-# ifdef IS_IN_rtld
+# if IS_IN (rtld)
 #  define GLRO(name) _rtld_local_ro._##name
 # else
 #  define GLRO(name) _rtld_global_ro._##name
@@ -587,7 +587,7 @@ struct rtld_global_ro
   EXTERN int _dl_pointer_guard;
 };
 # define __rtld_global_attribute__
-# ifdef IS_IN_rtld
+# if IS_IN (rtld)
 #  define __rtld_local_attribute__ __attribute__ ((visibility ("hidden")))
 extern struct rtld_global_ro _rtld_local_ro
     attribute_relro __rtld_local_attribute__;
@@ -610,7 +610,7 @@ extern const ElfW(Phdr) *_dl_phdr;
 extern size_t _dl_phnum;
 #endif
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 /* This is the initial value of GL(dl_error_catch_tsd).
    A non-TLS libpthread will change it.  */
 extern void **_dl_initial_error_catch_tsd (void) __attribute__ ((const))
@@ -641,7 +641,7 @@ extern char **_dl_argv
      attribute_relro
 #endif
      ;
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 extern unsigned int _dl_skip_args attribute_hidden
 # ifndef DL_ARGV_NOT_RELRO
      attribute_relro
@@ -665,7 +665,7 @@ extern char **_dl_argv_internal attribute_hidden
 /* Flag set at startup and cleared when the last initializer has run.  */
 extern int _dl_starting_up;
 weak_extern (_dl_starting_up)
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 extern int _dl_starting_up_internal attribute_hidden;
 #endif
 
diff --git a/sysdeps/i386/dl-tls.h b/sysdeps/i386/dl-tls.h
index 7361372..48809a5 100644
--- a/sysdeps/i386/dl-tls.h
+++ b/sysdeps/i386/dl-tls.h
@@ -32,7 +32,7 @@ extern void *___tls_get_addr (tls_index *ti)
 extern void *___tls_get_addr_internal (tls_index *ti)
      __attribute__ ((__regparm__ (1))) attribute_hidden;
 
-# ifdef IS_IN_rtld
+# if IS_IN (rtld)
 /* The special thing about the x86 TLS ABI is that we have two
    variants of the __tls_get_addr function with different calling
    conventions.  The GNU version, which we are mostly concerned here,
diff --git a/sysdeps/i386/setjmp.S b/sysdeps/i386/setjmp.S
index 7204ce0..ad4d724 100644
--- a/sysdeps/i386/setjmp.S
+++ b/sysdeps/i386/setjmp.S
@@ -46,7 +46,7 @@ ENTRY (__sigsetjmp)
 	movl %ecx, (JB_PC*4)(%eax)
 	movl %ebp, (JB_BP*4)(%eax) /* Save caller's frame pointer.  */
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 	/* In ld.so we never save the signal mask.  */
 	xorl %eax, %eax
 	ret
diff --git a/sysdeps/m68k/setjmp.c b/sysdeps/m68k/setjmp.c
index 4ba50a1..cc4d8bd 100644
--- a/sysdeps/m68k/setjmp.c
+++ b/sysdeps/m68k/setjmp.c
@@ -57,7 +57,7 @@ __sigsetjmp (jmp_buf env, int savemask)
 		: : "m" (env[0].__jmpbuf[0].__fpregs[0]));
 #endif
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
   /* In ld.so we never save the signal mask.  */
   return 0;
 #else
diff --git a/sysdeps/mach/hurd/dl-execstack.c b/sysdeps/mach/hurd/dl-execstack.c
index 9069efb..c67b534 100644
--- a/sysdeps/mach/hurd/dl-execstack.c
+++ b/sysdeps/mach/hurd/dl-execstack.c
@@ -34,7 +34,7 @@ _dl_make_stack_executable (void **stack_endp)
     return EPERM;
   *stack_endp = NULL;
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
   if (__mprotect ((void *)_dl_hurd_data->stack_base, _dl_hurd_data->stack_size,
 		  PROT_READ|PROT_WRITE|PROT_EXEC) != 0)
     return errno;
diff --git a/sysdeps/mach/hurd/opendir.c b/sysdeps/mach/hurd/opendir.c
index 570f085..a2c73bc 100644
--- a/sysdeps/mach/hurd/opendir.c
+++ b/sysdeps/mach/hurd/opendir.c
@@ -82,7 +82,7 @@ __opendirat (int dfd, const char *name)
 
   int flags = O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC;
   int fd;
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
   assert (dfd == AT_FDCWD);
   fd = open_not_cancel_2 (name, flags);
 #else
diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c
index 6201916..e1f09cf 100644
--- a/sysdeps/posix/getcwd.c
+++ b/sysdeps/posix/getcwd.c
@@ -206,7 +206,7 @@ extern char *alloca ();
 
 #ifdef __ASSUME_ATFCTS
 # define __have_atfcts 1
-#elif defined IS_IN_rtld
+#elif IS_IN (rtld)
 static int __rtld_have_atfcts;
 # define __have_atfcts __rtld_have_atfcts
 #endif
diff --git a/sysdeps/posix/opendir.c b/sysdeps/posix/opendir.c
index 2740b3a..be234bd 100644
--- a/sysdeps/posix/opendir.c
+++ b/sysdeps/posix/opendir.c
@@ -122,7 +122,7 @@ __opendirat (int dfd, const char *name)
   flags |= O_CLOEXEC;
 #endif
   int fd;
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
   assert (dfd == AT_FDCWD);
   fd = open_not_cancel_2 (name, flags);
 #else
diff --git a/sysdeps/posix/profil.c b/sysdeps/posix/profil.c
index 696c7a6..54ace22 100644
--- a/sysdeps/posix/profil.c
+++ b/sysdeps/posix/profil.c
@@ -64,7 +64,7 @@ __profil (u_short *sample_buffer, size_t size, size_t offset, u_int scale)
 {
   struct sigaction act;
   struct itimerval timer;
-#ifndef IS_IN_rtld
+#if !IS_IN (rtld)
   static struct sigaction oact;
   static struct itimerval otimer;
 # define oact_ptr &oact
diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
index 0333831..5f8d9ab 100644
--- a/sysdeps/powerpc/dl-procinfo.h
+++ b/sysdeps/powerpc/dl-procinfo.h
@@ -166,7 +166,7 @@ _dl_string_platform (const char *str)
   return -1;
 }
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 static inline int
 __attribute__ ((unused))
 _dl_procinfo (unsigned int type, unsigned long int word)
diff --git a/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S b/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
index 088e389..d8e4682 100644
--- a/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
+++ b/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
@@ -35,7 +35,7 @@ ENTRY (__longjmp_symbol)
 	addis	r5,r5,_GLOBAL_OFFSET_TABLE_-got_label@ha
 	addi	r5,r5,_GLOBAL_OFFSET_TABLE_-got_label@l
 #  ifdef SHARED
-#   ifdef IS_IN_rtld
+#   if IS_IN (rtld)
 	/* Inside ld.so we use the local alias to avoid runtime GOT
 	   relocations.  */
 	lwz     r5,_rtld_local_ro@got(r5)
diff --git a/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S b/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
index 926a1b1..720da09 100644
--- a/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
+++ b/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
@@ -91,7 +91,7 @@ ENTRY (__sigsetjmp_symbol)
 	mtlr	r6
 	cfi_same_value (lr)
 #  ifdef SHARED
-#   ifdef IS_IN_rtld
+#   if IS_IN (rtld)
 	/* Inside ld.so we use the local alias to avoid runtime GOT
 	   relocations.  */
 	lwz     r5,_rtld_local_ro@got(r5)
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h b/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
index 72d720d..ca479d8 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
@@ -21,7 +21,7 @@
    the dl_hwcap field. The assembly is to make the compiler not optimize the
    test (&_rtld_global_ro != NULL), which is always true in ISO C (but not
    in that case since _rtld_global_ro might not been realocated yet).  */
-#if defined(SHARED) && !defined(IS_IN_rtld)
+#if defined(SHARED) && !IS_IN (rtld)
 # define __GLRO(value) \
   ({ volatile void **__p = (volatile void**)(&_rtld_global_ro);	\
     unsigned long int __ret;					\
diff --git a/sysdeps/powerpc/powerpc32/setjmp-common.S b/sysdeps/powerpc/powerpc32/setjmp-common.S
index 681b540..50ff436 100644
--- a/sysdeps/powerpc/powerpc32/setjmp-common.S
+++ b/sysdeps/powerpc/powerpc32/setjmp-common.S
@@ -69,7 +69,7 @@ ENTRY (__sigsetjmp_symbol)
 	SAVE_GP (29)
 	SAVE_GP (30)
 	SAVE_GP (31)
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 	li   r3,0
 	blr
 #else
diff --git a/sysdeps/powerpc/powerpc64/__longjmp-common.S b/sysdeps/powerpc/powerpc64/__longjmp-common.S
index 9452a3c..e489224 100644
--- a/sysdeps/powerpc/powerpc64/__longjmp-common.S
+++ b/sysdeps/powerpc/powerpc64/__longjmp-common.S
@@ -30,7 +30,7 @@
 	.section	".toc","aw"
 .LC__dl_hwcap:
 # ifdef SHARED
-#  ifdef IS_IN_rtld
+#  if IS_IN (rtld)
 	/* Inside ld.so we use the local alias to avoid runtime GOT
 	   relocations.  */
 	.tc _rtld_local_ro[TC],_rtld_local_ro
@@ -130,7 +130,7 @@ L(no_vmx):
 	ld r0,(JB_LR*8)(r3)
 	ld r14,((JB_GPRS+0)*8)(r3)
 	lfd fp14,((JB_FPRS+0)*8)(r3)
-#if defined SHARED && !defined IS_IN_rtld
+#if defined SHARED && !IS_IN (rtld)
 	std r2,FRAME_TOC_SAVE(r1)	/* Restore the callers TOC save area.  */
 #endif
 	ld r15,((JB_GPRS+1)*8)(r3)
diff --git a/sysdeps/powerpc/powerpc64/setjmp-common.S b/sysdeps/powerpc/powerpc64/setjmp-common.S
index 704ee97..5979cde 100644
--- a/sysdeps/powerpc/powerpc64/setjmp-common.S
+++ b/sysdeps/powerpc/powerpc64/setjmp-common.S
@@ -29,7 +29,7 @@
 	.section	".toc","aw"
 .LC__dl_hwcap:
 # ifdef SHARED
-#  ifdef IS_IN_rtld
+#  if IS_IN (rtld)
 	/* Inside ld.so we use the local alias to avoid runtime GOT
 	   relocations.  */
 	.tc _rtld_local_ro[TC],_rtld_local_ro
@@ -49,7 +49,7 @@ ENTRY (setjmp_symbol)
 	b JUMPTARGET (GLUE(__sigsetjmp_symbol,_ent))
 END (setjmp_symbol)
 
-#if defined SHARED && !defined IS_IN_rtld && !defined __NO_VMX__
+#if defined SHARED && !IS_IN (rtld) && !defined __NO_VMX__
 /* When called from within libc we need a special version of _setjmp
    that saves r2 since the call won't go via a plt call stub.  See
    bugz #269.  __GI__setjmp is used in csu/libc-start.c when
@@ -80,7 +80,7 @@ JUMPTARGET(GLUE(__sigsetjmp_symbol,_ent)):
 	std  r1,(JB_GPR1*8)(3)
 #endif
 	mflr r0
-#if defined SHARED && !defined IS_IN_rtld
+#if defined SHARED && !IS_IN (rtld)
 	ld   r5,FRAME_TOC_SAVE(r1)	/* Retrieve the callers TOC.  */
 	std  r5,(JB_GPR2*8)(3)
 #else
@@ -213,7 +213,7 @@ L(no_vmx):
 #else
 	li	r6,0
 #endif
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 	li	r3,0
 	blr
 #elif defined SHARED
diff --git a/sysdeps/s390/dl-tls.h b/sysdeps/s390/dl-tls.h
index 4801bf8..0ceb6f2 100644
--- a/sysdeps/s390/dl-tls.h
+++ b/sysdeps/s390/dl-tls.h
@@ -29,7 +29,7 @@ typedef struct
 
 extern unsigned long __tls_get_offset (unsigned long got_offset);
 
-# ifdef IS_IN_rtld
+# if IS_IN (rtld)
 
 #  include <shlib-compat.h>
 
@@ -78,9 +78,9 @@ __tls_get_offset:\n\
 1:	.long	__tls_get_addr - 0b\n\
 ");
 #  endif
-# else /* IS_IN_rtld */
+# else /* IS_IN (rtld) */
 extern void *__tls_get_addr_internal (tls_index *ti);
-# endif /* !IS_IN_rtld */
+# endif /* !IS_IN (rtld) */
 
 # define GET_ADDR_OFFSET \
   (ti->ti_offset - (unsigned long) __builtin_thread_pointer ())
diff --git a/sysdeps/s390/s390-32/setjmp.S b/sysdeps/s390/s390-32/setjmp.S
index 3ebc813..ea59cf9 100644
--- a/sysdeps/s390/s390-32/setjmp.S
+++ b/sysdeps/s390/s390-32/setjmp.S
@@ -23,12 +23,12 @@
 #include <bits/setjmp.h>
 #include <shlib-compat.h>
 
-#if !defined IS_IN_rtld
+#if !IS_IN (rtld)
 # if defined SHARED &&  SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
 	/* we need a unique name in case of symbol versioning.  */
 #  define __sigsetjmp __v1__sigsetjmp
 # endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)  */
-#endif /* !defined IS_IN_rtld  */
+#endif /* !IS_IN (rtld)  */
 
 	/* We include the BSD entry points here as well but we make
 	   them weak.  */
@@ -65,7 +65,7 @@ ENTRY(__sigsetjmp)
 #endif
 	std    %f4,40(%r2)
 	std    %f6,48(%r2)
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 	/* In ld.so we never save the signal mask.  */
 	lhi    %r2,0
 	br     %r14
@@ -87,7 +87,7 @@ ENTRY(__sigsetjmp)
 #endif
 END (__sigsetjmp)
 
-#if !defined IS_IN_rtld
+#if !IS_IN (rtld)
 # if defined SHARED &&  SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
 /* In glibc release 2.19 new versions of setjmp-functions were introduced,
    but were reverted before 2.20. Thus both versions are the same function.  */
@@ -108,4 +108,4 @@ strong_alias (__v1__sigsetjmp, __v2__sigsetjmp);
 versioned_symbol (libc, __v1__sigsetjmp, __sigsetjmp, GLIBC_2_0);
 compat_symbol (libc, __v2__sigsetjmp, __sigsetjmp, GLIBC_2_19);
 # endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)  */
-#endif /* if !defined IS_IN_rtld  */
+#endif /* if !IS_IN (rtld)  */
diff --git a/sysdeps/s390/s390-64/setjmp.S b/sysdeps/s390/s390-64/setjmp.S
index faa2784..e3762e0 100644
--- a/sysdeps/s390/s390-64/setjmp.S
+++ b/sysdeps/s390/s390-64/setjmp.S
@@ -23,12 +23,12 @@
 #include <bits/setjmp.h>
 #include <shlib-compat.h>
 
-#if !defined IS_IN_rtld
+#if !IS_IN (rtld)
 # if defined SHARED &&  SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
 	/* we need a unique name in case of symbol versioning.  */
 #  define __sigsetjmp __v1__sigsetjmp
 # endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)  */
-#endif /* !defined IS_IN_rtld  */
+#endif /* !IS_IN (rtld)  */
 
 	/* We include the BSD entry points here as well but we make
 	   them weak.  */
@@ -71,7 +71,7 @@ ENTRY(__sigsetjmp)
 	std    %f13,120(%r2)
 	std    %f14,128(%r2)
 	std    %f15,136(%r2)
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 	/* In ld.so we never save the signal mask.  */
 	lghi   %r2,0
 	br     %r14
@@ -82,7 +82,7 @@ ENTRY(__sigsetjmp)
 #endif
 END (__sigsetjmp)
 
-#if !defined IS_IN_rtld
+#if !IS_IN (rtld)
 # if defined SHARED &&  SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
 /* In glibc release 2.19 new versions of setjmp-functions were introduced,
    but were reverted before 2.20. Thus both versions are the same function.  */
@@ -103,4 +103,4 @@ strong_alias (__v1__sigsetjmp, __v2__sigsetjmp);
 versioned_symbol (libc, __v1__sigsetjmp, __sigsetjmp, GLIBC_2_0);
 compat_symbol (libc, __v2__sigsetjmp, __sigsetjmp, GLIBC_2_19);
 # endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)  */
-#endif /* if !defined IS_IN_rtld  */
+#endif /* if !IS_IN (rtld)  */
diff --git a/sysdeps/sh/sh3/setjmp.S b/sysdeps/sh/sh3/setjmp.S
index f3a8e6a..1bc76a5 100644
--- a/sysdeps/sh/sh3/setjmp.S
+++ b/sysdeps/sh/sh3/setjmp.S
@@ -46,7 +46,7 @@ ENTRY (__sigsetjmp)
 	mov.l	r9, @-r4
 	mov.l	r8, @-r4
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 	/* In ld.so we never save the signal mask.  */
 	rts
 	 mov	#0, r0
diff --git a/sysdeps/sh/sh4/setjmp.S b/sysdeps/sh/sh4/setjmp.S
index 4bbd666..91b8441 100644
--- a/sysdeps/sh/sh4/setjmp.S
+++ b/sysdeps/sh/sh4/setjmp.S
@@ -55,7 +55,7 @@ ENTRY (__sigsetjmp)
 	mov.l	r9, @-r4
 	mov.l	r8, @-r4
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 	/* In ld.so we never save the signal mask.  */
 	rts
 	 mov	#0, r0
diff --git a/sysdeps/unix/alpha/sysdep.h b/sysdeps/unix/alpha/sysdep.h
index 68b06e1..0b5ff20 100644
--- a/sysdeps/unix/alpha/sysdep.h
+++ b/sysdeps/unix/alpha/sysdep.h
@@ -26,7 +26,7 @@
 # include <regdef.h>
 #endif
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 # include <dl-sysdep.h>         /* Defines RTLD_PRIVATE_ERRNO.  */
 #endif
 
@@ -349,7 +349,7 @@ __LABEL(name)						\
    we don't deoptimize things by placing the pointer check value there.  */
 
 #ifdef __ASSEMBLER__
-# ifdef IS_IN_rtld
+# if IS_IN (rtld)
 #  define PTR_MANGLE(dst, src, tmp)				\
 	ldah	tmp, __pointer_chk_guard_local($29) !gprelhigh;	\
 	ldq	tmp, __pointer_chk_guard_local(tmp) !gprellow;	\
@@ -371,7 +371,7 @@ __LABEL(name)						\
 # define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
 #else
 # include <stdint.h>
-# if (defined IS_IN_rtld \
+# if (IS_IN (rtld) \
       || (!defined SHARED && (!defined NOT_IN_libc \
 			      || IS_IN (libpthread))))
 extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
diff --git a/sysdeps/unix/arm/sysdep.S b/sysdeps/unix/arm/sysdep.S
index 1a0f093..5566528 100644
--- a/sysdeps/unix/arm/sysdep.S
+++ b/sysdeps/unix/arm/sysdep.S
@@ -19,7 +19,7 @@
 #define _ERRNO_H
 #include <bits/errno.h>
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 # include <dl-sysdep.h>			/* Defines RTLD_PRIVATE_ERRNO.  */
 #endif
 
@@ -36,7 +36,7 @@ __syscall_error:
 	moveq	r0, $EAGAIN	/* Yes; translate it to EAGAIN.  */
 #endif
 
-#ifndef IS_IN_rtld
+#if !IS_IN (rtld)
 	mov	r1, r0
 	GET_TLS (r2)
 	ldr	r2, 1f
diff --git a/sysdeps/unix/i386/sysdep.S b/sysdeps/unix/i386/sysdep.S
index bfe0d00..06af337 100644
--- a/sysdeps/unix/i386/sysdep.S
+++ b/sysdeps/unix/i386/sysdep.S
@@ -19,7 +19,7 @@
 #define _ERRNO_H
 #include <bits/errno.h>
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 # include <dl-sysdep.h>		/* Defines RTLD_PRIVATE_ERRNO.  */
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
index 84bec80..3fb67427 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
@@ -309,7 +309,7 @@
 #endif	/* __ASSEMBLER__ */
 
 /* Pointer mangling is supported for AArch64.  */
-#if (defined IS_IN_rtld || \
+#if (IS_IN (rtld) || \
      (!defined SHARED && (!defined NOT_IN_libc \
 			  || IS_IN (libpthread))))
 # ifdef __ASSEMBLER__
diff --git a/sysdeps/unix/sysv/linux/getcwd.c b/sysdeps/unix/sysv/linux/getcwd.c
index a9abcef..ca0f271 100644
--- a/sysdeps/unix/sysv/linux/getcwd.c
+++ b/sysdeps/unix/sysv/linux/getcwd.c
@@ -30,7 +30,7 @@
 
 /* If we compile the file for use in ld.so we don't need the feature
    that getcwd() allocates the buffers itself.  */
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 # define NO_ALLOCATION	1
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
index fb61d0c..9a60492 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
@@ -58,7 +58,7 @@
 /* Initialize locks to zero.  */
 #define LLL_MUTEX_LOCK_INITIALIZER (0)
 
-#if !defined NOT_IN_libc || defined IS_IN_rtld
+#if !defined NOT_IN_libc || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/sysdeps/unix/sysv/linux/i386/lowlevellock.h
index 9d9ae58..ffae477 100644
--- a/sysdeps/unix/sysv/linux/i386/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/i386/lowlevellock.h
@@ -71,7 +71,7 @@
 #define LLL_SHARED	FUTEX_PRIVATE_FLAG
 
 
-#if !defined NOT_IN_libc || defined IS_IN_rtld
+#if !defined NOT_IN_libc || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
index 0282761..b538004 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -519,7 +519,7 @@ asm (".L__X'%ebx = 1\n\t"
 
 
 /* Pointer mangling support.  */
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 /* We cannot use the thread descriptor because in ld.so we use setjmp
    earlier than the descriptor is initialized.  Using a global variable
    is too complicated here since we have no PC-relative addressing mode.  */
diff --git a/sysdeps/unix/sysv/linux/ia64/lowlevellock.h b/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
index e84f530..fe4a90e 100644
--- a/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
@@ -52,7 +52,7 @@
 #define LLL_SHARED	FUTEX_PRIVATE_FLAG
 
 
-#if !defined NOT_IN_libc || defined IS_IN_rtld
+#if !defined NOT_IN_libc || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/ia64/setjmp.S b/sysdeps/unix/sysv/linux/ia64/setjmp.S
index f919a49..42d9453 100644
--- a/sysdeps/unix/sysv/linux/ia64/setjmp.S
+++ b/sysdeps/unix/sysv/linux/ia64/setjmp.S
@@ -178,7 +178,7 @@ ENTRY(__sigsetjmp)
 	;;
 	st8.nta [r2]=r25		// ar.unat
 	st8.nta [r3]=in0		// &__jmp_buf
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 	/* In ld.so we never save the signal mask.  */
 	;;
 #else
diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.h b/sysdeps/unix/sysv/linux/ia64/sysdep.h
index 47fd577..0943852 100644
--- a/sysdeps/unix/sysv/linux/ia64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/ia64/sysdep.h
@@ -364,7 +364,7 @@
 #endif /* not __ASSEMBLER__ */
 
 /* Pointer mangling support.  */
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 /* We cannot use the thread descriptor because in ld.so we use setjmp
    earlier than the descriptor is initialized.  */
 #else
diff --git a/sysdeps/unix/sysv/linux/lowlevellock-futex.h b/sysdeps/unix/sysv/linux/lowlevellock-futex.h
index 343afd6..11150b3 100644
--- a/sysdeps/unix/sysv/linux/lowlevellock-futex.h
+++ b/sysdeps/unix/sysv/linux/lowlevellock-futex.h
@@ -49,7 +49,7 @@
 #define LLL_SHARED	FUTEX_PRIVATE_FLAG
 
 
-#if !defined NOT_IN_libc || defined IS_IN_rtld
+#if !defined NOT_IN_libc || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h b/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h
index f967524..b75bf17 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h
@@ -23,7 +23,7 @@
 
 #ifdef SHARED
 
-# ifdef IS_IN_rtld
+# if IS_IN (rtld)
 # define M68K_VDSO_SYMBOL(name) __rtld_##name
 # define STR_M68K_VDSO_SYMBOL(name) "__rtld_" #name
 # else
@@ -35,7 +35,7 @@
 
 /* We define __rtld_* copies for rtld.
    We need them visible in libc to initialize.  */
-#  if defined IS_IN_rtld || !defined NOT_IN_libc
+#  if IS_IN (rtld) || !defined NOT_IN_libc
 extern void *__rtld___vdso_read_tp;
 extern void *__rtld___vdso_atomic_cmpxchg_32;
 extern void *__rtld___vdso_atomic_barrier;
@@ -44,14 +44,14 @@ extern void *__rtld___vdso_atomic_barrier;
 extern void __vdso_read_tp_stub (void);
 extern void __vdso_atomic_cmpxchg_32_stub (void);
 extern void __vdso_atomic_barrier_stub (void);
-#  endif /* IS_IN_rtld || !NOT_IN_libc */
+#  endif /* IS_IN (rtld) || !NOT_IN_libc */
 
 /* RTLD should only use its own copies.  */
-#  ifndef IS_IN_rtld
+#  if !IS_IN (rtld)
 extern void *__vdso_read_tp;
 extern void *__vdso_atomic_cmpxchg_32;
 extern void *__vdso_atomic_barrier;
-#  endif /* !IS_IN_rtld */
+#  endif /* !IS_IN (rtld) */
 
 # endif /* !__ASSEMBLER__ */
 
diff --git a/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S b/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S
index 032b1f2..c220e78 100644
--- a/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S
+++ b/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S
@@ -51,7 +51,7 @@ END (__vdso_read_tp_stub)
    equivalent helper function (which clobbers fewer registers than
    a normal function call) in a vdso; tail call to the
    helper.  */
-# ifdef IS_IN_rtld
+# if IS_IN (rtld)
 /* rtld gets a hidden copy of __m68k_read_tp.  */
 	.hidden __m68k_read_tp
 # endif
diff --git a/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h b/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h
index 0ba63a1..9c21eeb 100644
--- a/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h
@@ -52,7 +52,7 @@
 #define LLL_SHARED  FUTEX_PRIVATE_FLAG
 
 
-#if !defined NOT_IN_libc || defined IS_IN_rtld
+#if !defined NOT_IN_libc || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private)                                      \
diff --git a/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h b/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
index a651d23..54ccc41 100644
--- a/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
@@ -52,7 +52,7 @@
 #define LLL_PRIVATE	0
 #define LLL_SHARED	FUTEX_PRIVATE_FLAG
 
-#if !defined NOT_IN_libc || defined IS_IN_rtld
+#if !defined NOT_IN_libc || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
index 1a5e37a..b691759 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
@@ -272,7 +272,7 @@
 
 
 /* Pointer mangling support.  */
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 /* We cannot use the thread descriptor because in ld.so we use setjmp
    earlier than the descriptor is initialized.  */
 #else
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
index 93e454e..1cca63d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
@@ -282,7 +282,7 @@
 
 
 /* Pointer mangling support.  */
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 /* We cannot use the thread descriptor because in ld.so we use setjmp
    earlier than the descriptor is initialized.  */
 #else
diff --git a/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/sysdeps/unix/sysv/linux/s390/lowlevellock.h
index eaf2d58..2c17b2c 100644
--- a/sysdeps/unix/sysv/linux/s390/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/s390/lowlevellock.h
@@ -51,7 +51,7 @@
 #define LLL_SHARED	FUTEX_PRIVATE_FLAG
 
 
-#if !defined NOT_IN_libc || defined IS_IN_rtld
+#if !defined NOT_IN_libc || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
index 00919e3..e6fd96a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
@@ -366,7 +366,7 @@
     _ret; })
 
 /* Pointer mangling support.  */
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 /* We cannot use the thread descriptor because in ld.so we use setjmp
    earlier than the descriptor is initialized.  */
 #else
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
index d3bafca..917a636 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
@@ -372,7 +372,7 @@
     _ret; })
 
 /* Pointer mangling support.  */
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 /* We cannot use the thread descriptor because in ld.so we use setjmp
    earlier than the descriptor is initialized.  */
 #else
diff --git a/sysdeps/unix/sysv/linux/sh/lowlevellock.h b/sysdeps/unix/sysv/linux/sh/lowlevellock.h
index 10a2c25..328446c 100644
--- a/sysdeps/unix/sysv/linux/sh/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/sh/lowlevellock.h
@@ -49,7 +49,7 @@
 #define LLL_SHARED     FUTEX_PRIVATE_FLAG
 
 
-#if !defined NOT_IN_libc || defined IS_IN_rtld
+#if !defined NOT_IN_libc || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.h b/sysdeps/unix/sysv/linux/sh/sysdep.h
index 3f68938..4fc5dd7 100644
--- a/sysdeps/unix/sysv/linux/sh/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sh/sysdep.h
@@ -338,7 +338,7 @@
 #endif	/* __ASSEMBLER__ */
 
 /* Pointer mangling support.  */
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 /* We cannot use the thread descriptor because in ld.so we use setjmp
    earlier than the descriptor is initialized.  Using a global variable
    is too complicated here since we have no PC-relative addressing mode.  */
diff --git a/sysdeps/unix/sysv/linux/sparc/lowlevellock.h b/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
index d764075..eebf406 100644
--- a/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
@@ -57,7 +57,7 @@ extern void __cpu_relax (void);
 #define BUSY_WAIT_NOP	__cpu_relax ()
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_rtld
+#if !defined NOT_IN_libc || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
index 09ef2c9..e5bb3b5 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
@@ -21,7 +21,7 @@
 
 #include <sysdeps/unix/sysv/linux/sparc/sysdep.h>
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 # include <dl-sysdep.h>		/* Defines RTLD_PRIVATE_ERRNO.  */
 #endif
 #include <tls.h>
@@ -125,7 +125,7 @@ ENTRY(name);					\
 #endif	/* __ASSEMBLER__ */
 
 /* Pointer mangling support.  */
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 /* We cannot use the thread descriptor because in ld.so we use setjmp
    earlier than the descriptor is initialized.  */
 #else
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
index a0f2305..e9aedce 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
@@ -21,7 +21,7 @@
 
 #include <sysdeps/unix/sysv/linux/sparc/sysdep.h>
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 # include <dl-sysdep.h>		/* Defines RTLD_PRIVATE_ERRNO.  */
 #endif
 #include <tls.h>
@@ -140,7 +140,7 @@ ENTRY(name);					\
 #define STACK_BIAS	2047
 
 /* Pointer mangling support.  */
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 /* We cannot use the thread descriptor because in ld.so we use setjmp
    earlier than the descriptor is initialized.  */
 #else
diff --git a/sysdeps/unix/sysv/linux/tile/lowlevellock.h b/sysdeps/unix/sysv/linux/tile/lowlevellock.h
index e3e52a4..c9d2e54 100644
--- a/sysdeps/unix/sysv/linux/tile/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/tile/lowlevellock.h
@@ -52,7 +52,7 @@
 #define LLL_SHARED	FUTEX_PRIVATE_FLAG
 
 
-#if !defined NOT_IN_libc || defined IS_IN_rtld
+#if !defined NOT_IN_libc || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/tile/sysdep.h b/sysdeps/unix/sysv/linux/tile/sysdep.h
index 191f95a..a79a936 100644
--- a/sysdeps/unix/sysv/linux/tile/sysdep.h
+++ b/sysdeps/unix/sysv/linux/tile/sysdep.h
@@ -205,7 +205,7 @@
 #endif /* not __ASSEMBLER__ */
 
 /* Pointer mangling support.  */
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 /* We cannot use the thread descriptor because in ld.so we use setjmp
    earlier than the descriptor is initialized.  */
 #else
diff --git a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
index 55b4e16..37c0faf 100644
--- a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
@@ -72,7 +72,7 @@
 
 #ifndef __ASSEMBLER__
 
-#if !defined NOT_IN_libc || defined IS_IN_rtld
+#if !defined NOT_IN_libc || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index 4a619da..6377183 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -22,7 +22,7 @@
 #include <sysdeps/unix/x86_64/sysdep.h>
 #include <tls.h>
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 # include <dl-sysdep.h>		/* Defines RTLD_PRIVATE_ERRNO.  */
 #endif
 
@@ -393,7 +393,7 @@
 
 
 /* Pointer mangling support.  */
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 /* We cannot use the thread descriptor because in ld.so we use setjmp
    earlier than the descriptor is initialized.  */
 # ifdef __ASSEMBLER__
diff --git a/sysdeps/unix/x86_64/sysdep.S b/sysdeps/unix/x86_64/sysdep.S
index 9f5eb38..90ece2a 100644
--- a/sysdeps/unix/x86_64/sysdep.S
+++ b/sysdeps/unix/x86_64/sysdep.S
@@ -20,7 +20,7 @@
 #include <bits/errno.h>
 #include <tls.h>
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 # include <dl-sysdep.h>		/* Defines RTLD_PRIVATE_ERRNO.  */
 #endif
 
diff --git a/sysdeps/x86_64/setjmp.S b/sysdeps/x86_64/setjmp.S
index 4459212..7a4800f 100644
--- a/sysdeps/x86_64/setjmp.S
+++ b/sysdeps/x86_64/setjmp.S
@@ -54,7 +54,7 @@ ENTRY (__sigsetjmp)
 #endif
 	movq %rax, (JB_PC*8)(%rdi)
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 	/* In ld.so we never save the signal mask.  */
 	xorl %eax, %eax
 	retq
-- 
1.9.3

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

* [PATCH 03/19] Auto-generate libc-modules.h
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (6 preceding siblings ...)
  2014-08-21 10:58 ` [PATCH 09/19] Remove IS_IN_nscd Siddhesh Poyarekar
@ 2014-08-21 10:58 ` Siddhesh Poyarekar
  2014-08-22 18:42   ` Siddhesh Poyarekar
  2014-08-28  6:11   ` [PATCH 03/19 v2] " Siddhesh Poyarekar
  2014-08-21 10:58 ` [PATCH 02/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (12 subsequent siblings)
  20 siblings, 2 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Remove libc-modules.h from the tree and auto-generate it from
soversions.i and a new file build.list.  Macros generated from
soversions.i have lower values starting from 1, while those from
build.list start from a special value MODULE_OTHER_BEGIN, which has a
high enough value (1000).  This allows us to conveniently
differentiate between the versioned libraries and other built modules,
which is needed in errno.h and netdb.h to decide whether to use an
internal symbol or an external one.

Verified that generated code remains unchanged on x86_64.

	* Makeconfig (MIN-CPPFLAGS): CPPFLAGS without libc-symbols.h
	and IN_MODULE definitions.
	(%.v.i): Use it.
	(before-compile): Add libc-modules.h.
	($(common-objpfx)libc-modules.h,
	$(common-objpfx)libc-modules.stmp): New targets.
	(common-generated): Add libc-modules.h and libc-modules.stmp.
	* build.list: New file.
	* include/libc-modules.h: Remove file.
	* scripts/gen-libc-modules.awk: New script to generate
	libc-modules.h.
	* sysdeps/unix/Makefile ($(common-objpfx)sysd-syscalls):
	Depend on libc-modules.stmp.
---
 Makeconfig                   | 39 +++++++++++++++++++++++++++++++++++----
 build.list                   | 15 +++++++++++++++
 include/libc-modules.h       | 37 -------------------------------------
 scripts/gen-libc-modules.awk | 40 ++++++++++++++++++++++++++++++++++++++++
 sysdeps/unix/Makefile        |  3 ++-
 5 files changed, 92 insertions(+), 42 deletions(-)
 create mode 100644 build.list
 delete mode 100644 include/libc-modules.h
 create mode 100644 scripts/gen-libc-modules.awk

diff --git a/Makeconfig b/Makeconfig
index 5c6de39..df26cd0 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -840,6 +840,15 @@ override CXXFLAGS = $(c++-sysincludes) \
 		    $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
 		    $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
 
+# Minimal CPPFLAGS for the initial compilations, i.e. syscall stubs, %.v.i,
+# etc.
+MIN-CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
+	   $($(subdir)-CPPFLAGS) \
+	   $(+includes) $(defines) $(sysdep-CPPFLAGS) \
+	   $(CPPFLAGS-$(suffix $@)) \
+	   $(foreach lib,$(libof-$(basename $(@F))) \
+			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
+	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
 # If everything is compiled with -fPIC (implicitly) we must tell this by
 # defining the PIC symbol.
 ifeq (yes,$(build-pic-default))
@@ -928,7 +937,7 @@ subdir-srcdirs = $(foreach dir,$(subdirs),\
 %.v.i: $(common-objpfx)config.h $(..)Makeconfig
 	sed '/^[ 	]*%/!s/#.*$$//;/^[ 	]*$$/d;s/^[ 	]*%/#/' \
 	    $(filter-out FORCE %.h $(..)Makeconfig,$^) \
-	| $(CC) -E -undef $(CPPFLAGS) -x assembler-with-cpp - \
+	| $(CC) -E -undef $(MIN-CPPFLAGS) -x assembler-with-cpp - \
 		   > $@T
 	mv -f $@T $@
 %.v: %.v.i
@@ -993,9 +1002,12 @@ endif
 postclean-generated += soversions.mk soversions.i \
 		       shlib-versions.v shlib-versions.v.i
 
-# Generate the header containing the names of all shared libraries.
+# Generate a header containing the names of all shared libraries and another
+# one containing macros that comprise valid values for the IN_MODULE and
+# MODULE_NAME macros..
 # We use a stamp file to avoid unnecessary recompilations.
-before-compile += $(common-objpfx)gnu/lib-names.h
+before-compile += $(common-objpfx)gnu/lib-names.h \
+		  $(common-objpfx)libc-modules.h
 ifeq ($(soversions.mk-done),t)
 $(common-objpfx)gnu/lib-names.h: $(common-objpfx)gnu/lib-names.stmp; @:
 $(common-objpfx)gnu/lib-names.stmp: $(..)scripts/lib-names.awk \
@@ -1028,9 +1040,28 @@ $(common-objpfx)gnu/lib-names.stmp: $(..)scripts/lib-names.awk \
 	} >  ${@:stmp=T}
 	$(move-if-change) ${@:stmp=T} ${@:stmp=h}
 	touch $@
+
+# Generate a header with macro definitions for use with the IS_IN macro.
+# These are the possible values for the IN_MODULE macro defined when building
+# sources, to identify which module the translation unit is going to be built
+# into.  This needs to be one of the first headers to be generated since
+# everything uses it.  We work around a one-time circular dependency with
+# sysd-rules by touching an empty header file since the sysd-rules don't use
+# the IN_MODULE macros even though it is defined in the compile command.  This
+# is only necessary the first time, i.e. when there is no
+# include/libc-modules.h.
+$(common-objpfx)libc-modules.h: $(common-objpfx)libc-modules.stmp; @:
+$(common-objpfx)libc-modules.stmp: $(..)scripts/gen-libc-modules.awk \
+				   $(common-objpfx)soversions.i \
+				   $(..)build.list
+	$(AWK) -f $^ > ${@:stmp=T}
+	$(move-if-change) ${@:stmp=T} ${@:stmp=h}
+	touch $@
+
 endif
 
-common-generated += gnu/lib-names.h gnu/lib-names.stmp
+common-generated += gnu/lib-names.h gnu/lib-names.stmp libc-modules.h \
+		    libc-modules.stmp
 
 # The name under which the run-time dynamic linker is installed.
 # We are currently going for the convention that `/lib/ld.so.1'
diff --git a/build.list b/build.list
new file mode 100644
index 0000000..eab57c7
--- /dev/null
+++ b/build.list
@@ -0,0 +1,15 @@
+iconvprogs
+iconvdata
+ldconfig
+lddlibc4
+libmemusage
+libSegFault
+libpcprofile
+librpcsvc
+libutil
+locale_programs
+memusagestat
+nonlib
+nscd
+extramodules
+libnldbl
diff --git a/include/libc-modules.h b/include/libc-modules.h
deleted file mode 100644
index d12fb90..0000000
--- a/include/libc-modules.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#define MODULE_libc		1
-#define MODULE_libpthread	2
-#define MODULE_rtld		3
-#define MODULE_libdl		4
-#define MODULE_libm		5
-#define MODULE_iconvprogs	6
-#define MODULE_iconvdata	7
-#define MODULE_lddlibc4		8
-#define MODULE_locale_programs	9
-#define MODULE_memusagestat	10
-#define MODULE_libutil		12
-#define MODULE_libBrokenLocale	13
-#define MODULE_libmemusage	15
-#define MODULE_libresolv	16
-#define MODULE_libnss_db	17
-#define MODULE_libnss_files	18
-#define	MODULE_libnss_dns	19
-#define MODULE_libnss_compat	20
-#define MODULE_libnss_hesiod	21
-#define MODULE_libnss_nis	22
-#define MODULE_libnss_nisplus	23
-#define MODULE_libanl		24
-#define MODULE_librt		25
-#define MODULE_libSegFault	26
-#define MODULE_libthread_db	27
-#define MODULE_libcidn		28
-#define MODULE_libcrypt		29
-#define MODULE_libnsl		30
-#define MODULE_libpcprofile	31
-#define MODULE_librpcsvc	32
-#define MODULE_nscd		33
-#define MODULE_ldconfig 	34
-#define MODULE_libnldbl 	35
-
-/* Catch-all for test modules and other binaries.  */
-#define MODULE_nonlib		98
-#define MODULE_extramodules	99
diff --git a/scripts/gen-libc-modules.awk b/scripts/gen-libc-modules.awk
new file mode 100644
index 0000000..d3382b6
--- /dev/null
+++ b/scripts/gen-libc-modules.awk
@@ -0,0 +1,40 @@
+# Generate a header file that defines the MODULE_* macros for each library and
+# module we build in glibc.  The library names are pulled in from soversions.i
+# and the additional modules are mentioned one-per-line in build.list.
+BEGIN {
+  PROCINFO["sorted_in"] = "@val_type_asc"
+  shlibs = 1
+  others = 1000
+  libs["OTHERS_BEGIN"] = others++
+}
+
+# Skip over comments.
+$1 == "#" {
+  next
+}
+
+# build.list is simply one module per line.
+match (FILENAME, ".*build.list") {
+  libs[$0] = others++
+}
+
+# We have only one special case in soversions.i parsing, which is to replace ld
+# with rtld since that's what we call it throughout the sources.
+match (FILENAME, ".*soversions.i") {
+  name = $2
+  if (name == "ld")
+    name = "rtld"
+
+  if (!(name in libs)) {
+    libs[name] = shlibs++
+  }
+}
+
+# Finally, print out the header file.
+END {
+  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n\n")
+  i = 1
+  for (l in libs) {
+    printf ("#define MODULE_%s %d\n", l, libs[l])
+  }
+}
diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile
index 0e535b6..573e90d 100644
--- a/sysdeps/unix/Makefile
+++ b/sysdeps/unix/Makefile
@@ -79,7 +79,8 @@ compile-syscall = $(COMPILE.S) -o $@ -x assembler-with-cpp - \
 
 ifndef avoid-generated
 $(common-objpfx)sysd-syscalls: $(..)sysdeps/unix/make-syscalls.sh \
-			       $(wildcard $(+sysdep_dirs:%=%/syscalls.list))
+			       $(wildcard $(+sysdep_dirs:%=%/syscalls.list)) \
+			       $(common-objpfx)libc-modules.stmp
 	for dir in $(+sysdep_dirs); do \
 	  test -f $$dir/syscalls.list && \
 	  { sysdirs='$(sysdirs)' \
-- 
1.9.3

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

* [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT
@ 2014-08-21 10:58 Siddhesh Poyarekar
  2014-08-21 10:58 ` [PATCH 13/19] Remove IS_IN_libm Siddhesh Poyarekar
                   ` (20 more replies)
  0 siblings, 21 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha

Hi,

Here's take 2.

This patchset replaces the various IS_IN_*, NOT_IN_* and IN_LIB macro
schemes with a single unified IS_IN() macro scheme.  All patches have
been tested on x86_64, and all but [05/19] result in no code change.

[05/19] fixes a subtle bug introduced when adding systemtap probes to
lowlevellock.  The latter resulted in inclusion of stap-probe.h in a
lot of places, including those where IN_LIB is used to test if the
header is included in a translation unit compiled as a versioned
library.  The problem is that stap-probe.h defines IN_LIB if it is not
defined, to trap some error conditions and that breaks the check for
headers such as errno.h.

Following Rolands suggestions, the module a translation unit is being
built into is set using the libof-* variable and if it is not set,
it's assumed to be in in libc.  Accordingly, an IN_MODULE macro is
defined exactly once in the build options.

The values for IN_MODULE have initially been hardcoded in
include/libc-modules.h and in a subsequent patch, that file has been
removed and auto-generated from soversions.i (which in turn is
generated from various shlib-versions files) and a new file called
build.list which merely has a module name per line.

[18/19] is optional in that it is just a cleanup to make the
conditions easier to read.  It does not change the generated code
again, so it ought to be safe.

Finally, I did some ad hoc cross-builds for powerpc64 (power6), s390x,
aarch64 and arm and the binaries did not seem to have any significant
changes in any of the architectures except in s390x, where libc.so
seems to have changed very slightly.  I am going to run some more
exhaustive build tests over the rest of the week and I'll post results
(and maybe additional patches if necessary) on this thread when I am
done.

Siddhesh

PS: Thanks Roland for packaging cross-kernel-headers for Fedora; it
has made my job of setting up cross builds much easier :)

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

* [PATCH 02/19] Fix -Wundef warning in SHLIB_COMPAT
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (7 preceding siblings ...)
  2014-08-21 10:58 ` [PATCH 03/19] Auto-generate libc-modules.h Siddhesh Poyarekar
@ 2014-08-21 10:58 ` Siddhesh Poyarekar
  2014-08-22 18:23   ` Roland McGrath
  2014-08-21 10:58 ` [PATCH 06/19] Define IN_MODULE for translation units that define NOT_IN_libc Siddhesh Poyarekar
                   ` (11 subsequent siblings)
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Replace the IS_IN_##lib with IS_IN(lib).  Verified that the generated
code remains the same.

	* include/shlib-compat.h (_SHLIB_COMPAT): Use IS_IN.
---
 include/shlib-compat.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/shlib-compat.h b/include/shlib-compat.h
index fac0814..30804d3 100644
--- a/include/shlib-compat.h
+++ b/include/shlib-compat.h
@@ -41,7 +41,7 @@
 # define SHLIB_COMPAT(lib, introduced, obsoleted)			      \
   _SHLIB_COMPAT (lib, introduced, obsoleted)
 # define _SHLIB_COMPAT(lib, introduced, obsoleted)			      \
-  ((IS_IN_##lib - 0)							      \
+  (IS_IN (lib)								      \
    && (!(ABI_##lib##_##obsoleted - 0)					      \
        || ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0))))
 
-- 
1.9.3

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

* [PATCH 16/19] Remove NOT_IN_libc
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
  2014-08-21 10:58 ` [PATCH 13/19] Remove IS_IN_libm Siddhesh Poyarekar
@ 2014-08-21 10:58 ` Siddhesh Poyarekar
  2014-08-22 19:36   ` Roland McGrath
  2014-08-21 10:58 ` [PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB Siddhesh Poyarekar
                   ` (18 subsequent siblings)
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Replace with !IS_IN (libc).  This completes the transition from
the IS_IN/NOT_IN macros to the IN_MODULE macro set.

The generated code is unchanged on x86_64.

	* stdlib/isomac.c (fmt): Replace NOT_IN_libc with IN_MODULE.
	(get_null_defines): Adjust.
	* sunrpc/Makefile: Adjust comment.
	* Makerules (CPPFLAGS-nonlib): Remove NOT_IN_libc.
	* elf/Makefile (CPPFLAGS-sotruss-lib): Likewise.
	(CFLAGS-interp.c): Likewise.
	(CFLAGS-ldconfig.c): Likewise.
	(CPPFLAGS-.os): Likewise.
	* elf/rtld-Rules (rtld-CPPFLAGS): Likewise.
	* extra-lib.mk (CPPFLAGS-$(lib)): Likewise.
	* extra-modules.mk (extra-modules.mk): Likewise.
	* iconv/Makefile (CPPFLAGS-iconvprogs): Likewise.
	* locale/Makefile (CPPFLAGS-locale_programs): Likewise.
	* malloc/Makefile (CPPFLAGS-memusagestat): Likewise.
	* nscd/Makefile (CPPFLAGS-nscd): Likewise.
	* nss/Makefile (CPPFLAGS-nss_test1): Likewise.
	* stdlib/Makefile (CFLAGS-tst-putenvmod.c): Likewise.
	* sysdeps/gnu/Makefile ($(objpfx)errlist-compat.c): Likewise.
	* sysdeps/unix/sysv/linux/Makefile (CPPFLAGS-lddlibc4): Likewise.
	* iconvdata/Makefile (CPPFLAGS): Likewise.
	(cpp-srcs-left): Add libof for all iconvdata routines.
	* bits/stdio-lock.h: Replace NOT_IN_libc with IS_IN.
	* include/assert.h: Likewise.
	* include/ctype.h: Likewise.
	* include/errno.h: Likewise.
	* include/libc-symbols.h: Likewise.
	* include/math.h: Likewise.
	* include/netdb.h: Likewise.
	* include/resolv.h: Likewise.
	* include/stdio.h: Likewise.
	* include/stdlib.h: Likewise.
	* include/string.h: Likewise.
	* include/sys/stat.h: Likewise.
	* include/wctype.h: Likewise.
	* intl/l10nflist.c: Likewise.
	* libidn/idn-stub.c: Likewise.
	* libio/libioP.h: Likewise.
	* nptl/libc_multiple_threads.c: Likewise.
	* nptl/pthreadP.h: Likewise.
	* posix/regex_internal.h: Likewise.
	* resolv/res_hconf.c: Likewise.
	* sysdeps/arm/armv7/multiarch/memcpy.S: Likewise.
	* sysdeps/arm/memmove.S: Likewise.
	* sysdeps/arm/sysdep.h: Likewise.
	* sysdeps/generic/_itoa.h: Likewise.
	* sysdeps/generic/symbol-hacks.h: Likewise.
	* sysdeps/gnu/errlist.awk: Likewise.
	* sysdeps/gnu/errlist.c: Likewise.
	* sysdeps/i386/i586/memcpy.S: Likewise.
	* sysdeps/i386/i586/memset.S: Likewise.
	* sysdeps/i386/i686/memcpy.S: Likewise.
	* sysdeps/i386/i686/memmove.S: Likewise.
	* sysdeps/i386/i686/mempcpy.S: Likewise.
	* sysdeps/i386/i686/memset.S: Likewise.
	* sysdeps/i386/i686/multiarch/bcopy.S: Likewise.
	* sysdeps/i386/i686/multiarch/bzero.S: Likewise.
	* sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S: Likewise.
	* sysdeps/i386/i686/multiarch/memchr-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/memchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcmp-sse4.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcmp-ssse3.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcmp.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy-ssse3.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise.
	* sysdeps/i386/i686/multiarch/memmove.S: Likewise.
	* sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise.
	* sysdeps/i386/i686/multiarch/mempcpy.S: Likewise.
	* sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise.
	* sysdeps/i386/i686/multiarch/memrchr-c.c: Likewise.
	* sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S: Likewise.
	* sysdeps/i386/i686/multiarch/memrchr-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/memrchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/memset-sse2-rep.S: Likewise.
	* sysdeps/i386/i686/multiarch/memset-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/memset.S: Likewise.
	* sysdeps/i386/i686/multiarch/memset_chk.S: Likewise.
	* sysdeps/i386/i686/multiarch/rawmemchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcat-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcat-ssse3.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcat.S: Likewise.
	* sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S: Likewise.
	* sysdeps/i386/i686/multiarch/strchr-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/strchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcmp-sse4.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcmp-ssse3.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcmp.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcpy-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcpy-ssse3.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcpy.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcspn.S: Likewise.
	* sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S: Likewise.
	* sysdeps/i386/i686/multiarch/strlen-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/strlen.S: Likewise.
	* sysdeps/i386/i686/multiarch/strnlen.S: Likewise.
	* sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S: Likewise.
	* sysdeps/i386/i686/multiarch/strrchr-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/strrchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/strspn.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcschr-c.c: Likewise.
	* sysdeps/i386/i686/multiarch/wcschr-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcschr.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcscmp-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcscmp.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcscpy-c.c: Likewise.
	* sysdeps/i386/i686/multiarch/wcscpy-ssse3.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcscpy.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcslen-c.c: Likewise.
	* sysdeps/i386/i686/multiarch/wcslen-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcslen.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcsrchr-c.c: Likewise.
	* sysdeps/i386/i686/multiarch/wcsrchr-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcsrchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/wmemcmp-c.c: Likewise.
	* sysdeps/i386/i686/multiarch/wmemcmp.S: Likewise.
	* sysdeps/ia64/fpu/libm-symbols.h: Likewise.
	* sysdeps/nptl/bits/libc-lock.h: Likewise.
	* sysdeps/nptl/bits/libc-lockP.h: Likewise.
	* sysdeps/nptl/bits/stdio-lock.h: Likewise.
	* sysdeps/posix/closedir.c: Likewise.
	* sysdeps/posix/opendir.c: Likewise.
	* sysdeps/posix/readdir.c: Likewise.
	* sysdeps/posix/rewinddir.c: Likewise.
	* sysdeps/powerpc/novmx-sigjmp.c: Likewise.
	* sysdeps/powerpc/powerpc32/__longjmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/bsd-_setjmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/fpu/__longjmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/fpu/setjmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-ppc32.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/memset.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/strlen-ppc32.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-ppc32.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy.c: Likewise.
	* sysdeps/powerpc/powerpc32/power6/memset.S: Likewise.
	* sysdeps/powerpc/powerpc32/setjmp.S: Likewise.
	* sysdeps/powerpc/powerpc64/__longjmp.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/bzero.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memchr.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memcmp.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memcpy.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memmove.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/mempcpy.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memrchr.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memset.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/stpcpy.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/stpncpy.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcat.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strchr.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strchrnul.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcmp.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcpy.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcspn.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strlen.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncase.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncase_l.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncat.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncmp.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncpy.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strnlen.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strpbrk.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strrchr.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strspn.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/wcschr.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/wcscpy.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/wordcopy.c: Likewise.
	* sysdeps/powerpc/powerpc64/setjmp.S: Likewise.
	* sysdeps/s390/s390-32/multiarch/ifunc-resolve.c: Likewise.
	* sysdeps/s390/s390-32/multiarch/memcmp.S: Likewise.
	* sysdeps/s390/s390-32/multiarch/memcpy.S: Likewise.
	* sysdeps/s390/s390-32/multiarch/memset.S: Likewise.
	* sysdeps/s390/s390-64/multiarch/ifunc-resolve.c: Likewise.
	* sysdeps/s390/s390-64/multiarch/memcmp.S: Likewise.
	* sysdeps/s390/s390-64/multiarch/memcpy.S: Likewise.
	* sysdeps/s390/s390-64/multiarch/memset.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memcpy.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memset-niagara1.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memset-niagara4.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memset.S: Likewise.
	* sysdeps/unix/alpha/sysdep.S: Likewise.
	* sysdeps/unix/alpha/sysdep.h: Likewise.
	* sysdeps/unix/make-syscalls.sh: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/arm/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/getpid.c: Likewise.
	* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Likewise.
	* sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
	* sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/ia64/sysdep.S: Likewise.
	* sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/lowlevellock-futex.h: Likewise.
	* sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h: Likewise.
	* sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/m68k/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/lowlevellock.h: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/not-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/longjmp_chk.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
	* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/sh/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/brk.S: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/tile/lowlevellock.h: Likewise.
	* sysdeps/unix/sysv/linux/tile/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/tile/waitpid.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
	* sysdeps/wordsize-32/symbol-hacks.h: Likewise.
	* sysdeps/x86_64/memcpy.S: Likewise.
	* sysdeps/x86_64/memmove.c: Likewise.
	* sysdeps/x86_64/memset.S: Likewise.
	* sysdeps/x86_64/multiarch/init-arch.h: Likewise.
	* sysdeps/x86_64/multiarch/memcmp-sse4.S: Likewise.
	* sysdeps/x86_64/multiarch/memcmp-ssse3.S: Likewise.
	* sysdeps/x86_64/multiarch/memcmp.S: Likewise.
	* sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S: Likewise.
	* sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: Likewise.
	* sysdeps/x86_64/multiarch/memcpy-ssse3.S: Likewise.
	* sysdeps/x86_64/multiarch/memcpy.S: Likewise.
	* sysdeps/x86_64/multiarch/memcpy_chk.S: Likewise.
	* sysdeps/x86_64/multiarch/memmove.c: Likewise.
	* sysdeps/x86_64/multiarch/mempcpy.S: Likewise.
	* sysdeps/x86_64/multiarch/mempcpy_chk.S: Likewise.
	* sysdeps/x86_64/multiarch/memset-avx2.S: Likewise.
	* sysdeps/x86_64/multiarch/memset.S: Likewise.
	* sysdeps/x86_64/multiarch/memset_chk.S: Likewise.
	* sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S: Likewise.
	* sysdeps/x86_64/multiarch/strcat-ssse3.S: Likewise.
	* sysdeps/x86_64/multiarch/strcat.S: Likewise.
	* sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S: Likewise.
	* sysdeps/x86_64/multiarch/strchr.S: Likewise.
	* sysdeps/x86_64/multiarch/strcmp-ssse3.S: Likewise.
	* sysdeps/x86_64/multiarch/strcmp.S: Likewise.
	* sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S: Likewise.
	* sysdeps/x86_64/multiarch/strcpy-ssse3.S: Likewise.
	* sysdeps/x86_64/multiarch/strcpy.S: Likewise.
	* sysdeps/x86_64/multiarch/strcspn.S: Likewise.
	* sysdeps/x86_64/multiarch/strspn.S: Likewise.
	* sysdeps/x86_64/multiarch/wcscpy-c.c: Likewise.
	* sysdeps/x86_64/multiarch/wcscpy-ssse3.S: Likewise.
	* sysdeps/x86_64/multiarch/wcscpy.S: Likewise.
	* sysdeps/x86_64/multiarch/wmemcmp-c.c: Likewise.
	* sysdeps/x86_64/multiarch/wmemcmp.S: Likewise.
	* sysdeps/x86_64/strcmp.S: Likewise.
---
 Makerules                                            |  3 ---
 bits/stdio-lock.h                                    |  2 +-
 elf/Makefile                                         |  9 ++-------
 elf/rtld-Rules                                       |  4 +---
 extra-lib.mk                                         |  2 --
 extra-modules.mk                                     |  1 -
 iconv/Makefile                                       |  2 --
 iconvdata/Makefile                                   |  7 +++----
 include/assert.h                                     |  2 +-
 include/ctype.h                                      |  6 +++---
 include/errno.h                                      |  6 +++---
 include/libc-symbols.h                               |  2 +-
 include/math.h                                       |  2 +-
 include/netdb.h                                      |  6 +++---
 include/resolv.h                                     |  2 +-
 include/stdio.h                                      |  2 +-
 include/stdlib.h                                     |  2 +-
 include/string.h                                     |  2 +-
 include/sys/stat.h                                   |  2 +-
 include/wctype.h                                     |  2 +-
 intl/l10nflist.c                                     |  2 +-
 libidn/idn-stub.c                                    |  2 +-
 libio/libioP.h                                       |  2 +-
 locale/Makefile                                      |  5 ++---
 malloc/Makefile                                      |  2 --
 nptl/libc_multiple_threads.c                         |  2 +-
 nptl/pthreadP.h                                      |  2 +-
 nscd/Makefile                                        |  2 +-
 nss/Makefile                                         |  1 -
 posix/regex_internal.h                               |  4 ++--
 resolv/res_hconf.c                                   |  2 +-
 stdlib/Makefile                                      |  1 -
 stdlib/isomac.c                                      |  5 +++--
 sunrpc/Makefile                                      |  2 +-
 sysdeps/arm/armv7/multiarch/memcpy.S                 |  2 +-
 sysdeps/arm/memmove.S                                |  2 +-
 sysdeps/arm/sysdep.h                                 |  2 +-
 sysdeps/generic/_itoa.h                              |  4 ++--
 sysdeps/generic/symbol-hacks.h                       |  2 +-
 sysdeps/gnu/Makefile                                 |  2 +-
 sysdeps/gnu/errlist.awk                              |  2 +-
 sysdeps/gnu/errlist.c                                |  2 +-
 sysdeps/i386/i586/memcpy.S                           |  2 +-
 sysdeps/i386/i586/memset.S                           |  2 +-
 sysdeps/i386/i686/memcpy.S                           |  2 +-
 sysdeps/i386/i686/memmove.S                          |  2 +-
 sysdeps/i386/i686/mempcpy.S                          |  2 +-
 sysdeps/i386/i686/memset.S                           |  4 ++--
 sysdeps/i386/i686/multiarch/bcopy.S                  |  2 +-
 sysdeps/i386/i686/multiarch/bzero.S                  |  2 +-
 sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S        |  2 +-
 sysdeps/i386/i686/multiarch/memchr-sse2.S            |  2 +-
 sysdeps/i386/i686/multiarch/memchr.S                 |  2 +-
 sysdeps/i386/i686/multiarch/memcmp-sse4.S            |  2 +-
 sysdeps/i386/i686/multiarch/memcmp-ssse3.S           |  2 +-
 sysdeps/i386/i686/multiarch/memcmp.S                 |  2 +-
 sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S       |  2 +-
 sysdeps/i386/i686/multiarch/memcpy-ssse3.S           |  2 +-
 sysdeps/i386/i686/multiarch/memcpy.S                 |  2 +-
 sysdeps/i386/i686/multiarch/memcpy_chk.S             |  2 +-
 sysdeps/i386/i686/multiarch/memmove.S                |  2 +-
 sysdeps/i386/i686/multiarch/memmove_chk.S            |  2 +-
 sysdeps/i386/i686/multiarch/mempcpy.S                |  2 +-
 sysdeps/i386/i686/multiarch/mempcpy_chk.S            |  2 +-
 sysdeps/i386/i686/multiarch/memrchr-c.c              |  2 +-
 sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S       |  2 +-
 sysdeps/i386/i686/multiarch/memrchr-sse2.S           |  2 +-
 sysdeps/i386/i686/multiarch/memrchr.S                |  2 +-
 sysdeps/i386/i686/multiarch/memset-sse2-rep.S        |  4 ++--
 sysdeps/i386/i686/multiarch/memset-sse2.S            |  4 ++--
 sysdeps/i386/i686/multiarch/memset.S                 |  2 +-
 sysdeps/i386/i686/multiarch/memset_chk.S             |  2 +-
 sysdeps/i386/i686/multiarch/rawmemchr.S              |  2 +-
 sysdeps/i386/i686/multiarch/strcat-sse2.S            |  2 +-
 sysdeps/i386/i686/multiarch/strcat-ssse3.S           |  2 +-
 sysdeps/i386/i686/multiarch/strcat.S                 |  2 +-
 sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S        |  2 +-
 sysdeps/i386/i686/multiarch/strchr-sse2.S            |  2 +-
 sysdeps/i386/i686/multiarch/strchr.S                 |  2 +-
 sysdeps/i386/i686/multiarch/strcmp-sse4.S            |  2 +-
 sysdeps/i386/i686/multiarch/strcmp-ssse3.S           |  2 +-
 sysdeps/i386/i686/multiarch/strcmp.S                 |  2 +-
 sysdeps/i386/i686/multiarch/strcpy-sse2.S            |  2 +-
 sysdeps/i386/i686/multiarch/strcpy-ssse3.S           |  2 +-
 sysdeps/i386/i686/multiarch/strcpy.S                 |  2 +-
 sysdeps/i386/i686/multiarch/strcspn.S                |  2 +-
 sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S        |  2 +-
 sysdeps/i386/i686/multiarch/strlen-sse2.S            |  2 +-
 sysdeps/i386/i686/multiarch/strlen.S                 |  2 +-
 sysdeps/i386/i686/multiarch/strnlen.S                |  2 +-
 sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S       |  2 +-
 sysdeps/i386/i686/multiarch/strrchr-sse2.S           |  2 +-
 sysdeps/i386/i686/multiarch/strrchr.S                |  2 +-
 sysdeps/i386/i686/multiarch/strspn.S                 |  2 +-
 sysdeps/i386/i686/multiarch/wcschr-c.c               |  2 +-
 sysdeps/i386/i686/multiarch/wcschr-sse2.S            |  2 +-
 sysdeps/i386/i686/multiarch/wcschr.S                 |  2 +-
 sysdeps/i386/i686/multiarch/wcscmp-sse2.S            |  2 +-
 sysdeps/i386/i686/multiarch/wcscmp.S                 |  2 +-
 sysdeps/i386/i686/multiarch/wcscpy-c.c               |  2 +-
 sysdeps/i386/i686/multiarch/wcscpy-ssse3.S           |  2 +-
 sysdeps/i386/i686/multiarch/wcscpy.S                 |  2 +-
 sysdeps/i386/i686/multiarch/wcslen-c.c               |  2 +-
 sysdeps/i386/i686/multiarch/wcslen-sse2.S            |  2 +-
 sysdeps/i386/i686/multiarch/wcslen.S                 |  2 +-
 sysdeps/i386/i686/multiarch/wcsrchr-c.c              |  2 +-
 sysdeps/i386/i686/multiarch/wcsrchr-sse2.S           |  2 +-
 sysdeps/i386/i686/multiarch/wcsrchr.S                |  2 +-
 sysdeps/i386/i686/multiarch/wmemcmp-c.c              |  2 +-
 sysdeps/i386/i686/multiarch/wmemcmp.S                |  2 +-
 sysdeps/ia64/fpu/libm-symbols.h                      |  2 +-
 sysdeps/nptl/bits/libc-lock.h                        | 14 +++++++-------
 sysdeps/nptl/bits/libc-lockP.h                       | 20 ++++++++++----------
 sysdeps/nptl/bits/stdio-lock.h                       |  2 +-
 sysdeps/posix/closedir.c                             |  2 +-
 sysdeps/posix/opendir.c                              |  2 +-
 sysdeps/posix/readdir.c                              |  4 ++--
 sysdeps/posix/rewinddir.c                            |  4 ++--
 sysdeps/powerpc/novmx-sigjmp.c                       |  4 ++--
 sysdeps/powerpc/powerpc32/__longjmp.S                |  6 +++---
 sysdeps/powerpc/powerpc32/bsd-_setjmp.S              |  4 ++--
 sysdeps/powerpc/powerpc32/fpu/__longjmp.S            |  6 +++---
 sysdeps/powerpc/powerpc32/fpu/setjmp.S               |  6 +++---
 sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c   |  2 +-
 sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c  |  2 +-
 .../powerpc32/power4/multiarch/memcmp-ppc32.S        |  2 +-
 sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c  |  2 +-
 .../powerpc32/power4/multiarch/memcpy-ppc32.S        |  2 +-
 sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c  |  2 +-
 sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c |  2 +-
 sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c |  2 +-
 .../powerpc32/power4/multiarch/memrchr-ppc32.c       |  2 +-
 sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c |  2 +-
 .../powerpc32/power4/multiarch/memset-ppc32.S        |  2 +-
 sysdeps/powerpc/powerpc32/power4/multiarch/memset.c  |  2 +-
 .../powerpc/powerpc32/power4/multiarch/rawmemchr.c   |  2 +-
 .../powerpc/powerpc32/power4/multiarch/strcasecmp.c  |  4 ++--
 .../powerpc32/power4/multiarch/strcasecmp_l.c        |  4 ++--
 sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c  |  2 +-
 .../powerpc/powerpc32/power4/multiarch/strchrnul.c   |  2 +-
 .../powerpc32/power4/multiarch/strlen-ppc32.S        |  2 +-
 sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c  |  2 +-
 .../powerpc/powerpc32/power4/multiarch/strncase.c    |  4 ++--
 .../powerpc/powerpc32/power4/multiarch/strncase_l.c  |  4 ++--
 .../powerpc32/power4/multiarch/strncmp-ppc32.S       |  2 +-
 sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c |  2 +-
 sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c |  2 +-
 .../powerpc32/power4/multiarch/wcschr-ppc32.c        |  2 +-
 sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c  |  2 +-
 .../powerpc32/power4/multiarch/wcscpy-ppc32.c        |  2 +-
 sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c  |  2 +-
 .../powerpc32/power4/multiarch/wcsrchr-ppc32.c       |  2 +-
 sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c |  2 +-
 .../powerpc/powerpc32/power4/multiarch/wordcopy.c    |  2 +-
 sysdeps/powerpc/powerpc32/power6/memset.S            |  4 ++--
 sysdeps/powerpc/powerpc32/setjmp.S                   |  6 +++---
 sysdeps/powerpc/powerpc64/__longjmp.S                |  6 +++---
 sysdeps/powerpc/powerpc64/multiarch/bzero.c          |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/memchr.c         |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c   |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/memcmp.c         |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S   |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/memcpy.c         |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c  |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/memmove.c        |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/mempcpy.c        |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/memrchr.c        |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S   |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/memset.c         |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c      |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.S   |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/stpcpy.c         |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/stpncpy.c        |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c     |  4 ++--
 sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c   |  4 ++--
 sysdeps/powerpc/powerpc64/multiarch/strcat.c         |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strchr.c         |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strchrnul.c      |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S   |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strcmp.c         |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.S   |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strcpy.c         |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strcspn.c        |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S   |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strlen.c         |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strncase.c       |  4 ++--
 sysdeps/powerpc/powerpc64/multiarch/strncase_l.c     |  4 ++--
 sysdeps/powerpc/powerpc64/multiarch/strncat.c        |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S  |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strncmp.c        |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c  |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strncpy.c        |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strnlen.c        |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strpbrk.c        |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c  |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strrchr.c        |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c   |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/strspn.c         |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/wcschr.c         |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/wcscpy.c         |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c        |  2 +-
 sysdeps/powerpc/powerpc64/multiarch/wordcopy.c       |  2 +-
 sysdeps/powerpc/powerpc64/setjmp.S                   |  6 +++---
 sysdeps/s390/s390-32/multiarch/ifunc-resolve.c       |  2 +-
 sysdeps/s390/s390-32/multiarch/memcmp.S              |  4 ++--
 sysdeps/s390/s390-32/multiarch/memcpy.S              |  4 ++--
 sysdeps/s390/s390-32/multiarch/memset.S              |  4 ++--
 sysdeps/s390/s390-64/multiarch/ifunc-resolve.c       |  2 +-
 sysdeps/s390/s390-64/multiarch/memcmp.S              |  4 ++--
 sysdeps/s390/s390-64/multiarch/memcpy.S              |  4 ++--
 sysdeps/s390/s390-64/multiarch/memset.S              |  4 ++--
 sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S    |  2 +-
 sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S    |  2 +-
 sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S    |  2 +-
 sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S      |  2 +-
 sysdeps/sparc/sparc64/multiarch/memcpy.S             |  2 +-
 sysdeps/sparc/sparc64/multiarch/memset-niagara1.S    |  2 +-
 sysdeps/sparc/sparc64/multiarch/memset-niagara4.S    |  2 +-
 sysdeps/sparc/sparc64/multiarch/memset.S             |  2 +-
 sysdeps/unix/alpha/sysdep.S                          |  2 +-
 sysdeps/unix/alpha/sysdep.h                          |  2 +-
 sysdeps/unix/make-syscalls.sh                        |  4 ++--
 sysdeps/unix/sysv/linux/Makefile                     |  1 -
 sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h      |  6 +++---
 sysdeps/unix/sysv/linux/aarch64/sysdep.h             |  4 ++--
 sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h        |  6 +++---
 sysdeps/unix/sysv/linux/alpha/vfork.S                |  2 +-
 sysdeps/unix/sysv/linux/arm/sysdep-cancel.h          |  6 +++---
 sysdeps/unix/sysv/linux/arm/sysdep.h                 |  2 +-
 sysdeps/unix/sysv/linux/getpid.c                     |  4 ++--
 sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h     |  2 +-
 sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h    |  8 ++++----
 sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S     |  4 ++--
 sysdeps/unix/sysv/linux/i386/lowlevellock.h          |  8 ++++----
 sysdeps/unix/sysv/linux/i386/sysdep-cancel.h         |  4 ++--
 sysdeps/unix/sysv/linux/i386/sysdep.h                |  4 ++--
 sysdeps/unix/sysv/linux/ia64/lowlevellock.h          |  2 +-
 sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h         |  6 +++---
 sysdeps/unix/sysv/linux/ia64/sysdep.S                |  2 +-
 sysdeps/unix/sysv/linux/ia64/sysdep.h                |  2 +-
 sysdeps/unix/sysv/linux/lowlevellock-futex.h         |  2 +-
 sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h        |  4 ++--
 sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h         |  4 ++--
 sysdeps/unix/sysv/linux/m68k/sysdep.h                |  2 +-
 sysdeps/unix/sysv/linux/microblaze/lowlevellock.h    |  2 +-
 sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h   |  6 +++---
 sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h  |  2 +-
 sysdeps/unix/sysv/linux/mips/sysdep-cancel.h         |  2 +-
 sysdeps/unix/sysv/linux/not-cancel.h                 |  2 +-
 sysdeps/unix/sysv/linux/powerpc/lowlevellock.h       |  2 +-
 .../sysv/linux/powerpc/powerpc32/sysdep-cancel.h     |  4 ++--
 .../sysv/linux/powerpc/powerpc64/sysdep-cancel.h     |  4 ++--
 sysdeps/unix/sysv/linux/s390/longjmp_chk.c           |  2 +-
 sysdeps/unix/sysv/linux/s390/lowlevellock.h          |  2 +-
 sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h |  4 ++--
 sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S        |  4 ++--
 sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h        |  2 +-
 sysdeps/unix/sysv/linux/s390/s390-32/vfork.S         |  2 +-
 sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h |  6 +++---
 sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S        |  4 ++--
 sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h        |  2 +-
 sysdeps/unix/sysv/linux/s390/s390-64/vfork.S         |  2 +-
 sysdeps/unix/sysv/linux/sh/lowlevellock.S            |  4 ++--
 sysdeps/unix/sysv/linux/sh/lowlevellock.h            |  2 +-
 sysdeps/unix/sysv/linux/sh/sysdep-cancel.h           |  4 ++--
 sysdeps/unix/sysv/linux/sh/sysdep.h                  |  2 +-
 sysdeps/unix/sysv/linux/sh/vfork.S                   |  2 +-
 sysdeps/unix/sysv/linux/sparc/lowlevellock.h         |  2 +-
 .../unix/sysv/linux/sparc/sparc32/sysdep-cancel.h    |  4 ++--
 sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h       |  2 +-
 sysdeps/unix/sysv/linux/sparc/sparc64/brk.S          |  2 +-
 .../unix/sysv/linux/sparc/sparc64/sysdep-cancel.h    |  4 ++--
 sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h       |  2 +-
 sysdeps/unix/sysv/linux/tile/lowlevellock.h          |  2 +-
 sysdeps/unix/sysv/linux/tile/sysdep-cancel.h         |  2 +-
 sysdeps/unix/sysv/linux/tile/sysdep.h                |  2 +-
 sysdeps/unix/sysv/linux/tile/waitpid.S               |  2 +-
 sysdeps/unix/sysv/linux/x86_64/lowlevellock.S        |  4 ++--
 sysdeps/unix/sysv/linux/x86_64/lowlevellock.h        |  8 ++++----
 sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h       |  6 +++---
 sysdeps/unix/sysv/linux/x86_64/sysdep.h              |  2 +-
 sysdeps/wordsize-32/symbol-hacks.h                   |  2 +-
 sysdeps/x86_64/memcpy.S                              | 16 ++++++++--------
 sysdeps/x86_64/memmove.c                             |  2 +-
 sysdeps/x86_64/memset.S                              |  6 +++---
 sysdeps/x86_64/multiarch/init-arch.h                 |  2 +-
 sysdeps/x86_64/multiarch/memcmp-sse4.S               |  2 +-
 sysdeps/x86_64/multiarch/memcmp-ssse3.S              |  2 +-
 sysdeps/x86_64/multiarch/memcmp.S                    |  2 +-
 sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S      |  2 +-
 sysdeps/x86_64/multiarch/memcpy-ssse3-back.S         |  2 +-
 sysdeps/x86_64/multiarch/memcpy-ssse3.S              |  2 +-
 sysdeps/x86_64/multiarch/memcpy.S                    |  2 +-
 sysdeps/x86_64/multiarch/memcpy_chk.S                |  2 +-
 sysdeps/x86_64/multiarch/memmove.c                   |  4 ++--
 sysdeps/x86_64/multiarch/mempcpy.S                   |  2 +-
 sysdeps/x86_64/multiarch/mempcpy_chk.S               |  2 +-
 sysdeps/x86_64/multiarch/memset-avx2.S               |  2 +-
 sysdeps/x86_64/multiarch/memset.S                    |  4 ++--
 sysdeps/x86_64/multiarch/memset_chk.S                |  2 +-
 sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S     |  2 +-
 sysdeps/x86_64/multiarch/strcat-ssse3.S              |  2 +-
 sysdeps/x86_64/multiarch/strcat.S                    |  2 +-
 sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S        |  2 +-
 sysdeps/x86_64/multiarch/strchr.S                    |  2 +-
 sysdeps/x86_64/multiarch/strcmp-ssse3.S              |  2 +-
 sysdeps/x86_64/multiarch/strcmp.S                    |  2 +-
 sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S     |  2 +-
 sysdeps/x86_64/multiarch/strcpy-ssse3.S              |  2 +-
 sysdeps/x86_64/multiarch/strcpy.S                    |  2 +-
 sysdeps/x86_64/multiarch/strcspn.S                   |  2 +-
 sysdeps/x86_64/multiarch/strspn.S                    |  2 +-
 sysdeps/x86_64/multiarch/wcscpy-c.c                  |  2 +-
 sysdeps/x86_64/multiarch/wcscpy-ssse3.S              |  2 +-
 sysdeps/x86_64/multiarch/wcscpy.S                    |  2 +-
 sysdeps/x86_64/multiarch/wmemcmp-c.c                 |  2 +-
 sysdeps/x86_64/multiarch/wmemcmp.S                   |  2 +-
 sysdeps/x86_64/strcmp.S                              | 12 ++++++------
 318 files changed, 430 insertions(+), 451 deletions(-)

diff --git a/Makerules b/Makerules
index 2736db7..85cab98 100644
--- a/Makerules
+++ b/Makerules
@@ -1161,9 +1161,6 @@ lib := nonlib
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 endif
 
-# The include magic above causes those files to use this variable for flags.
-CPPFLAGS-nonlib = -DNOT_IN_libc=1
-
 
 ifeq ($(build-shared),yes)
 # Generate normalized lists of symbols, versions, and data sizes.
diff --git a/bits/stdio-lock.h b/bits/stdio-lock.h
index 198cb67..f68b13e 100644
--- a/bits/stdio-lock.h
+++ b/bits/stdio-lock.h
@@ -44,7 +44,7 @@ __libc_lock_define_recursive (typedef, _IO_lock_t)
 #define _IO_cleanup_region_end(_doit) \
   __libc_cleanup_region_end (_doit)
 
-#if defined _LIBC && !defined NOT_IN_libc
+#if defined _LIBC && IS_IN (libc)
 # define _IO_acquire_lock(_fp) \
   _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp));      \
   _IO_flockfile (_fp)
diff --git a/elf/Makefile b/elf/Makefile
index b739a97..925eeb5 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -97,7 +97,6 @@ install-others += $(inst_auditdir)/sotruss-lib.so
 install-bin-script += sotruss
 generated += sotruss
 libof-sotruss-lib = extramodules
-CPPFLAGS-sotruss-lib = -DNOT_IN_libc
 $(objpfx)sotruss-lib.so: $(objpfx)sotruss-lib.os
 	$(build-module-asneeded)
 $(objpfx)sotruss-lib.so: $(common-objpfx)libc.so $(objpfx)ld.so \
@@ -356,8 +355,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
 
 # interp.c exists just to get this string into the libraries.
 libof-interp = extramodules
-CFLAGS-interp.c = -D'RUNTIME_LINKER="$(rtlddir)/$(rtld-installed-name)"' \
-		  -DNOT_IN_libc=1
+CFLAGS-interp.c = -D'RUNTIME_LINKER="$(rtlddir)/$(rtld-installed-name)"'
 $(objpfx)interp.os: $(common-objpfx)config.make
 
 ifneq (ld.so,$(rtld-installed-name))
@@ -432,15 +430,12 @@ $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
 
 SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
 CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
-		    -D'SLIBDIR="$(slibdir)"' -DNOT_IN_libc
+		    -D'SLIBDIR="$(slibdir)"'
 libof-ldconfig = ldconfig
 CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
 CFLAGS-cache.c = $(SYSCONF-FLAGS)
 CFLAGS-rtld.c = $(SYSCONF-FLAGS)
 
-CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
-		     -DNOT_IN_libc=1)
-
 cpp-srcs-left := $(all-rtld-routines:=.os)
 lib := rtld
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
diff --git a/elf/rtld-Rules b/elf/rtld-Rules
index 4e7c9ef..d2dc606 100644
--- a/elf/rtld-Rules
+++ b/elf/rtld-Rules
@@ -138,12 +138,10 @@ ifdef rtld-depfiles
 -include $(rtld-depfiles)
 endif
 
+# This here is the whole point of all the shenanigans.
 # Set libof-* for each routine.
 cpp-srcs-left := $(subst .os,,$(rtld-modules))
 lib := rtld
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
-# This here is the whole point of all the shenanigans.
-rtld-CPPFLAGS := -DNOT_IN_libc=1
-
 endif
diff --git a/extra-lib.mk b/extra-lib.mk
index 7cdf823..b10748d 100644
--- a/extra-lib.mk
+++ b/extra-lib.mk
@@ -105,5 +105,3 @@ cpp-srcs-left := $($(lib)-routines) $($(lib)-sysdep_routines)
 ifneq (,$(cpp-srcs-left))
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 endif
-
-CPPFLAGS-$(lib) := -DNOT_IN_libc=1
diff --git a/extra-modules.mk b/extra-modules.mk
index 9c2e4d2..5f8e693 100644
--- a/extra-modules.mk
+++ b/extra-modules.mk
@@ -7,4 +7,3 @@ module := $(firstword $(extra-modules-left))
 extra-modules-left := $(filter-out $(module),$(extra-modules-left))
 
 libof-$(notdir $(module)) := extramodules
-CPPFLAGS-$(module).c += -DNOT_IN_libc
diff --git a/iconv/Makefile b/iconv/Makefile
index 8031a88..d1a9011 100644
--- a/iconv/Makefile
+++ b/iconv/Makefile
@@ -52,8 +52,6 @@ CFLAGS-gconv_cache.c += -DGCONV_DIR='"$(gconvdir)"'
 CFLAGS-gconv_conf.c = -DGCONV_PATH='"$(gconvdir)"'
 CFLAGS-iconvconfig.c = -DGCONV_PATH='"$(gconvdir)"' -DGCONV_DIR='"$(gconvdir)"'
 
-CPPFLAGS-iconvprogs = -DNOT_IN_libc
-
 # Set libof-* for each routine.
 cpp-srcs-left := $(iconv_prog-modules) $(iconvconfig-modules)
 lib := iconvprogs
diff --git a/iconvdata/Makefile b/iconvdata/Makefile
index 63ed612..3012c00 100644
--- a/iconvdata/Makefile
+++ b/iconvdata/Makefile
@@ -75,9 +75,6 @@ endif
 test-srcs := tst-table-from tst-table-to
 endif
 
-# No code here is in libc.so.
-CPPFLAGS += -DNOT_IN_libc
-
 libJIS-routines := jis0201 jis0208 jis0212
 libKSC-routines := ksc5601
 libGB-routines := gb2312
@@ -275,7 +272,9 @@ endif
 include ../Rules
 
 # Set libof-* for each routine.
-cpp-srcs-left := $(modules) $(generated-modules)
+cpp-srcs-left := $(modules) $(generated-modules) $(libJIS-routines) \
+		 $(libKSC-routines) $(libGB-routines) $(libCNS-routines) \
+		 $(libISOIR165-routines) $(libJISX0213-routines)
 lib := iconvdata
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
diff --git a/include/assert.h b/include/assert.h
index abe182f..c452667 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -20,7 +20,7 @@ extern void __assert_fail_base (const char *fmt, const char *assertion,
 				const char *function)
      __THROW  __attribute__ ((__noreturn__));
 
-# if !defined NOT_IN_libc || IS_IN (rtld)
+# if IS_IN (libc) || IS_IN (rtld)
 hidden_proto (__assert_fail)
 hidden_proto (__assert_perror_fail)
 # endif
diff --git a/include/ctype.h b/include/ctype.h
index 6a18039..8eaa3be 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -7,7 +7,7 @@ libc_hidden_proto (__ctype_init)
 
 extern int __isctype (int __c, int __mask);
 
-# ifndef NOT_IN_libc
+# if IS_IN (libc)
 
 /* These accessors are used by the optimized macros to find the
    thread-local cache of ctype information from the current thread's
@@ -46,13 +46,13 @@ __ctype_tolower_loc (void)
   return __libc_tsd_address (const int32_t *, CTYPE_TOLOWER);
 }
 
-# endif	/* Not NOT_IN_libc.  */
+# endif	/* IS_IN (libc).  */
 #endif
 
 #include <ctype/ctype.h>
 
 #ifndef _ISOMAC
-# if !defined __NO_CTYPE && !defined NOT_IN_libc
+# if !defined __NO_CTYPE && IS_IN (libc)
 /* The spec says that isdigit must only match the decimal digits.  We
    can check this without a memory access.  */
 #  undef isdigit
diff --git a/include/errno.h b/include/errno.h
index d650a15..7df41df 100644
--- a/include/errno.h
+++ b/include/errno.h
@@ -22,19 +22,19 @@
 #  define errno rtld_errno
 extern int rtld_errno attribute_hidden;
 
-# elif !defined NOT_IN_libc || IS_IN_LIB
+# elif IS_IN_LIB
 
 #  include <tls.h>
 
 #  undef  errno
-#  ifndef NOT_IN_libc
+#  if IS_IN (libc)
 #   define errno __libc_errno
 #  else
 #   define errno errno		/* For #ifndef errno tests.  */
 #  endif
 extern __thread int errno attribute_tls_model_ie;
 
-# endif	/* !NOT_IN_libc || IS_IN_LIB */
+# endif	/* IS_IN_LIB */
 
 # define __set_errno(val) (errno = (val))
 
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 34702a7..5eb9e83 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -567,7 +567,7 @@ for linking")
 # define hidden_nolink(name, lib, version)
 #endif
 
-#if !defined NOT_IN_libc
+#if IS_IN (libc)
 # define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libc_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
 # define libc_hidden_def(name) hidden_def (name)
diff --git a/include/math.h b/include/math.h
index b10bfa0..42bb55e 100644
--- a/include/math.h
+++ b/include/math.h
@@ -6,7 +6,7 @@
 /* Now define the internal interfaces.  */
 extern int __matherr (struct exception *__exc);
 
-# if !defined NOT_IN_libc || IS_IN (libm)
+# if IS_IN (libc) || IS_IN (libm)
 hidden_proto (__finite)
 hidden_proto (__isinf)
 hidden_proto (__isnan)
diff --git a/include/netdb.h b/include/netdb.h
index eccdbe6..9e64a15 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -4,15 +4,15 @@
 
 #ifndef _ISOMAC
 /* Macros for accessing h_errno from inside libc.  */
-# if !defined NOT_IN_libc || IS_IN_LIB
+# if IS_IN_LIB
 #  undef  h_errno
-#  ifndef NOT_IN_libc
+#  if IS_IN (libc)
 #   define h_errno __libc_h_errno
 #  else
 #   define h_errno h_errno	/* For #ifndef h_errno tests.  */
 #  endif
 extern __thread int h_errno attribute_tls_model_ie;
-# endif /* !NOT_IN_libc || IS_IN_LIB */
+# endif /* IS_IN_LIB */
 # define __set_h_errno(x) (h_errno = (x))
 
 libc_hidden_proto (hstrerror)
diff --git a/include/resolv.h b/include/resolv.h
index 3904cb7..4c61476 100644
--- a/include/resolv.h
+++ b/include/resolv.h
@@ -13,7 +13,7 @@
 
 #ifdef _RESOLV_H_
 
-# ifndef NOT_IN_libc
+# if IS_IN (libc)
 #  define __resp __libc_resp
 # endif
 extern __thread struct __res_state *__resp attribute_tls_model_ie;
diff --git a/include/stdio.h b/include/stdio.h
index 9f2ea31..53a2c58 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -117,7 +117,7 @@ extern const char *const _sys_errlist_internal[] attribute_hidden;
 extern int _sys_nerr_internal attribute_hidden;
 
 libc_hidden_proto (__asprintf)
-#  if !defined NOT_IN_libc
+#  if IS_IN (libc)
 extern _IO_FILE *_IO_new_fopen (const char*, const char*);
 #   define fopen(fname, mode) _IO_new_fopen (fname, mode)
 extern _IO_FILE *_IO_new_fdopen (int, const char*);
diff --git a/include/stdlib.h b/include/stdlib.h
index e50985a..734f251 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -226,7 +226,7 @@ extern int __qfcvt_r (long double __value, int __ndigit,
 		      int *__restrict __decpt, int *__restrict __sign,
 		      char *__restrict __buf, size_t __len);
 
-# ifndef NOT_IN_libc
+# if IS_IN (libc)
 #  undef MB_CUR_MAX
 #  define MB_CUR_MAX (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX))
 
diff --git a/include/string.h b/include/string.h
index 8323412..0d40682 100644
--- a/include/string.h
+++ b/include/string.h
@@ -57,7 +57,7 @@ extern __typeof (strcasecmp_l) __strcasecmp_l;
 extern __typeof (strncasecmp_l) __strncasecmp_l;
 
 /* Alternative version which doesn't pollute glibc's namespace.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # undef strndupa
 # define strndupa(s, n)							      \
   (__extension__							      \
diff --git a/include/sys/stat.h b/include/sys/stat.h
index a44fbec..873562a 100644
--- a/include/sys/stat.h
+++ b/include/sys/stat.h
@@ -12,7 +12,7 @@ extern __mode_t __umask (__mode_t __mask);
 extern int __mkdir (const char *__path, __mode_t __mode);
 extern int __mknod (const char *__path,
 		    __mode_t __mode, __dev_t __dev);
-#if !defined NOT_IN_libc || IS_IN (rtld)
+#if IS_IN (libc) || IS_IN (rtld)
 hidden_proto (__fxstat)
 hidden_proto (__fxstat64)
 hidden_proto (__lxstat)
diff --git a/include/wctype.h b/include/wctype.h
index a2ee9ff..bacd719 100644
--- a/include/wctype.h
+++ b/include/wctype.h
@@ -89,7 +89,7 @@ libc_hidden_proto (__towupper_l)
 
 /* The spec says that isdigit must only match the decimal digits.  We
    can check this without a memory access.  */
-# ifndef NOT_IN_libc
+# if IS_IN (libc)
 #  undef iswdigit
 #  define iswdigit(c) ({ wint_t __c = (c); __c >= L'0' && __c <= L'9'; })
 #  undef iswdigit_l
diff --git a/intl/l10nflist.c b/intl/l10nflist.c
index 428a3f1..ca04ad3 100644
--- a/intl/l10nflist.c
+++ b/intl/l10nflist.c
@@ -324,7 +324,7 @@ _nl_normalize_codeset (codeset, name_len)
   char *retval;
   char *wp;
   size_t cnt;
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
   locale_t locale = newlocale (0, "C", NULL);
 #else
 # define locale _nl_C_locobj_ptr
diff --git a/libidn/idn-stub.c b/libidn/idn-stub.c
index 9361b25..afd93ca 100644
--- a/libidn/idn-stub.c
+++ b/libidn/idn-stub.c
@@ -130,7 +130,7 @@ __idna_to_ascii_lz (const char *input, char **output, int flags)
 }
 
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 libc_freeres_fn (unload_libidn)
 {
   if (h != NULL && h != (void *) 1l)
diff --git a/libio/libioP.h b/libio/libioP.h
index bd94041..08b77ca 100644
--- a/libio/libioP.h
+++ b/libio/libioP.h
@@ -902,7 +902,7 @@ _IO_acquire_lock_clear_flags2_fct (_IO_FILE **p)
     _IO_funlockfile (fp);
 }
 
-#if !defined _IO_MTSAFE_IO && !defined NOT_IN_libc
+#if !defined _IO_MTSAFE_IO && IS_IN (libc)
 # define _IO_acquire_lock(_fp)						      \
   do {									      \
     _IO_FILE *_IO_acquire_lock_file = NULL
diff --git a/locale/Makefile b/locale/Makefile
index 4c22c74..2b2cdde 100644
--- a/locale/Makefile
+++ b/locale/Makefile
@@ -88,14 +88,13 @@ locale-CPPFLAGS = -DLOCALEDIR='"$(localedir)"' \
 CPPFLAGS-locale_programs = -DLOCALE_PATH='$(localepath)' \
 			   -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
 			   -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
-			   -DLOCSRCDIR='"$(i18ndir)/locales"' \
-			   -DNOT_IN_libc
+			   -DLOCSRCDIR='"$(i18ndir)/locales"'
 
 CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-charmap-dir.c = -Wno-write-strings
 
-# This makes sure -DNOT_IN_libc et al are passed for all these modules.
+# Set libof-* for each routine.
 cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
 		 $(lib-modules)
 lib := locale_programs
diff --git a/malloc/Makefile b/malloc/Makefile
index 10a53f6..7d8d5a5 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -48,8 +48,6 @@ extra-objs = mcheck-init.o libmcheck.a
 # Include the cleanup handler.
 aux := set-freeres thread-freeres
 
-CPPFLAGS-memusagestat = -DNOT_IN_libc
-
 # The Perl script to analyze the output of the mtrace functions.
 ifneq ($(PERL),no)
 install-bin-script = mtrace
diff --git a/nptl/libc_multiple_threads.c b/nptl/libc_multiple_threads.c
index acf3594..0361f6c 100644
--- a/nptl/libc_multiple_threads.c
+++ b/nptl/libc_multiple_threads.c
@@ -18,7 +18,7 @@
 
 #include <pthreadP.h>
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # ifndef TLS_MULTIPLE_THREADS_IN_TCB
 /* Variable set to a nonzero value either if more than one thread runs or ran,
    or if a single-threaded process is trying to cancel itself.  See
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index d75aeac..a8d5fb4 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -286,7 +286,7 @@ __do_cancel (void)
 #define CANCEL_RESET(oldtype) \
   __pthread_disable_asynccancel (oldtype)
 
-#if !defined NOT_IN_libc
+#if IS_IN (libc)
 /* Same as CANCEL_ASYNC, but for use in libc.so.  */
 # define LIBC_CANCEL_ASYNC() \
   __libc_enable_asynccancel ()
diff --git a/nscd/Makefile b/nscd/Makefile
index 40e99aa..8e03e9e 100644
--- a/nscd/Makefile
+++ b/nscd/Makefile
@@ -79,7 +79,7 @@ CFLAGS-nscd_gethst_r.c = -fexceptions
 CFLAGS-nscd_getai.c = -fexceptions
 CFLAGS-nscd_initgroups.c = -fexceptions
 
-CPPFLAGS-nscd += -D_FORTIFY_SOURCE=2 -DNOT_IN_libc
+CPPFLAGS-nscd += -D_FORTIFY_SOURCE=2
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
 CFLAGS-nscd += $(pie-ccflag)
diff --git a/nss/Makefile b/nss/Makefile
index 41d685c..7dcb68b 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -116,7 +116,6 @@ $(inst_vardbdir)/Makefile: db-Makefile $(+force)
 	$(do-install)
 
 libof-nss_test1 = extramodules
-CPPFLAGS-nss_test1 = -DNOT_IN_libc=1
 $(objpfx)/libnss_test1.so: $(objpfx)nss_test1.os $(link-libc-deps)
 	$(build-module)
 ifdef libnss_test1.so-version
diff --git a/posix/regex_internal.h b/posix/regex_internal.h
index 4bbf6a8..58f7766 100644
--- a/posix/regex_internal.h
+++ b/posix/regex_internal.h
@@ -382,7 +382,7 @@ typedef struct re_dfa_t re_dfa_t;
 # endif
 #endif
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr,
 						int new_buf_len)
      internal_function;
@@ -732,7 +732,7 @@ re_string_wchar_at (const re_string_t *pstr, int idx)
   return (wint_t) pstr->wcs[idx];
 }
 
-# ifndef NOT_IN_libc
+# if IS_IN (libc)
 static int
 internal_function __attribute__ ((pure, unused))
 re_string_elem_size_at (const re_string_t *pstr, int idx)
diff --git a/resolv/res_hconf.c b/resolv/res_hconf.c
index b4c8622..cde0229 100644
--- a/resolv/res_hconf.c
+++ b/resolv/res_hconf.c
@@ -358,7 +358,7 @@ _res_hconf_init (void)
 }
 
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # if defined SIOCGIFCONF && defined SIOCGIFNETMASK
 /* List of known interfaces.  */
 libc_freeres_ptr (
diff --git a/stdlib/Makefile b/stdlib/Makefile
index da6e076..76b7ca7 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -146,7 +146,6 @@ LDFLAGS-tst-putenv = $(no-as-needed)
 $(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os $(link-libc-deps)
 	$(build-module)
 libof-tst-putenvmod = extramodules
-CFLAGS-tst-putenvmod.c = -DNOT_IN_libc=1
 
 $(objpfx)bug-getcontext: $(libm)
 $(objpfx)tst-strtod-round: $(libm)
diff --git a/stdlib/isomac.c b/stdlib/isomac.c
index 13accb5..6fc97cd 100644
--- a/stdlib/isomac.c
+++ b/stdlib/isomac.c
@@ -176,7 +176,8 @@ static char *macros[] =
 /* Format string to build command to invoke compiler.  */
 static const char fmt[] = "\
 echo \"#include <%s>\" |\
-%s -E -dM -ansi -pedantic %s -D_LIBC -D_ISOMAC -DNOT_IN_libc -I. \
+%s -E -dM -ansi -pedantic %s -D_LIBC -D_ISOMAC \
+-DIN_MODULE=MODULE_extramodules -I. \
 -isystem `%s --print-prog-name=include` - 2> /dev/null > %s";
 
 
@@ -305,7 +306,7 @@ get_null_defines (void)
 	;
       result[result_len] = xstrndup (start, end - start);
 
-      if (strcmp (result[result_len], "NOT_IN_libc") != 0)
+      if (strcmp (result[result_len], "IN_MODULE") != 0)
 	{
 	  if (first)
 	    {
diff --git a/sunrpc/Makefile b/sunrpc/Makefile
index f64a554..636ee9d 100644
--- a/sunrpc/Makefile
+++ b/sunrpc/Makefile
@@ -170,7 +170,7 @@ $(cross-rpcgen-objs): $(objpfx)cross-%.o: %.c $(before-compile)
 $(objpfx)cross-rpcgen: $(cross-rpcgen-objs)
 	$(BUILD_CC) $^ $(BUILD_LDFLAGS) -o $@
 
-# This makes sure -DNOT_IN_libc is passed for all these modules.
+# This makes sure -DIN_MODULE is passed for all these modules.
 cpp-srcs-left := $(rpcgen-objs:.o=.c)
 lib := nonlib
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
diff --git a/sysdeps/arm/armv7/multiarch/memcpy.S b/sysdeps/arm/armv7/multiarch/memcpy.S
index c4f4e80..3439cb7 100644
--- a/sysdeps/arm/armv7/multiarch/memcpy.S
+++ b/sysdeps/arm/armv7/multiarch/memcpy.S
@@ -22,7 +22,7 @@
 #include <sysdep.h>
 #include <rtld-global-offsets.h>
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 /* Under __ARM_NEON__, memcpy_neon.S defines the name memcpy.  */
 # ifndef __ARM_NEON__
 	.text
diff --git a/sysdeps/arm/memmove.S b/sysdeps/arm/memmove.S
index 04aa7db..488e156 100644
--- a/sysdeps/arm/memmove.S
+++ b/sysdeps/arm/memmove.S
@@ -69,7 +69,7 @@ ENTRY(memmove)
 
 		subs	ip, r0, r1
 		cmphi	r2, ip
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
 		bls	memcpy
 #else
 		bls	HIDDEN_JUMPTARGET(memcpy)
diff --git a/sysdeps/arm/sysdep.h b/sysdeps/arm/sysdep.h
index ebd6411..db09ed0 100644
--- a/sysdeps/arm/sysdep.h
+++ b/sysdeps/arm/sysdep.h
@@ -293,7 +293,7 @@
 
 /* Pointer mangling support.  */
 #if (IS_IN (rtld) || \
-     (!defined SHARED && (!defined NOT_IN_libc || IS_IN (libpthread))))
+     (!defined SHARED && (IS_IN (libc) || IS_IN (libpthread))))
 # ifdef __ASSEMBLER__
 #  define PTR_MANGLE_LOAD(guard, tmp)					\
   LDST_PCREL(ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard_local));
diff --git a/sysdeps/generic/_itoa.h b/sysdeps/generic/_itoa.h
index 8360baf..ed84e56 100644
--- a/sysdeps/generic/_itoa.h
+++ b/sysdeps/generic/_itoa.h
@@ -46,12 +46,12 @@ extern char *_itoa (unsigned long long int value, char *buflim,
 
 extern const char _itoa_upper_digits[];
 extern const char _itoa_lower_digits[];
-#if !defined NOT_IN_libc || IS_IN (rtld)
+#if IS_IN (libc) || IS_IN (rtld)
 hidden_proto (_itoa_upper_digits)
 hidden_proto (_itoa_lower_digits)
 #endif
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 extern char *_itoa_word (_ITOA_WORD_TYPE value, char *buflim,
 			 unsigned int base, int upper_case);
 #else
diff --git a/sysdeps/generic/symbol-hacks.h b/sysdeps/generic/symbol-hacks.h
index 6bec24b..ce576c9 100644
--- a/sysdeps/generic/symbol-hacks.h
+++ b/sysdeps/generic/symbol-hacks.h
@@ -1,6 +1,6 @@
 /* Some compiler optimizations may transform loops into memset/memmove
    calls and without proper declaration it may generate PLT calls.  */
-#if !defined __ASSEMBLER__ && !defined NOT_IN_libc && defined SHARED
+#if !defined __ASSEMBLER__ && IS_IN (libc) && defined SHARED
 asm ("memmove = __GI_memmove");
 asm ("memset = __GI_memset");
 asm ("memcpy = __GI_memcpy");
diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
index b5b2cf0..ba495ed 100644
--- a/sysdeps/gnu/Makefile
+++ b/sysdeps/gnu/Makefile
@@ -40,7 +40,7 @@ $(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \
 endif
 	$(make-target-directory)
 	$(AWK) -v maxerr=`\
-	  $(CC) -S $(CPPFLAGS) $(CFLAGS) -DNOT_IN_libc -DEMIT_ERR_MAX $< -o - \
+	  $(CC) -S $(CPPFLAGS) $(CFLAGS) -DEMIT_ERR_MAX $< -o - \
 	  | sed -n 's/^.*@@@[^0-9]*\([0-9]*\)[^0-9]*@@@.*$$/\1/p'` \
 	       -f $(..)sysdeps/gnu/errlist-compat.awk \
 	       $(wildcard $(sysdirs:=/Versions)) > $@T
diff --git a/sysdeps/gnu/errlist.awk b/sysdeps/gnu/errlist.awk
index 7fa5305..6da844a 100644
--- a/sysdeps/gnu/errlist.awk
+++ b/sysdeps/gnu/errlist.awk
@@ -110,7 +110,7 @@ END {
   print "  (sizeof _sys_errlist_internal / sizeof _sys_errlist_internal [0])";
   print "const int _sys_nerr_internal = NERR;"
   print "";
-  print "#if !defined NOT_IN_libc && !defined ERRLIST_NO_COMPAT";
+  print "#if IS_IN (libc) && !defined ERRLIST_NO_COMPAT";
   print "# include <errlist-compat.c>";
   print "#endif";
   print "";
diff --git a/sysdeps/gnu/errlist.c b/sysdeps/gnu/errlist.c
index 8381434..a9a5960 100644
--- a/sysdeps/gnu/errlist.c
+++ b/sysdeps/gnu/errlist.c
@@ -1480,7 +1480,7 @@ TRANS error; @pxref{Cancel AIO Operations}. */
   (sizeof _sys_errlist_internal / sizeof _sys_errlist_internal [0])
 const int _sys_nerr_internal = NERR;
 
-#if !defined NOT_IN_libc && !defined ERRLIST_NO_COMPAT
+#if IS_IN (libc) && !defined ERRLIST_NO_COMPAT
 # include <errlist-compat.c>
 #endif
 
diff --git a/sysdeps/i386/i586/memcpy.S b/sysdeps/i386/i586/memcpy.S
index edd9f08..6e0cc4c 100644
--- a/sysdeps/i386/i586/memcpy.S
+++ b/sysdeps/i386/i586/memcpy.S
@@ -32,7 +32,7 @@
 #define LEN	SRC+4
 
         .text
-#if defined PIC && !defined NOT_IN_libc
+#if defined PIC && IS_IN (libc)
 ENTRY (__memcpy_chk)
 	movl	12(%esp), %eax
 	cmpl	%eax, 16(%esp)
diff --git a/sysdeps/i386/i586/memset.S b/sysdeps/i386/i586/memset.S
index 910d7bb..50b498b 100644
--- a/sysdeps/i386/i586/memset.S
+++ b/sysdeps/i386/i586/memset.S
@@ -35,7 +35,7 @@
 #endif
 
         .text
-#if defined PIC && !defined NOT_IN_libc && !BZERO_P
+#if defined PIC && IS_IN (libc) && !BZERO_P
 ENTRY (__memset_chk)
 	movl	12(%esp), %eax
 	cmpl	%eax, 16(%esp)
diff --git a/sysdeps/i386/i686/memcpy.S b/sysdeps/i386/i686/memcpy.S
index 17e815e..6a15004 100644
--- a/sysdeps/i386/i686/memcpy.S
+++ b/sysdeps/i386/i686/memcpy.S
@@ -28,7 +28,7 @@
 #define LEN	SRC+4
 
 	.text
-#if defined PIC && !defined NOT_IN_libc
+#if defined PIC && IS_IN (libc)
 ENTRY_CHK (__memcpy_chk)
 	movl	12(%esp), %eax
 	cmpl	%eax, 16(%esp)
diff --git a/sysdeps/i386/i686/memmove.S b/sysdeps/i386/i686/memmove.S
index 4b8785f..561f2fc 100644
--- a/sysdeps/i386/i686/memmove.S
+++ b/sysdeps/i386/i686/memmove.S
@@ -35,7 +35,7 @@
 # define SRC	DEST+4
 # define LEN	SRC+4
 
-# if defined PIC && !defined NOT_IN_libc
+# if defined PIC && IS_IN (libc)
 ENTRY_CHK (__memmove_chk)
 	movl	12(%esp), %eax
 	cmpl	%eax, 16(%esp)
diff --git a/sysdeps/i386/i686/mempcpy.S b/sysdeps/i386/i686/mempcpy.S
index ec4b42b..8e51a13 100644
--- a/sysdeps/i386/i686/mempcpy.S
+++ b/sysdeps/i386/i686/mempcpy.S
@@ -28,7 +28,7 @@
 #define LEN	SRC+4
 
 	.text
-#if defined PIC && !defined NOT_IN_libc
+#if defined PIC && IS_IN (libc)
 ENTRY_CHK (__mempcpy_chk)
 	movl	12(%esp), %eax
 	cmpl	%eax, 16(%esp)
diff --git a/sysdeps/i386/i686/memset.S b/sysdeps/i386/i686/memset.S
index 72d21fa..877bdda 100644
--- a/sysdeps/i386/i686/memset.S
+++ b/sysdeps/i386/i686/memset.S
@@ -36,7 +36,7 @@
 #endif
 
         .text
-#if defined PIC && !defined NOT_IN_libc && !BZERO_P
+#if defined PIC && IS_IN (libc) && !BZERO_P
 ENTRY_CHK (__memset_chk)
 	movl	12(%esp), %eax
 	cmpl	%eax, 16(%esp)
@@ -99,7 +99,7 @@ ENTRY (memset)
 END (memset)
 libc_hidden_builtin_def (memset)
 
-#if defined PIC && !defined NOT_IN_libc && !BZERO_P
+#if defined PIC && IS_IN (libc) && !BZERO_P
 strong_alias (__memset_chk, __memset_zero_constant_len_parameter)
 	.section .gnu.warning.__memset_zero_constant_len_parameter
 	.string "memset used with constant zero length parameter; this could be due to transposed parameters"
diff --git a/sysdeps/i386/i686/multiarch/bcopy.S b/sysdeps/i386/i686/multiarch/bcopy.S
index 4f50035..a0fca88 100644
--- a/sysdeps/i386/i686/multiarch/bcopy.S
+++ b/sysdeps/i386/i686/multiarch/bcopy.S
@@ -22,7 +22,7 @@
 #include <init-arch.h>
 
 /* Define multiple versions only for the definition in lib.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # ifdef SHARED
 	.text
 ENTRY(bcopy)
diff --git a/sysdeps/i386/i686/multiarch/bzero.S b/sysdeps/i386/i686/multiarch/bzero.S
index cd59940..2dc1d8a 100644
--- a/sysdeps/i386/i686/multiarch/bzero.S
+++ b/sysdeps/i386/i686/multiarch/bzero.S
@@ -22,7 +22,7 @@
 #include <init-arch.h>
 
 /* Define multiple versions only for the definition in lib.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # ifdef SHARED
 	.text
 ENTRY(__bzero)
diff --git a/sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S b/sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S
index 8f5ccca..a0083a3 100644
--- a/sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S
+++ b/sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef  NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/i386/i686/multiarch/memchr-sse2.S b/sysdeps/i386/i686/multiarch/memchr-sse2.S
index 8d2c159..59a8a7c 100644
--- a/sysdeps/i386/i686/multiarch/memchr-sse2.S
+++ b/sysdeps/i386/i686/multiarch/memchr-sse2.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef  NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/i386/i686/multiarch/memchr.S b/sysdeps/i386/i686/multiarch/memchr.S
index 1bdf0e7..b2a22f3 100644
--- a/sysdeps/i386/i686/multiarch/memchr.S
+++ b/sysdeps/i386/i686/multiarch/memchr.S
@@ -21,7 +21,7 @@
 #include <sysdep.h>
 #include <init-arch.h>
 
-#ifndef  NOT_IN_libc
+#if IS_IN (libc)
 # define CFI_POP(REG) \
 	cfi_adjust_cfa_offset (-4); \
 	cfi_restore (REG)
diff --git a/sysdeps/i386/i686/multiarch/memcmp-sse4.S b/sysdeps/i386/i686/multiarch/memcmp-sse4.S
index a238615..570fec0 100644
--- a/sysdeps/i386/i686/multiarch/memcmp-sse4.S
+++ b/sysdeps/i386/i686/multiarch/memcmp-sse4.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/i386/i686/multiarch/memcmp-ssse3.S b/sysdeps/i386/i686/multiarch/memcmp-ssse3.S
index 4a0bd67..5463428 100644
--- a/sysdeps/i386/i686/multiarch/memcmp-ssse3.S
+++ b/sysdeps/i386/i686/multiarch/memcmp-ssse3.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/i386/i686/multiarch/memcmp.S b/sysdeps/i386/i686/multiarch/memcmp.S
index e4d56fa..1c5e30c 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.S
+++ b/sysdeps/i386/i686/multiarch/memcmp.S
@@ -22,7 +22,7 @@
 #include <init-arch.h>
 
 /* Define multiple versions only for the definition in libc. */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # ifdef SHARED
 	.text
 ENTRY(memcmp)
diff --git a/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S b/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
index c4cdcfd..a7a8f98 100644
--- a/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
+++ b/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
@@ -19,7 +19,7 @@
 
 #include <sysdep.h>
 
-#if !defined NOT_IN_libc \
+#if IS_IN (libc) \
     && (defined SHARED \
 	|| defined USE_AS_MEMMOVE \
 	|| !defined USE_MULTIARCH)
diff --git a/sysdeps/i386/i686/multiarch/memcpy-ssse3.S b/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
index c0d718b..d190ba0 100644
--- a/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
+++ b/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if !defined NOT_IN_libc \
+#if IS_IN (libc) \
     && (defined SHARED \
 	|| defined USE_AS_MEMMOVE \
 	|| !defined USE_MULTIARCH)
diff --git a/sysdeps/i386/i686/multiarch/memcpy.S b/sysdeps/i386/i686/multiarch/memcpy.S
index f583482..76195a5 100644
--- a/sysdeps/i386/i686/multiarch/memcpy.S
+++ b/sysdeps/i386/i686/multiarch/memcpy.S
@@ -24,7 +24,7 @@
 /* Define multiple versions only for the definition in lib and for
    DSO.  In static binaries we need memcpy before the initialization
    happened.  */
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 	.text
 ENTRY(memcpy)
 	.type	memcpy, @gnu_indirect_function
diff --git a/sysdeps/i386/i686/multiarch/memcpy_chk.S b/sysdeps/i386/i686/multiarch/memcpy_chk.S
index bf93b68..c67968e 100644
--- a/sysdeps/i386/i686/multiarch/memcpy_chk.S
+++ b/sysdeps/i386/i686/multiarch/memcpy_chk.S
@@ -24,7 +24,7 @@
 /* Define multiple versions only for the definition in lib and for
    DSO.  There are no multiarch memcpy functions for static binaries.
  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # ifdef SHARED
 	.text
 ENTRY(__memcpy_chk)
diff --git a/sysdeps/i386/i686/multiarch/memmove.S b/sysdeps/i386/i686/multiarch/memmove.S
index 90cf167..d8de7c6 100644
--- a/sysdeps/i386/i686/multiarch/memmove.S
+++ b/sysdeps/i386/i686/multiarch/memmove.S
@@ -22,7 +22,7 @@
 #include <init-arch.h>
 
 /* Define multiple versions only for the definition in lib.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # ifdef SHARED
 	.text
 ENTRY(memmove)
diff --git a/sysdeps/i386/i686/multiarch/memmove_chk.S b/sysdeps/i386/i686/multiarch/memmove_chk.S
index 182aeb3..3442ce1 100644
--- a/sysdeps/i386/i686/multiarch/memmove_chk.S
+++ b/sysdeps/i386/i686/multiarch/memmove_chk.S
@@ -22,7 +22,7 @@
 #include <init-arch.h>
 
 /* Define multiple versions only for the definition in lib.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # ifdef SHARED
 	.text
 ENTRY(__memmove_chk)
diff --git a/sysdeps/i386/i686/multiarch/mempcpy.S b/sysdeps/i386/i686/multiarch/mempcpy.S
index 56b50bb..3aab63d 100644
--- a/sysdeps/i386/i686/multiarch/mempcpy.S
+++ b/sysdeps/i386/i686/multiarch/mempcpy.S
@@ -24,7 +24,7 @@
 /* Define multiple versions only for the definition in lib and for
    DSO.  In static binaries we need mempcpy before the initialization
    happened.  */
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 	.text
 ENTRY(__mempcpy)
 	.type	__mempcpy, @gnu_indirect_function
diff --git a/sysdeps/i386/i686/multiarch/mempcpy_chk.S b/sysdeps/i386/i686/multiarch/mempcpy_chk.S
index a76341c..5d81f4e 100644
--- a/sysdeps/i386/i686/multiarch/mempcpy_chk.S
+++ b/sysdeps/i386/i686/multiarch/mempcpy_chk.S
@@ -24,7 +24,7 @@
 /* Define multiple versions only for the definition in lib and for
    DSO.  There are no multiarch mempcpy functions for static binaries.
  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # ifdef SHARED
 	.text
 ENTRY(__mempcpy_chk)
diff --git a/sysdeps/i386/i686/multiarch/memrchr-c.c b/sysdeps/i386/i686/multiarch/memrchr-c.c
index 44ec1a6..ef7bbbe 100644
--- a/sysdeps/i386/i686/multiarch/memrchr-c.c
+++ b/sysdeps/i386/i686/multiarch/memrchr-c.c
@@ -1,4 +1,4 @@
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # define MEMRCHR  __memrchr_ia32
 # include <string.h>
 extern void *__memrchr_ia32 (const void *, int, size_t);
diff --git a/sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S b/sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S
index 303ef9d..bc62775 100644
--- a/sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S
+++ b/sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef  NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/i386/i686/multiarch/memrchr-sse2.S b/sysdeps/i386/i686/multiarch/memrchr-sse2.S
index 90ba738..ef605d1 100644
--- a/sysdeps/i386/i686/multiarch/memrchr-sse2.S
+++ b/sysdeps/i386/i686/multiarch/memrchr-sse2.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef  NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 # define CFI_PUSH(REG)	\
diff --git a/sysdeps/i386/i686/multiarch/memrchr.S b/sysdeps/i386/i686/multiarch/memrchr.S
index 0dff8b6..5ffcc26 100644
--- a/sysdeps/i386/i686/multiarch/memrchr.S
+++ b/sysdeps/i386/i686/multiarch/memrchr.S
@@ -21,7 +21,7 @@
 #include <sysdep.h>
 #include <init-arch.h>
 
-#ifndef  NOT_IN_libc
+#if IS_IN (libc)
 # define CFI_POP(REG) \
 	cfi_adjust_cfa_offset (-4); \
 	cfi_restore (REG)
diff --git a/sysdeps/i386/i686/multiarch/memset-sse2-rep.S b/sysdeps/i386/i686/multiarch/memset-sse2-rep.S
index 8655a8c..2a064a1 100644
--- a/sysdeps/i386/i686/multiarch/memset-sse2-rep.S
+++ b/sysdeps/i386/i686/multiarch/memset-sse2-rep.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 #include <sysdep.h>
 #include "asm-syntax.h"
@@ -79,7 +79,7 @@
 #endif
 
 	.section .text.sse2,"ax",@progbits
-#if defined SHARED && !defined NOT_IN_libc && !defined USE_AS_BZERO
+#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO
 ENTRY (__memset_chk_sse2_rep)
 	movl	12(%esp), %eax
 	cmpl	%eax, 16(%esp)
diff --git a/sysdeps/i386/i686/multiarch/memset-sse2.S b/sysdeps/i386/i686/multiarch/memset-sse2.S
index cd94e4e..a48f9fa 100644
--- a/sysdeps/i386/i686/multiarch/memset-sse2.S
+++ b/sysdeps/i386/i686/multiarch/memset-sse2.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 #include <sysdep.h>
 #include "asm-syntax.h"
@@ -79,7 +79,7 @@
 #endif
 
 	.section .text.sse2,"ax",@progbits
-#if defined SHARED && !defined NOT_IN_libc && !defined USE_AS_BZERO
+#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO
 ENTRY (__memset_chk_sse2)
 	movl	12(%esp), %eax
 	cmpl	%eax, 16(%esp)
diff --git a/sysdeps/i386/i686/multiarch/memset.S b/sysdeps/i386/i686/multiarch/memset.S
index ecec1ea..c818002 100644
--- a/sysdeps/i386/i686/multiarch/memset.S
+++ b/sysdeps/i386/i686/multiarch/memset.S
@@ -22,7 +22,7 @@
 #include <init-arch.h>
 
 /* Define multiple versions only for the definition in lib.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # ifdef SHARED
 	.text
 ENTRY(memset)
diff --git a/sysdeps/i386/i686/multiarch/memset_chk.S b/sysdeps/i386/i686/multiarch/memset_chk.S
index 92c6099..f980520 100644
--- a/sysdeps/i386/i686/multiarch/memset_chk.S
+++ b/sysdeps/i386/i686/multiarch/memset_chk.S
@@ -22,7 +22,7 @@
 #include <init-arch.h>
 
 /* Define multiple versions only for the definition in lib.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # ifdef SHARED
 	.text
 ENTRY(__memset_chk)
diff --git a/sysdeps/i386/i686/multiarch/rawmemchr.S b/sysdeps/i386/i686/multiarch/rawmemchr.S
index 01850cf..db4d461 100644
--- a/sysdeps/i386/i686/multiarch/rawmemchr.S
+++ b/sysdeps/i386/i686/multiarch/rawmemchr.S
@@ -21,7 +21,7 @@
 #include <sysdep.h>
 #include <init-arch.h>
 
-#ifndef  NOT_IN_libc
+#if IS_IN (libc)
 # define CFI_POP(REG) \
 	cfi_adjust_cfa_offset (-4); \
 	cfi_restore (REG)
diff --git a/sysdeps/i386/i686/multiarch/strcat-sse2.S b/sysdeps/i386/i686/multiarch/strcat-sse2.S
index efd3f67..ae82e9a 100644
--- a/sysdeps/i386/i686/multiarch/strcat-sse2.S
+++ b/sysdeps/i386/i686/multiarch/strcat-sse2.S
@@ -18,7 +18,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/i386/i686/multiarch/strcat-ssse3.S b/sysdeps/i386/i686/multiarch/strcat-ssse3.S
index 8527166..0c506c1 100644
--- a/sysdeps/i386/i686/multiarch/strcat-ssse3.S
+++ b/sysdeps/i386/i686/multiarch/strcat-ssse3.S
@@ -18,7 +18,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/i386/i686/multiarch/strcat.S b/sysdeps/i386/i686/multiarch/strcat.S
index 598c3f0..267ad13 100644
--- a/sysdeps/i386/i686/multiarch/strcat.S
+++ b/sysdeps/i386/i686/multiarch/strcat.S
@@ -43,7 +43,7 @@
 /* Define multiple versions only for the definition in libc.  Don't
    define multiple versions for strncat in static library since we
    need strncat before the initialization happened.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # ifdef SHARED
 	.text
diff --git a/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S b/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S
index 3357f53..9ab6c82 100644
--- a/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S
+++ b/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/i386/i686/multiarch/strchr-sse2.S b/sysdeps/i386/i686/multiarch/strchr-sse2.S
index e0f3a2e..37867af 100644
--- a/sysdeps/i386/i686/multiarch/strchr-sse2.S
+++ b/sysdeps/i386/i686/multiarch/strchr-sse2.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/i386/i686/multiarch/strchr.S b/sysdeps/i386/i686/multiarch/strchr.S
index 0fc4d8c..cc0ab9d 100644
--- a/sysdeps/i386/i686/multiarch/strchr.S
+++ b/sysdeps/i386/i686/multiarch/strchr.S
@@ -21,7 +21,7 @@
 #include <sysdep.h>
 #include <init-arch.h>
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(strchr)
 	.type	strchr, @gnu_indirect_function
diff --git a/sysdeps/i386/i686/multiarch/strcmp-sse4.S b/sysdeps/i386/i686/multiarch/strcmp-sse4.S
index 42d308a..ad15aa8 100644
--- a/sysdeps/i386/i686/multiarch/strcmp-sse4.S
+++ b/sysdeps/i386/i686/multiarch/strcmp-sse4.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 #include <sysdep.h>
 #include "asm-syntax.h"
diff --git a/sysdeps/i386/i686/multiarch/strcmp-ssse3.S b/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
index c3107e5..1b32a8d 100644
--- a/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
+++ b/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 #include <sysdep.h>
 #include "asm-syntax.h"
diff --git a/sysdeps/i386/i686/multiarch/strcmp.S b/sysdeps/i386/i686/multiarch/strcmp.S
index 2ad6bf4..6449202 100644
--- a/sysdeps/i386/i686/multiarch/strcmp.S
+++ b/sysdeps/i386/i686/multiarch/strcmp.S
@@ -50,7 +50,7 @@
 /* Define multiple versions only for the definition in libc.  Don't
    define multiple versions for strncmp in static library since we
    need strncmp before the initialization happened.  */
-#if (defined SHARED || !defined USE_AS_STRNCMP) && !defined NOT_IN_libc
+#if (defined SHARED || !defined USE_AS_STRNCMP) && IS_IN (libc)
 # ifdef SHARED
 	.text
 ENTRY(STRCMP)
diff --git a/sysdeps/i386/i686/multiarch/strcpy-sse2.S b/sysdeps/i386/i686/multiarch/strcpy-sse2.S
index cbe040c..640fd06 100644
--- a/sysdeps/i386/i686/multiarch/strcpy-sse2.S
+++ b/sysdeps/i386/i686/multiarch/strcpy-sse2.S
@@ -18,7 +18,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/i386/i686/multiarch/strcpy-ssse3.S b/sysdeps/i386/i686/multiarch/strcpy-ssse3.S
index 2d67994..ad3f7fa 100644
--- a/sysdeps/i386/i686/multiarch/strcpy-ssse3.S
+++ b/sysdeps/i386/i686/multiarch/strcpy-ssse3.S
@@ -18,7 +18,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # ifndef USE_AS_STRCAT
 #  include <sysdep.h>
diff --git a/sysdeps/i386/i686/multiarch/strcpy.S b/sysdeps/i386/i686/multiarch/strcpy.S
index f44ddf7..54e5b24 100644
--- a/sysdeps/i386/i686/multiarch/strcpy.S
+++ b/sysdeps/i386/i686/multiarch/strcpy.S
@@ -59,7 +59,7 @@
 /* Define multiple versions only for the definition in libc.  Don't
    define multiple versions for strncpy in static library since we
    need strncpy before the initialization happened.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # ifdef SHARED
 	.text
diff --git a/sysdeps/i386/i686/multiarch/strcspn.S b/sysdeps/i386/i686/multiarch/strcspn.S
index c35f4bf..d60874b 100644
--- a/sysdeps/i386/i686/multiarch/strcspn.S
+++ b/sysdeps/i386/i686/multiarch/strcspn.S
@@ -41,7 +41,7 @@
 /* Define multiple versions only for the definition in libc.  Don't
    define multiple versions for strpbrk in static library since we
    need strpbrk before the initialization happened.  */
-#if (defined SHARED || !defined USE_AS_STRPBRK) && !defined NOT_IN_libc
+#if (defined SHARED || !defined USE_AS_STRPBRK) && IS_IN (libc)
 # ifdef SHARED
 	.text
 ENTRY(STRCSPN)
diff --git a/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S b/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S
index 8f9b149..7617946 100644
--- a/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S
+++ b/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 
 #include <sysdep.h>
 
diff --git a/sysdeps/i386/i686/multiarch/strlen-sse2.S b/sysdeps/i386/i686/multiarch/strlen-sse2.S
index 20e82a6..b2f8973 100644
--- a/sysdeps/i386/i686/multiarch/strlen-sse2.S
+++ b/sysdeps/i386/i686/multiarch/strlen-sse2.S
@@ -19,7 +19,7 @@
 
 /* for strlen only SHARED version is optimized, for strcat, strncat, strnlen both STATIC and SHARED are optimized */
 
-#if (defined USE_AS_STRNLEN || defined USE_AS_STRCAT || defined SHARED) && !defined NOT_IN_libc
+#if (defined USE_AS_STRNLEN || defined USE_AS_STRCAT || defined SHARED) && IS_IN (libc)
 
 # ifndef USE_AS_STRCAT
 
diff --git a/sysdeps/i386/i686/multiarch/strlen.S b/sysdeps/i386/i686/multiarch/strlen.S
index 5b262a2..6d4eb68 100644
--- a/sysdeps/i386/i686/multiarch/strlen.S
+++ b/sysdeps/i386/i686/multiarch/strlen.S
@@ -24,7 +24,7 @@
 /* Define multiple versions only for the definition in libc and for the
    DSO.  In static binaries, we need strlen before the initialization
    happened.  */
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 	.text
 ENTRY(strlen)
 	.type	strlen, @gnu_indirect_function
diff --git a/sysdeps/i386/i686/multiarch/strnlen.S b/sysdeps/i386/i686/multiarch/strnlen.S
index 63357d7..73854d5 100644
--- a/sysdeps/i386/i686/multiarch/strnlen.S
+++ b/sysdeps/i386/i686/multiarch/strnlen.S
@@ -21,7 +21,7 @@
 #include <sysdep.h>
 #include <init-arch.h>
 
-#ifndef  NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(__strnlen)
 	.type	__strnlen, @gnu_indirect_function
diff --git a/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S b/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S
index 622b9f2..09724b5 100644
--- a/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S
+++ b/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/i386/i686/multiarch/strrchr-sse2.S b/sysdeps/i386/i686/multiarch/strrchr-sse2.S
index 1644d5d..6cfb9a3 100644
--- a/sysdeps/i386/i686/multiarch/strrchr-sse2.S
+++ b/sysdeps/i386/i686/multiarch/strrchr-sse2.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/i386/i686/multiarch/strrchr.S b/sysdeps/i386/i686/multiarch/strrchr.S
index 323f3f4..24c0493 100644
--- a/sysdeps/i386/i686/multiarch/strrchr.S
+++ b/sysdeps/i386/i686/multiarch/strrchr.S
@@ -21,7 +21,7 @@
 #include <sysdep.h>
 #include <init-arch.h>
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(strrchr)
 	.type	strrchr, @gnu_indirect_function
diff --git a/sysdeps/i386/i686/multiarch/strspn.S b/sysdeps/i386/i686/multiarch/strspn.S
index 703fc17..e55e224 100644
--- a/sysdeps/i386/i686/multiarch/strspn.S
+++ b/sysdeps/i386/i686/multiarch/strspn.S
@@ -26,7 +26,7 @@
 #include <init-arch.h>
 
 /* Define multiple versions only for the definition in libc.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # ifdef SHARED
 	.text
 ENTRY(strspn)
diff --git a/sysdeps/i386/i686/multiarch/wcschr-c.c b/sysdeps/i386/i686/multiarch/wcschr-c.c
index c23af26..4c5f0f6 100644
--- a/sysdeps/i386/i686/multiarch/wcschr-c.c
+++ b/sysdeps/i386/i686/multiarch/wcschr-c.c
@@ -1,6 +1,6 @@
 #include <wchar.h>
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # ifdef SHARED
 #  undef libc_hidden_def
 #  define libc_hidden_def(name) \
diff --git a/sysdeps/i386/i686/multiarch/wcschr-sse2.S b/sysdeps/i386/i686/multiarch/wcschr-sse2.S
index 332bdb0..f0294bc 100644
--- a/sysdeps/i386/i686/multiarch/wcschr-sse2.S
+++ b/sysdeps/i386/i686/multiarch/wcschr-sse2.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <sysdep.h>
 
 # define CFI_PUSH(REG)	\
diff --git a/sysdeps/i386/i686/multiarch/wcschr.S b/sysdeps/i386/i686/multiarch/wcschr.S
index 7622085..9a80a33 100644
--- a/sysdeps/i386/i686/multiarch/wcschr.S
+++ b/sysdeps/i386/i686/multiarch/wcschr.S
@@ -21,7 +21,7 @@
 #include <sysdep.h>
 #include <init-arch.h>
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(wcschr)
 	.type	wcschr, @gnu_indirect_function
diff --git a/sysdeps/i386/i686/multiarch/wcscmp-sse2.S b/sysdeps/i386/i686/multiarch/wcscmp-sse2.S
index 926bdcf..6e273d2 100644
--- a/sysdeps/i386/i686/multiarch/wcscmp-sse2.S
+++ b/sysdeps/i386/i686/multiarch/wcscmp-sse2.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/i386/i686/multiarch/wcscmp.S b/sysdeps/i386/i686/multiarch/wcscmp.S
index 37dd07f..ed36d6b 100644
--- a/sysdeps/i386/i686/multiarch/wcscmp.S
+++ b/sysdeps/i386/i686/multiarch/wcscmp.S
@@ -24,7 +24,7 @@
 /* Define multiple versions only for the definition in libc and for the
    DSO.  In static binaries, we need wcscmp before the initialization
    happened.  */
-#ifndef  NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(wcscmp)
 	.type	wcscmp, @gnu_indirect_function
diff --git a/sysdeps/i386/i686/multiarch/wcscpy-c.c b/sysdeps/i386/i686/multiarch/wcscpy-c.c
index a3c4024..fb30003 100644
--- a/sysdeps/i386/i686/multiarch/wcscpy-c.c
+++ b/sysdeps/i386/i686/multiarch/wcscpy-c.c
@@ -1,4 +1,4 @@
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # define wcscpy  __wcscpy_ia32
 #endif
 
diff --git a/sysdeps/i386/i686/multiarch/wcscpy-ssse3.S b/sysdeps/i386/i686/multiarch/wcscpy-ssse3.S
index f404252..8b2f910 100644
--- a/sysdeps/i386/i686/multiarch/wcscpy-ssse3.S
+++ b/sysdeps/i386/i686/multiarch/wcscpy-ssse3.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <sysdep.h>
 
 # define CFI_PUSH(REG)	\
diff --git a/sysdeps/i386/i686/multiarch/wcscpy.S b/sysdeps/i386/i686/multiarch/wcscpy.S
index 54a4325..b87500c 100644
--- a/sysdeps/i386/i686/multiarch/wcscpy.S
+++ b/sysdeps/i386/i686/multiarch/wcscpy.S
@@ -22,7 +22,7 @@
 #include <init-arch.h>
 
 /* Define multiple versions only for the definition in libc. */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(wcscpy)
 	.type	wcscpy, @gnu_indirect_function
diff --git a/sysdeps/i386/i686/multiarch/wcslen-c.c b/sysdeps/i386/i686/multiarch/wcslen-c.c
index 8cebfea..a335dc0 100644
--- a/sysdeps/i386/i686/multiarch/wcslen-c.c
+++ b/sysdeps/i386/i686/multiarch/wcslen-c.c
@@ -1,6 +1,6 @@
 #include <wchar.h>
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # define WCSLEN  __wcslen_ia32
 #endif
 
diff --git a/sysdeps/i386/i686/multiarch/wcslen-sse2.S b/sysdeps/i386/i686/multiarch/wcslen-sse2.S
index 8e94545..70b73b4 100644
--- a/sysdeps/i386/i686/multiarch/wcslen-sse2.S
+++ b/sysdeps/i386/i686/multiarch/wcslen-sse2.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <sysdep.h>
 # define STR	4
 
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/wcslen.S
index ba97cc4..d42a419 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/wcslen.S
@@ -21,7 +21,7 @@
 #include <sysdep.h>
 #include <init-arch.h>
 
-#ifndef  NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(__wcslen)
 	.type	__wcslen, @gnu_indirect_function
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr-c.c b/sysdeps/i386/i686/multiarch/wcsrchr-c.c
index c7444ce..8d8a335 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr-c.c
+++ b/sysdeps/i386/i686/multiarch/wcsrchr-c.c
@@ -1,4 +1,4 @@
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # define wcsrchr  __wcsrchr_ia32
 #endif
 
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr-sse2.S b/sysdeps/i386/i686/multiarch/wcsrchr-sse2.S
index f6abd6b..0e1b291 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr-sse2.S
+++ b/sysdeps/i386/i686/multiarch/wcsrchr-sse2.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <sysdep.h>
 # define CFI_PUSH(REG)	\
 	cfi_adjust_cfa_offset (4);	\
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/wcsrchr.S
index 4d80b54..3ab1735 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/wcsrchr.S
@@ -21,7 +21,7 @@
 #include <sysdep.h>
 #include <init-arch.h>
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(wcsrchr)
 	.type	wcsrchr, @gnu_indirect_function
diff --git a/sysdeps/i386/i686/multiarch/wmemcmp-c.c b/sysdeps/i386/i686/multiarch/wmemcmp-c.c
index bd37660..75ab4b9 100644
--- a/sysdeps/i386/i686/multiarch/wmemcmp-c.c
+++ b/sysdeps/i386/i686/multiarch/wmemcmp-c.c
@@ -1,6 +1,6 @@
 #include <wchar.h>
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # define WMEMCMP  __wmemcmp_ia32
 #endif
 
diff --git a/sysdeps/i386/i686/multiarch/wmemcmp.S b/sysdeps/i386/i686/multiarch/wmemcmp.S
index 1b5a211..6790fa4 100644
--- a/sysdeps/i386/i686/multiarch/wmemcmp.S
+++ b/sysdeps/i386/i686/multiarch/wmemcmp.S
@@ -23,7 +23,7 @@
 
 /* Define multiple versions only for the definition in libc. */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(wmemcmp)
 	.type	wmemcmp, @gnu_indirect_function
diff --git a/sysdeps/ia64/fpu/libm-symbols.h b/sysdeps/ia64/fpu/libm-symbols.h
index 0df8076..3cbc6c4 100644
--- a/sysdeps/ia64/fpu/libm-symbols.h
+++ b/sysdeps/ia64/fpu/libm-symbols.h
@@ -53,6 +53,6 @@
  ASM_SIZE_DIRECTIVE(__ieee754_##name);			\
  .type __ieee754_##name, @function
 
-#if defined ASSEMBLER && !defined NOT_IN_libc
+#if defined ASSEMBLER && IS_IN (libc)
 # define __libm_error_support	HIDDEN_JUMPTARGET(__libm_error_support)
 #endif
diff --git a/sysdeps/nptl/bits/libc-lock.h b/sysdeps/nptl/bits/libc-lock.h
index b782b98..7500790 100644
--- a/sysdeps/nptl/bits/libc-lock.h
+++ b/sysdeps/nptl/bits/libc-lock.h
@@ -26,7 +26,7 @@
 
 /* Mutex type.  */
 #if defined _LIBC || defined _IO_MTSAFE_IO
-# if (defined NOT_IN_libc && !IS_IN (libpthread)) || !defined _LIBC
+# if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC
 typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
 # else
 typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t;
@@ -47,7 +47,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
 
 /* Define an initialized recursive lock variable NAME with storage
    class CLASS.  */
-#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread))
+#if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread))
 # define __libc_lock_define_initialized_recursive(CLASS, NAME) \
   CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
 # define _LIBC_LOCK_RECURSIVE_INITIALIZER \
@@ -60,7 +60,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
 #endif
 
 /* Initialize a recursive mutex.  */
-#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread))
+#if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread))
 # define __libc_lock_init_recursive(NAME) \
   ((NAME) = (__libc_lock_recursive_t) _LIBC_LOCK_RECURSIVE_INITIALIZER, 0)
 #else
@@ -78,7 +78,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
 #endif
 
 /* Finalize recursive named lock.  */
-#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread))
+#if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread))
 # define __libc_lock_fini_recursive(NAME) ((void) 0)
 #else
 # define __libc_lock_fini_recursive(NAME) \
@@ -86,7 +86,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
 #endif
 
 /* Lock the recursive named lock variable.  */
-#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread))
+#if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread))
 # define __libc_lock_lock_recursive(NAME) \
   do {									      \
     void *self = THREAD_SELF;						      \
@@ -103,7 +103,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
 #endif
 
 /* Try to lock the recursive named lock variable.  */
-#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread))
+#if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread))
 # define __libc_lock_trylock_recursive(NAME) \
   ({									      \
     int result = 0;							      \
@@ -128,7 +128,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
 #endif
 
 /* Unlock the recursive named lock variable.  */
-#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread))
+#if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread))
 /* We do no error checking here.  */
 # define __libc_lock_unlock_recursive(NAME) \
   do {									      \
diff --git a/sysdeps/nptl/bits/libc-lockP.h b/sysdeps/nptl/bits/libc-lockP.h
index c84e778..f6495b6 100644
--- a/sysdeps/nptl/bits/libc-lockP.h
+++ b/sysdeps/nptl/bits/libc-lockP.h
@@ -35,7 +35,7 @@
 #include <pthread-functions.h>
 
 /* Mutex type.  */
-#if defined NOT_IN_libc && !IS_IN (libpthread)
+#if !IS_IN (libc) && !IS_IN (libpthread)
 typedef pthread_mutex_t __libc_lock_t;
 #else
 typedef int __libc_lock_t;
@@ -69,7 +69,7 @@ typedef pthread_key_t __libc_key_t;
    initialized locks must be set to one due to the lack of normal
    atomic operations.) */
 
-#if !defined NOT_IN_libc || IS_IN (libpthread)
+#if IS_IN (libc) || IS_IN (libpthread)
 # if LLL_LOCK_INITIALIZER == 0
 #  define __libc_lock_define_initialized(CLASS,NAME) \
   CLASS __libc_lock_t NAME;
@@ -108,7 +108,7 @@ typedef pthread_key_t __libc_key_t;
 #endif
 
 /* Call thread functions through the function pointer table.  */
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # define PTFAVAIL(NAME) __libc_pthread_functions_init
 # define __libc_ptf_call(FUNC, ARGS, ELSE) \
   (__libc_pthread_functions_init ? PTHFCT_CALL (ptr_##FUNC, ARGS) : ELSE)
@@ -125,13 +125,13 @@ typedef pthread_key_t __libc_key_t;
 
 /* Initialize the named lock variable, leaving it in a consistent, unlocked
    state.  */
-#if !defined NOT_IN_libc || IS_IN (libpthread)
+#if IS_IN (libc) || IS_IN (libpthread)
 # define __libc_lock_init(NAME) ((NAME) = LLL_LOCK_INITIALIZER, 0)
 #else
 # define __libc_lock_init(NAME) \
   __libc_maybe_call (__pthread_mutex_init, (&(NAME), NULL), 0)
 #endif
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 /* ((NAME) = (__libc_rwlock_t) PTHREAD_RWLOCK_INITIALIZER, 0) is
    inefficient.  */
 # define __libc_rwlock_init(NAME) \
@@ -144,13 +144,13 @@ typedef pthread_key_t __libc_key_t;
 /* Finalize the named lock variable, which must be locked.  It cannot be
    used again until __libc_lock_init is called again on it.  This must be
    called on a lock variable before the containing storage is reused.  */
-#if !defined NOT_IN_libc || IS_IN (libpthread)
+#if IS_IN (libc) || IS_IN (libpthread)
 # define __libc_lock_fini(NAME) ((void) 0)
 #else
 # define __libc_lock_fini(NAME) \
   __libc_maybe_call (__pthread_mutex_destroy, (&(NAME)), 0)
 #endif
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # define __libc_rwlock_fini(NAME) ((void) 0)
 #else
 # define __libc_rwlock_fini(NAME) \
@@ -158,7 +158,7 @@ typedef pthread_key_t __libc_key_t;
 #endif
 
 /* Lock the named lock variable.  */
-#if !defined NOT_IN_libc || IS_IN (libpthread)
+#if IS_IN (libc) || IS_IN (libpthread)
 # ifndef __libc_lock_lock
 #  define __libc_lock_lock(NAME) \
   ({ lll_lock (NAME, LLL_PRIVATE); 0; })
@@ -174,7 +174,7 @@ typedef pthread_key_t __libc_key_t;
   __libc_ptf_call (__pthread_rwlock_wrlock, (&(NAME)), 0)
 
 /* Try to lock the named lock variable.  */
-#if !defined NOT_IN_libc || IS_IN (libpthread)
+#if IS_IN (libc) || IS_IN (libpthread)
 # ifndef __libc_lock_trylock
 #  define __libc_lock_trylock(NAME) \
   lll_trylock (NAME)
@@ -193,7 +193,7 @@ typedef pthread_key_t __libc_key_t;
   __libc_maybe_call (__pthread_mutex_trylock, (&(NAME).mutex), 0)
 
 /* Unlock the named lock variable.  */
-#if !defined NOT_IN_libc || IS_IN (libpthread)
+#if IS_IN (libc) || IS_IN (libpthread)
 # define __libc_lock_unlock(NAME) \
   lll_unlock (NAME, LLL_PRIVATE)
 #else
diff --git a/sysdeps/nptl/bits/stdio-lock.h b/sysdeps/nptl/bits/stdio-lock.h
index e2678cc..da392ed 100644
--- a/sysdeps/nptl/bits/stdio-lock.h
+++ b/sysdeps/nptl/bits/stdio-lock.h
@@ -84,7 +84,7 @@ typedef struct { int lock; int cnt; void *owner; } _IO_lock_t;
 #define _IO_cleanup_region_end(_doit) \
   __libc_cleanup_region_end (_doit)
 
-#if defined _LIBC && !defined NOT_IN_libc
+#if defined _LIBC && IS_IN (libc)
 
 # ifdef __EXCEPTIONS
 #  define _IO_acquire_lock(_fp) \
diff --git a/sysdeps/posix/closedir.c b/sysdeps/posix/closedir.c
index 24ba1a5..0b57a0d 100644
--- a/sysdeps/posix/closedir.c
+++ b/sysdeps/posix/closedir.c
@@ -43,7 +43,7 @@ __closedir (DIR *dirp)
 
   fd = dirp->fd;
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
   __libc_lock_fini (dirp->lock);
 #endif
 
diff --git a/sysdeps/posix/opendir.c b/sysdeps/posix/opendir.c
index be234bd..1ae5c0d 100644
--- a/sysdeps/posix/opendir.c
+++ b/sysdeps/posix/opendir.c
@@ -224,7 +224,7 @@ __alloc_dir (int fd, bool close_fd, int flags, const struct stat64 *statp)
     }
 
   dirp->fd = fd;
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
   __libc_lock_init (dirp->lock);
 #endif
   dirp->allocation = allocation;
diff --git a/sysdeps/posix/readdir.c b/sysdeps/posix/readdir.c
index 7bb956a..84d7f6a 100644
--- a/sysdeps/posix/readdir.c
+++ b/sysdeps/posix/readdir.c
@@ -40,7 +40,7 @@ __READDIR (DIR *dirp)
   DIRENT_TYPE *dp;
   int saved_errno = errno;
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
   __libc_lock_lock (dirp->lock);
 #endif
 
@@ -110,7 +110,7 @@ __READDIR (DIR *dirp)
       /* Skip deleted files.  */
     } while (dp->d_ino == 0);
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
   __libc_lock_unlock (dirp->lock);
 #endif
 
diff --git a/sysdeps/posix/rewinddir.c b/sysdeps/posix/rewinddir.c
index 5a4a715..a86c4cc 100644
--- a/sysdeps/posix/rewinddir.c
+++ b/sysdeps/posix/rewinddir.c
@@ -26,7 +26,7 @@ void
 rewinddir (dirp)
      DIR *dirp;
 {
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
   __libc_lock_lock (dirp->lock);
 #endif
   (void) __lseek (dirp->fd, (off_t) 0, SEEK_SET);
@@ -34,7 +34,7 @@ rewinddir (dirp)
   dirp->offset = 0;
   dirp->size = 0;
   dirp->errcode = 0;
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
   __libc_lock_unlock (dirp->lock);
 #endif
 }
diff --git a/sysdeps/powerpc/novmx-sigjmp.c b/sysdeps/powerpc/novmx-sigjmp.c
index c651f42..1f370bf 100644
--- a/sysdeps/powerpc/novmx-sigjmp.c
+++ b/sysdeps/powerpc/novmx-sigjmp.c
@@ -20,7 +20,7 @@
 
 #include <bits/wordsize.h>
 #include <shlib-compat.h>
-#if !defined NOT_IN_libc && defined SHARED
+#if IS_IN (libc) && defined SHARED
 # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
 #  include <stddef.h>
 #  include <novmxsetjmp.h>
@@ -41,4 +41,4 @@ __novmx__sigjmp_save (__novmx__sigjmp_buf env, int savemask)
 }
 
 # endif /* SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) */
-#endif /* !NOT_IN_libc && SHARED  */
+#endif /* IS_IN (libc) && SHARED  */
diff --git a/sysdeps/powerpc/powerpc32/__longjmp.S b/sysdeps/powerpc/powerpc32/__longjmp.S
index 3371176..9a83369 100644
--- a/sysdeps/powerpc/powerpc32/__longjmp.S
+++ b/sysdeps/powerpc/powerpc32/__longjmp.S
@@ -19,12 +19,12 @@
 #include <libc-symbols.h>
 #include <shlib-compat.h>
 
-#if defined NOT_IN_libc
+#if !IS_IN (libc)
 /* Build a non-versioned object for rtld-*.  */
 # define __longjmp_symbol __longjmp
 # include "__longjmp-common.S"
 
-#else /* !NOT_IN_libc */
+#else /* IS_IN (libc) */
 strong_alias (__vmx__longjmp, __longjmp);
 # define __longjmp_symbol  __vmx__longjmp
 # include "__longjmp-common.S"
@@ -36,4 +36,4 @@ strong_alias (__vmx__longjmp, __longjmp);
 #  define __longjmp_symbol  __novmx__longjmp
 #  include "__longjmp-common.S"
 # endif
-#endif /* !NOT_IN_libc */
+#endif /* IS_IN (libc) */
diff --git a/sysdeps/powerpc/powerpc32/bsd-_setjmp.S b/sysdeps/powerpc/powerpc32/bsd-_setjmp.S
index 71b6c71..b952170 100644
--- a/sysdeps/powerpc/powerpc32/bsd-_setjmp.S
+++ b/sysdeps/powerpc/powerpc32/bsd-_setjmp.S
@@ -19,7 +19,7 @@
 #include <libc-symbols.h>
 #include <sysdep.h>
 
-#if defined NOT_IN_libc
+#if !IS_IN (libc)
 /* Build a non-versioned object for rtld-*.  */
 ENTRY (_setjmp)
 	li r4,0			/* Set second argument to 0.  */
@@ -53,4 +53,4 @@ ENTRY (__vmx_setjmp)
 	b __vmx__sigsetjmp@local
 END (__vmx_setjmp)
 libc_hidden_def (__vmx_setjmp)
-#endif /* !NOT_IN_libc */
+#endif /* IS_IN (libc) */
diff --git a/sysdeps/powerpc/powerpc32/fpu/__longjmp.S b/sysdeps/powerpc/powerpc32/fpu/__longjmp.S
index 08bdd54..e68eb73 100644
--- a/sysdeps/powerpc/powerpc32/fpu/__longjmp.S
+++ b/sysdeps/powerpc/powerpc32/fpu/__longjmp.S
@@ -20,12 +20,12 @@
 #include <rtld-global-offsets.h>
 #include <shlib-compat.h>
 
-#if defined NOT_IN_libc
+#if !IS_IN (libc)
 /* Build a non-versioned object for rtld-*.  */
 # define __longjmp_symbol __longjmp
 # include "__longjmp-common.S"
 
-#else /* !NOT_IN_libc */
+#else /* IS_IN (libc) */
 /* Build a versioned object for libc.  */
 versioned_symbol (libc, __vmx__longjmp, __longjmp, GLIBC_2_3_4);
 # define __longjmp_symbol  __vmx__longjmp
@@ -39,4 +39,4 @@ compat_symbol (libc, __novmx__longjmp, __longjmp, GLIBC_2_0);
 #  define __longjmp_symbol  __novmx__longjmp
 #  include "__longjmp-common.S"
 # endif
-#endif /* !NOT_IN_libc */
+#endif /* IS_IN (libc) */
diff --git a/sysdeps/powerpc/powerpc32/fpu/setjmp.S b/sysdeps/powerpc/powerpc32/fpu/setjmp.S
index 333f707..169704f 100644
--- a/sysdeps/powerpc/powerpc32/fpu/setjmp.S
+++ b/sysdeps/powerpc/powerpc32/fpu/setjmp.S
@@ -20,13 +20,13 @@
 #include <rtld-global-offsets.h>
 #include <shlib-compat.h>
 
-#if defined NOT_IN_libc
+#if !IS_IN (libc)
 /* Build a non-versioned object for rtld-*.  */
 # define __sigsetjmp_symbol __sigsetjmp
 # define __sigjmp_save_symbol __sigjmp_save
 # include "setjmp-common.S"
 
-#else /* !NOT_IN_libc */
+#else /* IS_IN (libc) */
 /* Build a versioned object for libc.  */
 versioned_symbol (libc, __vmx__sigsetjmp, __sigsetjmp, GLIBC_2_3_4)
 # define __sigsetjmp_symbol __vmx__sigsetjmp
@@ -43,4 +43,4 @@ compat_symbol (libc, __novmx__sigsetjmp, __sigsetjmp, GLIBC_2_0)
 #  define __sigjmp_save_symbol __novmx__sigjmp_save
 #  include "setjmp-common.S"
 # endif
-#endif /* !NOT_IN_libc */
+#endif /* IS_IN (libc) */
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c
index baaa6b4..2b54622 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <strings.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c
index 94c22ef..d8c6d4d 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # undef memcpy
 /* Redefine memchr so that the compiler won't make the weak_alias point
    to internal hidden definition (__GI_memchr), since PPC32 does not
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
index 3b473a3..03c7226 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
@@ -18,7 +18,7 @@
 
 #include <sysdep.h>
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # undef EALIGN
 # define EALIGN(name, alignt, words)				\
   .globl C_SYMBOL_NAME(__memcmp_ppc);				\
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c
index 79fec67..04ed027 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-ppc32.S
index e525c2f..0f1f404 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-ppc32.S
@@ -18,7 +18,7 @@
 
 #include <sysdep.h>
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # undef EALIGN
 # define EALIGN(name, alignt, words)				\
   .globl C_SYMBOL_NAME(__memcpy_ppc);				\
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c
index f263a38..70b5298 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c
@@ -19,7 +19,7 @@
 /* Define multiple versions only for the definition in lib and for
    DSO.  In static binaries we need memcpy before the initialization
    happened.  */
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c
index 1070148..8b30143 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 /* Redefine memmove so that the compiler won't complain about the type
    mismatch with the IFUNC selector in strong_alias, below.  */
 # include <string.h>
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c b/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
index 38fbcc3..0f811f0 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c
index c30e7d6..435987a 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # define MEMRCHR  __memrchr_ppc
 # include <string.h>
 extern void *__memrchr_ppc (const void *, int, size_t);
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c
index 610a957..353a186 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S
index a907eb1..6da001a 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S
@@ -18,7 +18,7 @@
 
 #include <sysdep.h>
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # undef EALIGN
 # define EALIGN(name, alignt, words)				\
   .globl C_SYMBOL_NAME(__memset_ppc);				\
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memset.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memset.c
index e4e7982..eb1c0b1 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memset.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memset.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c
index 3f53cd5..063f12e 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp.c
index 6d1edf9..f7ef822 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # define strcasecmp __strcasecmp_ppc
 
@@ -27,7 +27,7 @@ extern __typeof (__strcasecmp) __strcasecmp_power7 attribute_hidden;
 #include <string/strcasecmp.c>
 #undef strcasecmp
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <shlib-compat.h>
 # include "init-arch.h"
 
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l.c
index 6359bf4..6291233 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # define strcasecmp_l __strcasecmp_l_ppc
 
@@ -27,7 +27,7 @@ extern __typeof (__strcasecmp_l) __strcasecmp_l_power7 attribute_hidden;
 #include <string/strcasecmp_l.c>
 #undef strcasecmp_l
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <shlib-compat.h>
 # include "init-arch.h"
 
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c
index 74a9d54..99e4e45 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c
index dab1cbf..db0aab4 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strlen-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/strlen-ppc32.S
index 3ee9f93..663d4fa 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strlen-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strlen-ppc32.S
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 
 #include <sysdep.h>
 
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c
index 1b61ba0..cb81f5d 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c
index a2227d8..a5d4ab7 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # define strncasecmp __strncasecmp_ppc
 extern __typeof (__strncasecmp) __strncasecmp_ppc attribute_hidden;
@@ -26,7 +26,7 @@ extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden;
 #include <string/strncase.c>
 #undef strncasecmp
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <shlib-compat.h>
 # include "init-arch.h"
 
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c
index 9fe3aa0..65309b3 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # define strncasecmp_l __strncasecmp_l_ppc
 extern __typeof (__strncasecmp_l) __strncasecmp_l_ppc attribute_hidden;
@@ -26,7 +26,7 @@ extern __typeof (__strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
 #include <string/strncase_l.c>
 #undef strncasecmp_l
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <shlib-compat.h>
 # include "init-arch.h"
 
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-ppc32.S
index 9a857c7..f53ab94 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-ppc32.S
@@ -17,7 +17,7 @@
 
 #include <sysdep.h>
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # undef EALIGN
 # define EALIGN(name, alignt, words)				\
   .globl C_SYMBOL_NAME(__strncmp_ppc);			\
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c
index a329f77..9faad6d 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c
index 62d4918..aca4c53 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c
index a42f70c..9a067af 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c
@@ -17,7 +17,7 @@
 
 #include <wchar.h>
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # ifdef SHARED
 #   undef libc_hidden_def
 #   define libc_hidden_def(name)  \
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c
index 216d2bc..6b8cd9c 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <wchar.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c
index c135835..148913a 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c
@@ -17,7 +17,7 @@
 
 #include <wchar.h>
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # define WCSCPY  __wcscpy_ppc
 #endif
 
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c
index 251660a..7c6edd8 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <wchar.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c
index 9c7fe2d..7b7edfb 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c
@@ -17,7 +17,7 @@
 
 #include <wchar.h>
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # define WCSRCHR  __wcsrchr_ppc
 #endif
 
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c
index 42e2d8e..deec86f 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <wchar.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy.c
index 889be25..54ca039 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <stddef.h>
 # include <memcopy.h>
 # include <shlib-compat.h>
diff --git a/sysdeps/powerpc/powerpc32/power6/memset.S b/sysdeps/powerpc/powerpc32/power6/memset.S
index 445fa44..811a7ef 100644
--- a/sysdeps/powerpc/powerpc32/power6/memset.S
+++ b/sysdeps/powerpc/powerpc32/power6/memset.S
@@ -228,7 +228,7 @@ L(nzCacheAligned128):
 	ori	r1,r1,0
         stw     rCHR,60(rMEMP3)
 	blt	cr6,L(cacheAligned1)
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	lfd	0,-128(rMEMP)
 #endif
 	b	L(nzCacheAligned256)
@@ -236,7 +236,7 @@ L(nzCacheAligned128):
 L(nzCacheAligned256):
 	cmplwi	cr1,rLEN,256
 	addi	rMEMP3,rMEMP,64
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
 /* When we are not in libc we should use only GPRs to avoid the FPU lock
    interrupt.  */
 	stw	rCHR,0(rMEMP)
diff --git a/sysdeps/powerpc/powerpc32/setjmp.S b/sysdeps/powerpc/powerpc32/setjmp.S
index 9b587e0..c73e65c 100644
--- a/sysdeps/powerpc/powerpc32/setjmp.S
+++ b/sysdeps/powerpc/powerpc32/setjmp.S
@@ -19,13 +19,13 @@
 #include <shlib-compat.h>
 #include <libc-symbols.h>
 
-#if defined NOT_IN_libc
+#if !IS_IN (libc)
 /* Build a non-versioned object for rtld-*.  */
 # define __sigsetjmp_symbol __sigsetjmp
 # define __sigjmp_save_symbol __sigjmp_save
 # include "setjmp-common.S"
 
-#else /* !NOT_IN_libc */
+#else /* IS_IN (libc) */
 /* Build a versioned object for libc.  */
 versioned_symbol (libc, __vmx__sigsetjmp, __sigsetjmp, GLIBC_2_3_4)
 # define __sigsetjmp_symbol __vmx__sigsetjmp
@@ -42,4 +42,4 @@ compat_symbol (libc, __novmx__sigsetjmp, __sigsetjmp, GLIBC_2_0)
 #  define __sigjmp_save_symbol __novmx__sigjmp_save
 #  include "setjmp-common.S"
 # endif
-#endif /* !NOT_IN_libc */
+#endif /* IS_IN (libc) */
diff --git a/sysdeps/powerpc/powerpc64/__longjmp.S b/sysdeps/powerpc/powerpc64/__longjmp.S
index 0f44681..9313eab 100644
--- a/sysdeps/powerpc/powerpc64/__longjmp.S
+++ b/sysdeps/powerpc/powerpc64/__longjmp.S
@@ -20,11 +20,11 @@
 #include <rtld-global-offsets.h>
 #include <shlib-compat.h>
 
-#if defined NOT_IN_libc
+#if !IS_IN (libc)
 /* Build a non-versioned object for rtld-*.  */
 # include "__longjmp-common.S"
 
-#else /* !NOT_IN_libc */
+#else /* IS_IN (libc) */
 strong_alias (__vmx__longjmp, __longjmp)
 # define __longjmp  __vmx__longjmp
 # include "__longjmp-common.S"
@@ -36,4 +36,4 @@ strong_alias (__vmx__longjmp, __longjmp)
 #  define __longjmp  __novmx__longjmp
 #  include "__longjmp-common.S"
 # endif
-#endif /* !NOT_IN_libc */
+#endif /* IS_IN (libc) */
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bzero.c b/sysdeps/powerpc/powerpc64/multiarch/bzero.c
index ed83541..aca4c25 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/bzero.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/bzero.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <strings.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memchr.c b/sysdeps/powerpc/powerpc64/multiarch/memchr.c
index ca0f714..1d763a6 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memchr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
index 1a39d4a..74626f5 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
@@ -22,7 +22,7 @@
 #define weak_alias(name, aliasname) \
   extern __typeof (__memcmp_ppc) aliasname \
     __attribute__ ((weak, alias ("__memcmp_ppc")));
-#if !defined(NOT_IN_libc) && defined(SHARED)
+#if IS_IN (libc) && defined(SHARED)
 # undef libc_hidden_builtin_def
 # define libc_hidden_builtin_def(name) \
   __hidden_ver1(__memcmp_ppc, __GI_memcmp, __memcmp_ppc);
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp.c b/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
index af90f0a..b0325de 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S
index c630654..8365c27 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S
@@ -18,7 +18,7 @@
 
 #include <sysdep.h>
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # undef EALIGN
 # define EALIGN(name, alignt, words)				\
   .section ".text";						\
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy.c b/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
index 305e963..22bca62 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
@@ -19,7 +19,7 @@
 /* Define multiple versions only for the definition in lib and for
    DSO.  In static binaries we need memcpy before the initialization
    happened.  */
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 /* Redefine memcpy so that the compiler won't complain about the type
    mismatch with the IFUNC selector in strong_alias, below.  */
 # undef memcpy
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c
index ff78fe6..fab0312 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c
@@ -18,7 +18,7 @@
 #include <string.h>
 
 #define MEMMOVE __memmove_ppc
-#if !defined(NOT_IN_libc) && defined(SHARED)
+#if IS_IN (libc) && defined(SHARED)
 # undef libc_hidden_builtin_def
 # define libc_hidden_builtin_def(name)
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memmove.c b/sysdeps/powerpc/powerpc64/multiarch/memmove.c
index 9a1ce8f..20a3a9e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memmove.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memmove.c
@@ -19,7 +19,7 @@
 /* Define multiple versions only for the definition in lib and for
    DSO.  In static binaries we need memmove before the initialization
    happened.  */
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 /* Redefine memmove so that the compiler won't complain about the type
    mismatch with the IFUNC selector in strong_alias, below.  */
 # undef memmove
diff --git a/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
index 38fbcc3..0f811f0 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memrchr.c b/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
index 610a957..353a186 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
index 3601a77..ff88f48 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
@@ -29,7 +29,7 @@ ENTRY (__bzero_ppc)
 END_GEN_TB (__bzero_ppc,TB_TOCLESS)
 
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # undef EALIGN
 # define EALIGN(name, alignt, words)				\
   .section ".text";						\
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset.c b/sysdeps/powerpc/powerpc64/multiarch/memset.c
index aa2ae70..3461e49 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 /* Redefine memset so that the compiler won't complain about the type
    mismatch with the IFUNC selector in strong_alias, below.  */
 # undef memset
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
index 3f53cd5..063f12e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.S
index d80c82f..b2213a8 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.S
@@ -18,7 +18,7 @@
 
 #include <sysdep.h>
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # undef EALIGN
 # define EALIGN(name, alignt, words)				\
   .section ".text";						\
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
index c7118d5..4e99eaf 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c b/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
index dbf8521..5c3551b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
index 7f02a25..3e440b5 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # define strcasecmp __strcasecmp_ppc
 extern __typeof (__strcasecmp) __strcasecmp_ppc attribute_hidden;
@@ -26,7 +26,7 @@ extern __typeof (__strcasecmp) __strcasecmp_power7 attribute_hidden;
 #include <string/strcasecmp.c>
 #undef strcasecmp
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <shlib-compat.h>
 # include "init-arch.h"
 
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
index a3374c3..623d844 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # define strcasecmp_l __strcasecmp_l_ppc
 extern __typeof (__strcasecmp_l) __strcasecmp_l_ppc attribute_hidden;
@@ -26,7 +26,7 @@ extern __typeof (__strcasecmp_l) __strcasecmp_l_power7 attribute_hidden;
 #include <string/strcasecmp_l.c>
 #undef strcasecmp_l
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <shlib-compat.h>
 # include "init-arch.h"
 
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcat.c b/sysdeps/powerpc/powerpc64/multiarch/strcat.c
index 847a62d..ec21062 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcat.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcat.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchr.c b/sysdeps/powerpc/powerpc64/multiarch/strchr.c
index 74a9d54..99e4e45 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c b/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
index dab1cbf..db0aab4 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S
index 93d1277..e65c11b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S
@@ -18,7 +18,7 @@
 
 #include <sysdep.h>
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # undef EALIGN
 # define EALIGN(name, alignt, words)				\
   .section ".text";						\
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp.c b/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
index 2013301..4d72a4b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.S
index 33a8b1c..fb38a3a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.S
@@ -18,7 +18,7 @@
 
 #include <sysdep.h>
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # undef EALIGN
 # define EALIGN(name, alignt, words)				\
   .section ".text";						\
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcpy.c b/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
index 1b6e9e0..8efebcd 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcspn.c b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
index 3609d93..156fa6a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S
index a195e9a..c9bfed0 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S
@@ -18,7 +18,7 @@
 
 #include <sysdep.h>
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # undef ENTRY
 # define ENTRY(name)						\
   .section ".text";						\
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strlen.c b/sysdeps/powerpc/powerpc64/multiarch/strlen.c
index d2c26e9..bffb039 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strlen.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 /* Redefine strlen so that the compiler won't complain about the type
    mismatch with the IFUNC selector in strong_alias, below.  */
 # undef strlen
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase.c b/sysdeps/powerpc/powerpc64/multiarch/strncase.c
index 05eba7c..8956c70 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncase.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # define strncasecmp __strncasecmp_ppc
 extern __typeof (__strncasecmp) __strncasecmp_ppc attribute_hidden;
@@ -26,7 +26,7 @@ extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden;
 #include <string/strncase.c>
 #undef strncasecmp
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <shlib-compat.h>
 # include "init-arch.h"
 
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c b/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
index 4014269..1b4bc68 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # define strncasecmp_l __strncasecmp_l_ppc
 extern __typeof (__strncasecmp_l) __strncasecmp_l_ppc attribute_hidden;
@@ -26,7 +26,7 @@ extern __typeof (__strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
 #include <string/strncase_l.c>
 #undef strncasecmp_l
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <shlib-compat.h>
 # include "init-arch.h"
 
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncat.c b/sysdeps/powerpc/powerpc64/multiarch/strncat.c
index db98ec1..cdf8926 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncat.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncat.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S
index 14a2bec..c404977 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S
@@ -17,7 +17,7 @@
 
 #include <sysdep.h>
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 #undef EALIGN
 #define EALIGN(name,alignt,words)				\
   .section ".text";						\
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp.c b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
index 9829d69..7830eba 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c
index e3111d2..79ae382 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c
@@ -22,7 +22,7 @@
 #define weak_alias(name, aliasname) \
   extern __typeof (__strncpy_ppc) aliasname \
     __attribute__ ((weak, alias ("__strncpy_ppc")));
-#if !defined(NOT_IN_libc) && defined(SHARED)
+#if IS_IN (libc) && defined(SHARED)
 # undef libc_hidden_builtin_def
 # define libc_hidden_builtin_def(name) \
   __hidden_ver1(__strncpy_ppc, __GI_strncpy, __strncpy_ppc);
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
index 8fd5e4b..771b731 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/ >.  */
 
 /* Define multiple versions only for definition in libc. */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strnlen.c b/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
index 3926031..02b654f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strpbrk.c b/sysdeps/powerpc/powerpc64/multiarch/strpbrk.c
index 8b05536..47ab6d3 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strpbrk.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strpbrk.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c
index 5633a9f..ef7cc65 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c
@@ -22,7 +22,7 @@
 #define weak_alias(name, aliasname) \
   extern __typeof (__strrchr_ppc) aliasname \
     __attribute__ ((weak, alias ("__strrchr_ppc")));
-#if !defined(NOT_IN_libc) && defined(SHARED)
+#if IS_IN (libc) && defined(SHARED)
 # undef libc_hidden_builtin_def
 # define libc_hidden_builtin_def(name) \
   __hidden_ver1(__strrchr_ppc, __GI_strrchr, __strrchr_ppc);
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strrchr.c b/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
index 046162f..11d3f62 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c
index d543772..b35af3e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c
@@ -22,7 +22,7 @@
 #define weak_alias(name, aliasname) \
   extern __typeof (__strspn_ppc) aliasname \
     __attribute__ ((weak, alias ("__strspn_ppc")));
-#if !defined(NOT_IN_libc) && defined(SHARED)
+#if IS_IN (libc) && defined(SHARED)
 # undef libc_hidden_builtin_def
 # define libc_hidden_builtin_def(name) \
   __hidden_ver1(__strspn_ppc, __GI_strspn, __strspn_ppc);
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strspn.c b/sysdeps/powerpc/powerpc64/multiarch/strspn.c
index bf8c877..dd9ec18 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strspn.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strspn.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
index 216d2bc..6b8cd9c 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <wchar.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c
index 5c0a6d3..aadf490 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <wchar.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c
index 3d0ab42..91ba389 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <wchar.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wordcopy.c b/sysdeps/powerpc/powerpc64/multiarch/wordcopy.c
index 889be25..54ca039 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wordcopy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wordcopy.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <stddef.h>
 # include <memcopy.h>
 # include <shlib-compat.h>
diff --git a/sysdeps/powerpc/powerpc64/setjmp.S b/sysdeps/powerpc/powerpc64/setjmp.S
index c15908c..a8de3bb 100644
--- a/sysdeps/powerpc/powerpc64/setjmp.S
+++ b/sysdeps/powerpc/powerpc64/setjmp.S
@@ -20,7 +20,7 @@
 #include <rtld-global-offsets.h>
 #include <shlib-compat.h>
 
-#if defined NOT_IN_libc
+#if !IS_IN (libc)
 /* Build a non-versioned object for rtld-*.  */
 # define setjmp_symbol setjmp
 # define _setjmp_symbol _setjmp
@@ -28,7 +28,7 @@
 # define __sigjmp_save_symbol __sigjmp_save
 # include "setjmp-common.S"
 
-#else /* !NOT_IN_libc */
+#else /* IS_IN (libc) */
 /* Build a versioned object for libc.  */
 versioned_symbol (libc, __vmxsetjmp, setjmp, GLIBC_2_3_4)
 versioned_symbol (libc, __vmx_setjmp, _setjmp, GLIBC_2_3_4)
@@ -58,4 +58,4 @@ compat_symbol (libc, __novmx__sigsetjmp,__sigsetjmp, GLIBC_2_3)
 #  include "setjmp-common.S"
 strong_alias (__novmxsetjmp, __novmx__setjmp)
 # endif
-#endif /* !NOT_IN_libc */
+#endif /* IS_IN (libc) */
diff --git a/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c b/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c
index 2ccfc9c..a46c9a1 100644
--- a/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c
+++ b/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c
@@ -23,7 +23,7 @@
 #define STFLE_BITS_Z10  34 /* General instructions extension */
 #define STFLE_BITS_Z196 45 /* Distinct operands, pop ... */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 #define IFUNC_RESOLVE(FUNC)						\
   asm (".globl " #FUNC "\n\t"						\
diff --git a/sysdeps/s390/s390-32/multiarch/memcmp.S b/sysdeps/s390/s390-32/multiarch/memcmp.S
index f298baa..32f08ef 100644
--- a/sysdeps/s390/s390-32/multiarch/memcmp.S
+++ b/sysdeps/s390/s390-32/multiarch/memcmp.S
@@ -27,7 +27,7 @@
 
        .text
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 ENTRY(memcmp_z196)
 	.machine "z196"
@@ -96,7 +96,7 @@ END(memcmp_z10)
 
 #include "../memcmp.S"
 
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
 .globl   memcmp
 .set     memcmp,memcmp_g5
 .weak    bcmp
diff --git a/sysdeps/s390/s390-32/multiarch/memcpy.S b/sysdeps/s390/s390-32/multiarch/memcpy.S
index 78ed737..bc65bd8 100644
--- a/sysdeps/s390/s390-32/multiarch/memcpy.S
+++ b/sysdeps/s390/s390-32/multiarch/memcpy.S
@@ -27,7 +27,7 @@
 
        .text
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 
 ENTRY(memcpy_z196)
 	.machine "z196"
@@ -92,7 +92,7 @@ END(memcpy_z10)
 
 #include "../memcpy.S"
 
-#if !defined SHARED || defined NOT_IN_libc
+#if !defined SHARED || !IS_IN (libc)
 .globl   memcpy
 .set     memcpy,memcpy_g5
 #endif
diff --git a/sysdeps/s390/s390-32/multiarch/memset.S b/sysdeps/s390/s390-32/multiarch/memset.S
index 99d7df0..971c593 100644
--- a/sysdeps/s390/s390-32/multiarch/memset.S
+++ b/sysdeps/s390/s390-32/multiarch/memset.S
@@ -27,7 +27,7 @@
 
        .text
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 ENTRY(memset_z196)
 	.machine "z196"
@@ -107,7 +107,7 @@ END(memset_mvcle)
 
 #include "../memset.S"
 
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
 .globl   memset
 .set     memset,memset_g5
 #endif
diff --git a/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c b/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c
index f8c69ff..f8b9040 100644
--- a/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c
+++ b/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c
@@ -23,7 +23,7 @@
 #define STFLE_BITS_Z10  34 /* General instructions extension */
 #define STFLE_BITS_Z196 45 /* Distinct operands, pop ... */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 #define IFUNC_RESOLVE(FUNC)						\
   asm (".globl " #FUNC "\n\t"						\
diff --git a/sysdeps/s390/s390-64/multiarch/memcmp.S b/sysdeps/s390/s390-64/multiarch/memcmp.S
index c31d7c4..8e4eca2 100644
--- a/sysdeps/s390/s390-64/multiarch/memcmp.S
+++ b/sysdeps/s390/s390-64/multiarch/memcmp.S
@@ -27,7 +27,7 @@
 
        .text
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 ENTRY(memcmp_z196)
 	.machine "z196"
@@ -93,7 +93,7 @@ END(memcmp_z10)
 
 #include "../memcmp.S"
 
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
 .globl   memcmp
 .set     memcmp,memcmp_z900
 .weak    bcmp
diff --git a/sysdeps/s390/s390-64/multiarch/memcpy.S b/sysdeps/s390/s390-64/multiarch/memcpy.S
index 6590f43..2536ef4 100644
--- a/sysdeps/s390/s390-64/multiarch/memcpy.S
+++ b/sysdeps/s390/s390-64/multiarch/memcpy.S
@@ -27,7 +27,7 @@
 
        .text
 
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 
 ENTRY(memcpy_z196)
         .machine "z196"
@@ -88,7 +88,7 @@ END(memcpy_z10)
 
 #include "../memcpy.S"
 
-#if !defined SHARED || defined NOT_IN_libc
+#if !defined SHARED || !IS_IN (libc)
 .globl   memcpy
 .set     memcpy,memcpy_z900
 #endif
diff --git a/sysdeps/s390/s390-64/multiarch/memset.S b/sysdeps/s390/s390-64/multiarch/memset.S
index 3b96269..4d52051 100644
--- a/sysdeps/s390/s390-64/multiarch/memset.S
+++ b/sysdeps/s390/s390-64/multiarch/memset.S
@@ -27,7 +27,7 @@
 
        .text
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 ENTRY(memset_z196)
 	.machine "z196"
@@ -103,7 +103,7 @@ END(memset_mvcle)
 
 #include "../memset.S"
 
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
 .globl   memset
 .set     memset,memset_z900
 #endif
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S
index 4b7b22d..a1c5588 100644
--- a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S
+++ b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S
@@ -35,7 +35,7 @@
 #define XCC xcc
 #endif
 
-#if !defined NOT_IN_libc
+#if IS_IN (libc)
 
 	.register	%g2,#scratch
 	.register	%g3,#scratch
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S
index a1a9642..a77618b 100644
--- a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S
+++ b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S
@@ -137,7 +137,7 @@
 	LOAD(ldd, base + 0x28, %x5); \
 	LOAD(ldd, base + 0x30, %x6);
 
-#if !defined NOT_IN_libc
+#if IS_IN (libc)
 
 	.register	%g2,#scratch
 	.register	%g3,#scratch
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S
index 63e0d83..24c6c6d 100644
--- a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S
+++ b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S
@@ -46,7 +46,7 @@
 #define STORE(type,src,addr)	type src, [addr]
 #define STORE_INIT(src,addr)	stxa src, [addr] STORE_ASI
 
-#if !defined NOT_IN_libc
+#if IS_IN (libc)
 
 	.register	%g2,#scratch
 	.register	%g3,#scratch
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S b/sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
index ffb3646..88a58d6 100644
--- a/sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
+++ b/sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
@@ -30,7 +30,7 @@
 #define XCC xcc
 #endif
 
-#if !defined NOT_IN_libc
+#if IS_IN (libc)
 
 	.register	%g2,#scratch
 	.register	%g3,#scratch
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy.S b/sysdeps/sparc/sparc64/multiarch/memcpy.S
index 62977a4..dad39ec 100644
--- a/sysdeps/sparc/sparc64/multiarch/memcpy.S
+++ b/sysdeps/sparc/sparc64/multiarch/memcpy.S
@@ -20,7 +20,7 @@
 
 #include <sysdep.h>
 
-#if !defined NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(memcpy)
 	.type	memcpy, @gnu_indirect_function
diff --git a/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S b/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S
index ed53522..ae45f5d 100644
--- a/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S
+++ b/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S
@@ -28,7 +28,7 @@
 #define XCC xcc
 #endif
 
-#if !defined NOT_IN_libc
+#if IS_IN (libc)
 
 	.register	%g2,#scratch
 
diff --git a/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S b/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S
index c090c50..dc17e89 100644
--- a/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S
+++ b/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S
@@ -21,7 +21,7 @@
 
 #define ASI_BLK_INIT_QUAD_LDD_P	0xe2
 
-#if !defined NOT_IN_libc
+#if IS_IN (libc)
 
 	.register	%g2, #scratch
 	.register	%g3, #scratch
diff --git a/sysdeps/sparc/sparc64/multiarch/memset.S b/sysdeps/sparc/sparc64/multiarch/memset.S
index 96c75e0..2f63fe9 100644
--- a/sysdeps/sparc/sparc64/multiarch/memset.S
+++ b/sysdeps/sparc/sparc64/multiarch/memset.S
@@ -20,7 +20,7 @@
 
 #include <sysdep.h>
 
-#if !defined NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(memset)
 	.type	memset, @gnu_indirect_function
diff --git a/sysdeps/unix/alpha/sysdep.S b/sysdeps/unix/alpha/sysdep.S
index a39ee61..22b8b6c 100644
--- a/sysdeps/unix/alpha/sysdep.S
+++ b/sysdeps/unix/alpha/sysdep.S
@@ -28,7 +28,7 @@
 	.text
 #endif
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # define SYSCALL_ERROR_ERRNO __libc_errno
 #else
 # define SYSCALL_ERROR_ERRNO errno
diff --git a/sysdeps/unix/alpha/sysdep.h b/sysdeps/unix/alpha/sysdep.h
index 0b5ff20..4a280cd 100644
--- a/sysdeps/unix/alpha/sysdep.h
+++ b/sysdeps/unix/alpha/sysdep.h
@@ -372,7 +372,7 @@ __LABEL(name)						\
 #else
 # include <stdint.h>
 # if (IS_IN (rtld) \
-      || (!defined SHARED && (!defined NOT_IN_libc \
+      || (!defined SHARED && (IS_IN (libc) \
 			      || IS_IN (libpthread))))
 extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
 #  define PTR_MANGLE(var) \
diff --git a/sysdeps/unix/make-syscalls.sh b/sysdeps/unix/make-syscalls.sh
index 6eba62c..78ddef6 100644
--- a/sysdeps/unix/make-syscalls.sh
+++ b/sysdeps/unix/make-syscalls.sh
@@ -96,7 +96,7 @@ emit_weak_aliases()
       *@@*)
 	base=`echo $name | sed 's/@@.*//'`
 	ver=`echo $name | sed 's/.*@@//;s/\./_/g'`
-	echo "	 echo '#ifndef NOT_IN_libc'; \\"
+	echo "	 echo '#if IS_IN (libc)'; \\"
 	if test -z "$vcount" ; then
 	  source=$strong
 	  vcount=1
@@ -113,7 +113,7 @@ emit_weak_aliases()
       *@*)
 	base=`echo $name | sed 's/@.*//'`
 	ver=`echo $name | sed 's/.*@//;s/\./_/g'`
-	echo "	 echo '#ifndef NOT_IN_libc'; \\"
+	echo "	 echo '#if IS_IN (libc)'; \\"
 	if test -z "$vcount" ; then
 	  source=$strong
 	  vcount=1
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 2d6d8bb..72754b7 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -179,7 +179,6 @@ sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \
 			dl-fxstatat64
 
 libof-lddlibc4 = lddlibc4
-CPPFLAGS-lddlibc4 += -DNOT_IN_libc
 
 others += pldd
 install-bin += pldd
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h
index f2f8009..de88ad2 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				\
@@ -85,7 +85,7 @@ ENTRY (name);								\
 #  define CENABLE	bl __pthread_enable_asynccancel
 #  define CDISABLE	bl __pthread_disable_asynccancel
 #  define __local_multiple_threads __pthread_multiple_threads
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  define CENABLE	bl __libc_enable_asynccancel
 #  define CDISABLE	bl __libc_disable_asynccancel
 #  define __local_multiple_threads __libc_multiple_threads
@@ -96,7 +96,7 @@ ENTRY (name);								\
 #  error Unsupported library
 # endif
 
-# if IS_IN (libpthread) || !defined NOT_IN_libc
+# if IS_IN (libpthread) || IS_IN (libc)
 #  ifndef __ASSEMBLER__
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
index 3fb67427..45a8636 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
@@ -92,7 +92,7 @@
 
 # define ret_ERRVAL ret
 
-# if NOT_IN_libc
+# if !IS_IN (libc)
 #  define SYSCALL_ERROR  .Lsyscall_error
 #  if RTLD_PRIVATE_ERRNO
 #   define SYSCALL_ERROR_HANDLER				\
@@ -310,7 +310,7 @@
 
 /* Pointer mangling is supported for AArch64.  */
 #if (IS_IN (rtld) || \
-     (!defined SHARED && (!defined NOT_IN_libc \
+     (!defined SHARED && (IS_IN (libc) \
 			  || IS_IN (libpthread))))
 # ifdef __ASSEMBLER__
 #  define PTR_MANGLE(dst, src, guard, tmp)                                \
diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h b/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h
index 5479556..d8439bf 100644
--- a/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h
@@ -21,7 +21,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 /* ??? Assumes that nothing comes between PSEUDO and PSEUDO_END
    besides "ret".  */
@@ -117,7 +117,7 @@ __LABEL($multi_error)						\
 #  define __local_enable_asynccancel	__pthread_enable_asynccancel
 #  define __local_disable_asynccancel	__pthread_disable_asynccancel
 #  define __local_multiple_threads	__pthread_multiple_threads
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  define __local_enable_asynccancel	__libc_enable_asynccancel
 #  define __local_disable_asynccancel	__libc_disable_asynccancel
 #  define __local_multiple_threads	__libc_multiple_threads
@@ -136,7 +136,7 @@ __LABEL($multi_error)						\
 #  define CDISABLE	jsr ra, __local_disable_asynccancel; ldgp ra, 0(gp)
 # endif
 
-# if IS_IN (libpthread) || !defined NOT_IN_libc
+# if IS_IN (libpthread) || IS_IN (libc)
 #  ifndef __ASSEMBLER__
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P \
diff --git a/sysdeps/unix/sysv/linux/alpha/vfork.S b/sysdeps/unix/sysv/linux/alpha/vfork.S
index befcd78..d18ae27 100644
--- a/sysdeps/unix/sysv/linux/alpha/vfork.S
+++ b/sysdeps/unix/sysv/linux/alpha/vfork.S
@@ -49,7 +49,7 @@ ENTRY(__libc_vfork)
 
 PSEUDO_END (__libc_vfork)
 
-#if !NOT_IN_libc
+#if IS_IN (libc)
 weak_alias (__libc_vfork, vfork)
 strong_alias (__libc_vfork, __vfork)
 libc_hidden_def (__vfork)
diff --git a/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h b/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
index 9211d04..f966e95 100644
--- a/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
@@ -21,7 +21,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 /* NOTE: We do mark syscalls with unwind annotations, for the benefit of
    cancellation; but they're really only accurate at the point of the
@@ -185,7 +185,7 @@
 #  define CENABLE	bl PLTJMP(__pthread_enable_asynccancel)
 #  define CDISABLE	bl PLTJMP(__pthread_disable_asynccancel)
 #  define __local_multiple_threads __pthread_multiple_threads
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  define CENABLE	bl PLTJMP(__libc_enable_asynccancel)
 #  define CDISABLE	bl PLTJMP(__libc_disable_asynccancel)
 #  define __local_multiple_threads __libc_multiple_threads
@@ -196,7 +196,7 @@
 #  error Unsupported library
 # endif
 
-# if IS_IN (libpthread) || !defined NOT_IN_libc
+# if IS_IN (libpthread) || IS_IN (libc)
 #  ifndef __ASSEMBLER__
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
diff --git a/sysdeps/unix/sysv/linux/arm/sysdep.h b/sysdeps/unix/sysv/linux/arm/sysdep.h
index 52e27d0..4863f0e 100644
--- a/sysdeps/unix/sysv/linux/arm/sysdep.h
+++ b/sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -137,7 +137,7 @@
 
 #define ret_ERRVAL PSEUDO_RET_NOERRNO
 
-#if NOT_IN_libc
+#if !IS_IN (libc)
 # define SYSCALL_ERROR __local_syscall_error
 # if RTLD_PRIVATE_ERRNO
 #  define SYSCALL_ERROR_HANDLER					\
diff --git a/sysdeps/unix/sysv/linux/getpid.c b/sysdeps/unix/sysv/linux/getpid.c
index 937b1d4..af5db44 100644
--- a/sysdeps/unix/sysv/linux/getpid.c
+++ b/sysdeps/unix/sysv/linux/getpid.c
@@ -21,7 +21,7 @@
 #include <sysdep.h>
 
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 static inline __attribute__((always_inline)) pid_t really_getpid (pid_t oldval);
 
 static inline __attribute__((always_inline)) pid_t
@@ -48,7 +48,7 @@ really_getpid (pid_t oldval)
 pid_t
 __getpid (void)
 {
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
   INTERNAL_SYSCALL_DECL (err);
   pid_t result = INTERNAL_SYSCALL (getpid, err, 0);
 #else
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
index 9a60492..2a4d273 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
@@ -58,7 +58,7 @@
 /* Initialize locks to zero.  */
 #define LLL_MUTEX_LOCK_INITIALIZER (0)
 
-#if !defined NOT_IN_libc || IS_IN (rtld)
+#if IS_IN (libc) || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h
index 5d4ff34..aec3f37 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 # ifndef NO_ERROR
 #  define NO_ERROR -0x1000
@@ -216,7 +216,7 @@ L(pre_end):						ASM_LINE_SEP	\
 #   define CDISABLE .import __pthread_disable_asynccancel,code ASM_LINE_SEP \
 			bl __pthread_disable_asynccancel,%r2 ASM_LINE_SEP
 #  endif
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  ifdef PIC
 #   define CENABLE .import __libc_enable_asynccancel,code ASM_LINE_SEP \
 			bl __libc_enable_asynccancel,%r2 ASM_LINE_SEP
@@ -246,7 +246,7 @@ L(pre_end):						ASM_LINE_SEP	\
 
 # if IS_IN (libpthread)
 #  define __local_multiple_threads __pthread_multiple_threads
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  define __local_multiple_threads __libc_multiple_threads
 # elif IS_IN (librt)
 #  define __local_multiple_threads __librt_multiple_threads
@@ -271,7 +271,7 @@ L(pre_end):						ASM_LINE_SEP	\
 # define NO_CANCELLATION 1
 
 #endif
-/* !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) */
+/* IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) */
 
 #ifndef __ASSEMBLER__
 # define RTLD_SINGLE_THREAD_P \
diff --git a/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S b/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
index 4ed46fc..13596f1 100644
--- a/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
+++ b/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
@@ -115,7 +115,7 @@ __lll_lock_wait_private:
 	cfi_endproc
 	.size	__lll_lock_wait_private,.-__lll_lock_wait_private
 
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
 	.globl	__lll_lock_wait
 	.type	__lll_lock_wait,@function
 	.hidden	__lll_lock_wait
@@ -361,7 +361,7 @@ __lll_unlock_wake_private:
 	cfi_endproc
 	.size	__lll_unlock_wake_private,.-__lll_unlock_wake_private
 
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
 	.globl	__lll_unlock_wake
 	.type	__lll_unlock_wake,@function
 	.hidden	__lll_unlock_wake
diff --git a/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/sysdeps/unix/sysv/linux/i386/lowlevellock.h
index ffae477..1032f4b 100644
--- a/sysdeps/unix/sysv/linux/i386/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/i386/lowlevellock.h
@@ -71,7 +71,7 @@
 #define LLL_SHARED	FUTEX_PRIVATE_FLAG
 
 
-#if !defined NOT_IN_libc || IS_IN (rtld)
+#if IS_IN (libc) || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
@@ -169,7 +169,7 @@
    value is zero.  In case the operation failed, the cmpxchg instruction
    has loaded the current value of the memory work which is guaranteed
    to be nonzero.  */
-#if defined NOT_IN_libc || defined UP
+#if !IS_IN (libc) || defined UP
 # define __lll_trylock_asm LOCK_INSTR "cmpxchgl %2, %1"
 #else
 # define __lll_trylock_asm "cmpl $0, %%gs:%P5\n\t" \
@@ -198,7 +198,7 @@
 		       : "memory");					      \
      ret; })
 
-#if defined NOT_IN_libc || defined UP
+#if !IS_IN (libc) || defined UP
 # define __lll_lock_asm_start LOCK_INSTR "cmpxchgl %1, %2\n\t"
 #else
 # define __lll_lock_asm_start "cmpl $0, %%gs:%P6\n\t"			      \
@@ -324,7 +324,7 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count,
 		       : "memory");					      \
      result; })
 
-#if defined NOT_IN_libc || defined UP
+#if !IS_IN (libc) || defined UP
 # define __lll_unlock_asm LOCK_INSTR "subl $1, %0\n\t"
 #else
 # define __lll_unlock_asm "cmpl $0, %%gs:%P3\n\t"			      \
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h b/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
index c17ff6c..ab15b9d 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				      \
@@ -111,7 +111,7 @@
 # if IS_IN (libpthread)
 #  define CENABLE	call __pthread_enable_asynccancel;
 #  define CDISABLE	call __pthread_disable_asynccancel
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  define CENABLE	call __libc_enable_asynccancel;
 #  define CDISABLE	call __libc_disable_asynccancel
 # elif IS_IN (librt)
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
index b538004..d751c58 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -34,7 +34,7 @@
 #define SYS_ify(syscall_name)	__NR_##syscall_name
 
 #if defined USE_DL_SYSINFO \
-    && (!defined NOT_IN_libc || IS_IN (libpthread))
+    && (IS_IN (libc) || IS_IN (libpthread))
 # define I386_USE_SYSENTER	1
 #else
 # undef I386_USE_SYSENTER
@@ -115,7 +115,7 @@
 
 # elif defined _LIBC_REENTRANT
 
-#  ifndef NOT_IN_libc
+#  if IS_IN (libc)
 #   define SYSCALL_ERROR_ERRNO __libc_errno
 #  else
 #   define SYSCALL_ERROR_ERRNO errno
diff --git a/sysdeps/unix/sysv/linux/ia64/lowlevellock.h b/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
index fe4a90e..b586731 100644
--- a/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
@@ -52,7 +52,7 @@
 #define LLL_SHARED	FUTEX_PRIVATE_FLAG
 
 
-#if !defined NOT_IN_libc || IS_IN (rtld)
+#if IS_IN (libc) || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
index 0458fce..c402dca 100644
--- a/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
@@ -22,11 +22,11 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 
-# ifndef NOT_IN_libc
+# if IS_IN (libc)
 #  define SYSDEP_CANCEL_ERRNO __libc_errno
 # else
 #  define SYSDEP_CANCEL_ERRNO errno
@@ -182,7 +182,7 @@ __GC_##name:								      \
 # if IS_IN (libpthread)
 #  define CENABLE	br.call.sptk.many b0 = __pthread_enable_asynccancel
 #  define CDISABLE	br.call.sptk.many b0 = __pthread_disable_asynccancel
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  define CENABLE	br.call.sptk.many b0 = __libc_enable_asynccancel
 #  define CDISABLE	br.call.sptk.many b0 = __libc_disable_asynccancel
 # elif IS_IN (librt)
diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.S b/sysdeps/unix/sysv/linux/ia64/sysdep.S
index 004ade1..9ec8951 100644
--- a/sysdeps/unix/sysv/linux/ia64/sysdep.S
+++ b/sysdeps/unix/sysv/linux/ia64/sysdep.S
@@ -34,7 +34,7 @@ ENTRY(__syscall_error)
 	st4	[r2]=r8
 	mov	r8=-1
 #else
-# ifndef NOT_IN_libc
+# if IS_IN (libc)
 #  define SYSCALL_ERROR_ERRNO __libc_errno
 # else
 #  define SYSCALL_ERROR_ERRNO errno
diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.h b/sysdeps/unix/sysv/linux/ia64/sysdep.h
index 0943852..49684f8 100644
--- a/sysdeps/unix/sysv/linux/ia64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/ia64/sysdep.h
@@ -61,7 +61,7 @@
 #endif
 
 #if defined USE_DL_SYSINFO \
-	&& (!defined NOT_IN_libc \
+	&& (IS_IN (libc) \
 	    || IS_IN (libpthread) || IS_IN (librt))
 # define IA64_USE_NEW_STUB
 #else
diff --git a/sysdeps/unix/sysv/linux/lowlevellock-futex.h b/sysdeps/unix/sysv/linux/lowlevellock-futex.h
index 11150b3..8927661 100644
--- a/sysdeps/unix/sysv/linux/lowlevellock-futex.h
+++ b/sysdeps/unix/sysv/linux/lowlevellock-futex.h
@@ -49,7 +49,7 @@
 #define LLL_SHARED	FUTEX_PRIVATE_FLAG
 
 
-#if !defined NOT_IN_libc || IS_IN (rtld)
+#if IS_IN (libc) || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h b/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h
index b75bf17..aa116c4 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h
@@ -35,7 +35,7 @@
 
 /* We define __rtld_* copies for rtld.
    We need them visible in libc to initialize.  */
-#  if IS_IN (rtld) || !defined NOT_IN_libc
+#  if IS_IN (rtld) || IS_IN (libc)
 extern void *__rtld___vdso_read_tp;
 extern void *__rtld___vdso_atomic_cmpxchg_32;
 extern void *__rtld___vdso_atomic_barrier;
@@ -44,7 +44,7 @@ extern void *__rtld___vdso_atomic_barrier;
 extern void __vdso_read_tp_stub (void);
 extern void __vdso_atomic_cmpxchg_32_stub (void);
 extern void __vdso_atomic_barrier_stub (void);
-#  endif /* IS_IN (rtld) || !NOT_IN_libc */
+#  endif /* IS_IN (rtld) || IS_IN (libc) */
 
 /* RTLD should only use its own copies.  */
 #  if !IS_IN (rtld)
diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h b/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h
index 33ce922..d5b8445 100644
--- a/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				      \
@@ -103,7 +103,7 @@
 # if IS_IN (libpthread)
 #  define CENABLE	PSEUDO_JMP (__pthread_enable_asynccancel)
 #  define CDISABLE	PSEUDO_JMP (__pthread_disable_asynccancel)
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  define CENABLE	PSEUDO_JMP (__libc_enable_asynccancel)
 #  define CDISABLE	PSEUDO_JMP (__libc_disable_asynccancel)
 # elif IS_IN (librt)
diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.h b/sysdeps/unix/sysv/linux/m68k/sysdep.h
index 3a91e86..9709088 100644
--- a/sysdeps/unix/sysv/linux/m68k/sysdep.h
+++ b/sysdeps/unix/sysv/linux/m68k/sysdep.h
@@ -101,7 +101,7 @@ SYSCALL_ERROR_LABEL:							      \
     move.l %d0, %a0;							      \
     rts;
 # elif defined _LIBC_REENTRANT
-#  ifndef NOT_IN_libc
+#  if IS_IN (libc)
 #   define SYSCALL_ERROR_ERRNO __libc_errno
 #  else
 #   define SYSCALL_ERROR_ERRNO errno
diff --git a/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h b/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h
index 9c21eeb..6592484 100644
--- a/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/microblaze/lowlevellock.h
@@ -52,7 +52,7 @@
 #define LLL_SHARED  FUTEX_PRIVATE_FLAG
 
 
-#if !defined NOT_IN_libc || IS_IN (rtld)
+#if IS_IN (libc) || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private)                                      \
diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h b/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
index 0fe5b12..5e185a3 100644
--- a/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
@@ -21,7 +21,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 # if !IS_IN (librt) || !defined(PIC)
 #  define AC_STACK_SIZE  16  /* space for r15, async_cancel arg and 2 temp words */
@@ -106,7 +106,7 @@ L(pseudo_cancel):                                                    \
 #  define CENABLE PSEUDO_JMP (__pthread_enable_asynccancel)
 #  define CDISABLE  PSEUDO_JMP (__pthread_disable_asynccancel)
 #  define __local_multiple_threads __pthread_multiple_threads
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  define CENABLE PSEUDO_JMP (__libc_enable_asynccancel)
 #  define CDISABLE  PSEUDO_JMP (__libc_disable_asynccancel)
 #  define __local_multiple_threads __libc_multiple_threads
@@ -118,7 +118,7 @@ L(pseudo_cancel):                                                    \
 # endif
 
 
-# if IS_IN (libpthread) || !defined NOT_IN_libc
+# if IS_IN (libpthread) || IS_IN (libc)
 #  ifndef __ASSEMBLER__
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
index 6f79b14..40e4225 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
@@ -27,7 +27,7 @@
    happen before any instructions.  So we use cfi_same_value instead of
    cfi_restore.  */
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 #ifdef __PIC__
 # undef PSEUDO
diff --git a/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h b/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
index 1d711f7..e12eea7 100644
--- a/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 # ifdef __PIC__
 #  define PSEUDO_CPLOAD .cpload t9;
diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h
index 1d65f20..0858ce8 100644
--- a/sysdeps/unix/sysv/linux/not-cancel.h
+++ b/sysdeps/unix/sysv/linux/not-cancel.h
@@ -19,7 +19,7 @@
 
 #include <sysdep.h>
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 extern int __open_nocancel (const char *, int, ...) attribute_hidden;
 extern int __close_nocancel (int) attribute_hidden;
 extern int __read_nocancel (int, void *, size_t) attribute_hidden;
diff --git a/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h b/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
index 54ccc41..49cbca7 100644
--- a/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
@@ -52,7 +52,7 @@
 #define LLL_PRIVATE	0
 #define LLL_SHARED	FUTEX_PRIVATE_FLAG
 
-#if !defined NOT_IN_libc || IS_IN (rtld)
+#if IS_IN (libc) || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
index 25bf797..db1dfb8 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
@@ -23,7 +23,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				\
@@ -84,7 +84,7 @@
 # if IS_IN (libpthread)
 #  define CENABLE	bl __pthread_enable_asynccancel@local
 #  define CDISABLE	bl __pthread_disable_asynccancel@local
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  define CENABLE	bl __libc_enable_asynccancel@local
 #  define CDISABLE	bl __libc_disable_asynccancel@local
 # elif IS_IN (librt)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
index 8683b6b..9fff750 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
@@ -23,7 +23,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
 #  define DASHDASHPFX(str) .__##str
@@ -107,7 +107,7 @@
 #   define CENABLE	bl JUMPTARGET(__pthread_enable_asynccancel); nop
 #   define CDISABLE	bl JUMPTARGET(__pthread_disable_asynccancel); nop
 #  endif
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  ifdef SHARED
 #   define CENABLE	bl JUMPTARGET(__libc_enable_asynccancel)
 #   define CDISABLE	bl JUMPTARGET(__libc_disable_asynccancel)
diff --git a/sysdeps/unix/sysv/linux/s390/longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/longjmp_chk.c
index 02c96c2..d18fbdf 100644
--- a/sysdeps/unix/sysv/linux/s390/longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/s390/longjmp_chk.c
@@ -20,7 +20,7 @@
 
 #include <shlib-compat.h>
 
-#if !defined NOT_IN_libc && defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
+#if IS_IN (libc) && defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
 /* this is a copy from debug/longjmp_chk.c because we need an unique name
    for __longjmp_chk, but it is already named via a define
    for __libc_siglongjmp in debug/longjmp_chk.c.  */
diff --git a/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/sysdeps/unix/sysv/linux/s390/lowlevellock.h
index 2c17b2c..14fb4a8 100644
--- a/sysdeps/unix/sysv/linux/s390/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/s390/lowlevellock.h
@@ -51,7 +51,7 @@
 #define LLL_SHARED	FUTEX_PRIVATE_FLAG
 
 
-#if !defined NOT_IN_libc || IS_IN (rtld)
+#if IS_IN (libc) || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
index d19500d..3b027e0 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				      \
@@ -78,7 +78,7 @@ L(pseudo_end):
 # if IS_IN (libpthread)
 #  define CENABLE	__pthread_enable_asynccancel
 #  define CDISABLE	__pthread_disable_asynccancel
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  define CENABLE	__libc_enable_asynccancel
 #  define CDISABLE	__libc_disable_asynccancel
 # elif IS_IN (librt)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S
index de3f8a4..aca7e22 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S
@@ -31,7 +31,7 @@
 	.text
 ENTRY(__syscall_error)
 #ifndef PIC
-# ifndef NOT_IN_libc
+# if IS_IN (libc)
 #  define SYSCALL_ERROR_ERRNO __libc_errno
 # else
 #  define SYSCALL_ERROR_ERRNO errno
@@ -54,7 +54,7 @@ ENTRY(__syscall_error)
 	br	%r14
 1:	.long	rtld_errno - 0b
 # else
-#  ifndef NOT_IN_libc
+#  if IS_IN (libc)
 #   define SYSCALL_ERROR_ERRNO __libc_errno
 #  else
 #   define SYSCALL_ERROR_ERRNO errno
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
index e6fd96a..f0ef41c 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
@@ -105,7 +105,7 @@
     br    %r14;								      \
 2:  .long rtld_errno-1b
 # elif defined _LIBC_REENTRANT
-#  ifndef NOT_IN_libc
+#  if IS_IN (libc)
 #   define SYSCALL_ERROR_ERRNO __libc_errno
 #  else
 #   define SYSCALL_ERROR_ERRNO errno
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S b/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S
index 290e464..3a368c8 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S
@@ -52,7 +52,7 @@ ENTRY (__libc_vfork)
 	br	%r14
 PSEUDO_END (__libc_vfork)
 
-#if !NOT_IN_libc
+#if IS_IN (libc)
 weak_alias (__libc_vfork, vfork)
 strong_alias (__libc_vfork, __vfork)
 libc_hidden_def (__vfork)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
index 9622d5a..4955ec1 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				      \
@@ -73,7 +73,7 @@ L(pseudo_end):
 #  define CENABLE	__pthread_enable_asynccancel
 #  define CDISABLE	__pthread_disable_asynccancel
 #  define __local_multiple_threads	__pthread_multiple_threads
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  define CENABLE	__libc_enable_asynccancel
 #  define CDISABLE	__libc_disable_asynccancel
 #  define __local_multiple_threads	__libc_multiple_threads
@@ -111,7 +111,7 @@ L(pseudo_end):
 #define LR7_6		lg %r7,56+160(%r15); \
 			cfi_restore (%r7);
 
-# if IS_IN (libpthread) || !defined NOT_IN_libc
+# if IS_IN (libpthread) || IS_IN (libc)
 #  ifndef __ASSEMBLER__
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P \
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S
index 0fbfe9c..6b4a613 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S
@@ -32,7 +32,7 @@
 .text
 ENTRY(__syscall_error)
 #ifndef PIC
-# ifndef NOT_IN_libc
+# if IS_IN (libc)
 #  define SYSCALL_ERROR_ERRNO __libc_errno
 # else
 #  define SYSCALL_ERROR_ERRNO errno
@@ -55,7 +55,7 @@ ENTRY(__syscall_error)
 	lghi	%r2,-1
 	br	%r14
 # else
-#  ifndef NOT_IN_libc
+#  if IS_IN (libc)
 #   define SYSCALL_ERROR_ERRNO __libc_errno
 #  else
 #   define SYSCALL_ERROR_ERRNO errno
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
index 917a636..696e4b3 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
@@ -113,7 +113,7 @@
     lghi  %r2,-1;							      \
     br    %r14
 # elif defined _LIBC_REENTRANT
-#  ifndef NOT_IN_libc
+#  if IS_IN (libc)
 #   define SYSCALL_ERROR_ERRNO __libc_errno
 #  else
 #   define SYSCALL_ERROR_ERRNO errno
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S b/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S
index 7de1bb0..54bb272 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S
@@ -53,7 +53,7 @@ ENTRY (__libc_vfork)
 	br	%r14
 PSEUDO_END (__libc_vfork)
 
-#if !NOT_IN_libc
+#if IS_IN (libc)
 weak_alias (__libc_vfork, vfork)
 strong_alias (__libc_vfork, __vfork)
 libc_hidden_def (__vfork)
diff --git a/sysdeps/unix/sysv/linux/sh/lowlevellock.S b/sysdeps/unix/sysv/linux/sh/lowlevellock.S
index 84b8edb..3fab373 100644
--- a/sysdeps/unix/sysv/linux/sh/lowlevellock.S
+++ b/sysdeps/unix/sysv/linux/sh/lowlevellock.S
@@ -172,7 +172,7 @@ __lll_lock_wait_private:
 	cfi_endproc
 	.size	__lll_lock_wait_private,.-__lll_lock_wait_private
 
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
 	.globl	__lll_lock_wait
 	.type	__lll_lock_wait,@function
 	.hidden	__lll_lock_wait
@@ -454,7 +454,7 @@ __lll_unlock_wake_private:
 	cfi_endproc
 	.size	__lll_unlock_wake_private,.-__lll_unlock_wake_private
 
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
 	.globl	__lll_unlock_wake
 	.type	__lll_unlock_wake,@function
 	.hidden	__lll_unlock_wake
diff --git a/sysdeps/unix/sysv/linux/sh/lowlevellock.h b/sysdeps/unix/sysv/linux/sh/lowlevellock.h
index 328446c..e6dbab2 100644
--- a/sysdeps/unix/sysv/linux/sh/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/sh/lowlevellock.h
@@ -49,7 +49,7 @@
 #define LLL_SHARED     FUTEX_PRIVATE_FLAG
 
 
-#if !defined NOT_IN_libc || IS_IN (rtld)
+#if IS_IN (libc) || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h b/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
index 131f42b..9b5911c 100644
--- a/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
@@ -21,7 +21,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 # define _IMM12 #-12
 # define _IMM16 #-16
@@ -108,7 +108,7 @@
 # if IS_IN (libpthread)
 #  define __local_enable_asynccancel	__pthread_enable_asynccancel
 #  define __local_disable_asynccancel	__pthread_disable_asynccancel
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  define __local_enable_asynccancel	__libc_enable_asynccancel
 #  define __local_disable_asynccancel	__libc_disable_asynccancel
 # elif IS_IN (librt)
diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.h b/sysdeps/unix/sysv/linux/sh/sysdep.h
index 4fc5dd7..6f57854 100644
--- a/sysdeps/unix/sysv/linux/sh/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sh/sysdep.h
@@ -116,7 +116,7 @@
 
 # elif defined _LIBC_REENTRANT
 
-#  ifndef NOT_IN_libc
+#  if IS_IN (libc)
 #   define SYSCALL_ERROR_ERRNO __libc_errno
 #  else
 #   define SYSCALL_ERROR_ERRNO errno
diff --git a/sysdeps/unix/sysv/linux/sh/vfork.S b/sysdeps/unix/sysv/linux/sh/vfork.S
index 76326f5..63ca023 100644
--- a/sysdeps/unix/sysv/linux/sh/vfork.S
+++ b/sysdeps/unix/sysv/linux/sh/vfork.S
@@ -66,7 +66,7 @@ ENTRY (__libc_vfork)
 	.align	2
 PSEUDO_END (__libc_vfork)
 
-#if !NOT_IN_libc
+#if IS_IN (libc)
 weak_alias (__libc_vfork, vfork)
 strong_alias (__libc_vfork, __vfork)
 libc_hidden_def (__vfork)
diff --git a/sysdeps/unix/sysv/linux/sparc/lowlevellock.h b/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
index eebf406..5c8c3f4 100644
--- a/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
@@ -57,7 +57,7 @@ extern void __cpu_relax (void);
 #define BUSY_WAIT_NOP	__cpu_relax ()
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (rtld)
+#if IS_IN (libc) || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
index cc7adfc..526e875 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)	\
@@ -71,7 +71,7 @@ __##syscall_name##_nocancel:			\
 # if IS_IN (libpthread)
 #  define CENABLE	call __pthread_enable_asynccancel
 #  define CDISABLE	call __pthread_disable_asynccancel
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  define CENABLE	call __libc_enable_asynccancel
 #  define CDISABLE	call __libc_disable_asynccancel
 # elif IS_IN (librt)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
index e5bb3b5..c9f38f4 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
@@ -79,7 +79,7 @@ ENTRY(name);					\
 	 mov	-1, %o0;
 # elif defined _LIBC_REENTRANT
 
-#  ifndef NOT_IN_libc
+#  if IS_IN (libc)
 #   define SYSCALL_ERROR_ERRNO __libc_errno
 #  else
 #   define SYSCALL_ERROR_ERRNO errno
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S b/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S
index 567163f..875ee3d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S
@@ -89,7 +89,7 @@ ENTRY (__brk)
 #endif
 	st	%o0, [%g1]
 #else
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	call	HIDDEN_JUMPTARGET(__errno_location)
 #else
 	call	__errno_location
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
index aee3dee..e11f7c1 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)	\
@@ -69,7 +69,7 @@ __##syscall_name##_nocancel:			\
 # if IS_IN (libpthread)
 #  define CENABLE	call __pthread_enable_asynccancel
 #  define CDISABLE	call __pthread_disable_asynccancel
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  define CENABLE	call __libc_enable_asynccancel
 #  define CDISABLE	call __libc_disable_asynccancel
 # elif IS_IN (librt)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
index e9aedce..52b07c2 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
@@ -89,7 +89,7 @@ ENTRY(name);					\
 	 mov	-1, %o0;
 # elif defined _LIBC_REENTRANT
 
-#  ifndef NOT_IN_libc
+#  if IS_IN (libc)
 #   define SYSCALL_ERROR_ERRNO __libc_errno
 #  else
 #   define SYSCALL_ERROR_ERRNO errno
diff --git a/sysdeps/unix/sysv/linux/tile/lowlevellock.h b/sysdeps/unix/sysv/linux/tile/lowlevellock.h
index c9d2e54..7f49e27 100644
--- a/sysdeps/unix/sysv/linux/tile/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/tile/lowlevellock.h
@@ -52,7 +52,7 @@
 #define LLL_SHARED	FUTEX_PRIVATE_FLAG
 
 
-#if !defined NOT_IN_libc || IS_IN (rtld)
+#if IS_IN (libc) || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
diff --git a/sysdeps/unix/sysv/linux/tile/sysdep-cancel.h b/sysdeps/unix/sysv/linux/tile/sysdep-cancel.h
index 028c393..6c10552 100644
--- a/sysdeps/unix/sysv/linux/tile/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/tile/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 /* Allow hacking in some extra code if desired. */
 #ifndef PSEUDO_EXTRA
diff --git a/sysdeps/unix/sysv/linux/tile/sysdep.h b/sysdeps/unix/sysv/linux/tile/sysdep.h
index a79a936..5847dda 100644
--- a/sysdeps/unix/sysv/linux/tile/sysdep.h
+++ b/sysdeps/unix/sysv/linux/tile/sysdep.h
@@ -45,7 +45,7 @@
 #ifndef PIC
 /* For static code, on error jump to __syscall_error directly. */
 # define SYSCALL_ERROR_NAME __syscall_error
-#elif !defined NOT_IN_libc || IS_IN (libpthread)
+#elif IS_IN (libc) || IS_IN (libpthread)
 /* Use the internal name for libc/libpthread shared objects. */
 # define SYSCALL_ERROR_NAME __GI___syscall_error
 #else
diff --git a/sysdeps/unix/sysv/linux/tile/waitpid.S b/sysdeps/unix/sysv/linux/tile/waitpid.S
index e613b1c..58d7205 100644
--- a/sysdeps/unix/sysv/linux/tile/waitpid.S
+++ b/sysdeps/unix/sysv/linux/tile/waitpid.S
@@ -1,7 +1,7 @@
 /*
 extern pid_t __waitpid_nocancel (pid_t, int *, int) attribute_hidden;
 */
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 /* Call __NR_wait4, providing fourth argument (struct rusage *) as NULL. */
 #define PSEUDO_EXTRA move r3, zero;
diff --git a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
index f2dca07..5d8e77c 100644
--- a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
+++ b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
@@ -108,7 +108,7 @@ __lll_lock_wait_private:
 	cfi_endproc
 	.size	__lll_lock_wait_private,.-__lll_lock_wait_private
 
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
 	.globl	__lll_lock_wait
 	.type	__lll_lock_wait,@function
 	.hidden	__lll_lock_wait
@@ -348,7 +348,7 @@ __lll_unlock_wake_private:
 	cfi_endproc
 	.size	__lll_unlock_wake_private,.-__lll_unlock_wake_private
 
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
 	.globl	__lll_unlock_wake
 	.type	__lll_unlock_wake,@function
 	.hidden	__lll_unlock_wake
diff --git a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
index 37c0faf..2f0cf5c 100644
--- a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
@@ -72,7 +72,7 @@
 
 #ifndef __ASSEMBLER__
 
-#if !defined NOT_IN_libc || IS_IN (rtld)
+#if IS_IN (libc) || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
 # ifdef __ASSUME_PRIVATE_FUTEX
 #  define __lll_private_flag(fl, private) \
@@ -145,7 +145,7 @@
    value is zero.  In case the operation failed, the cmpxchg instruction
    has loaded the current value of the memory work which is guaranteed
    to be nonzero.  */
-#if defined NOT_IN_libc || defined UP
+#if !IS_IN (libc) || defined UP
 # define __lll_trylock_asm LOCK_INSTR "cmpxchgl %2, %1"
 #else
 # define __lll_trylock_asm "cmpl $0, __libc_multiple_threads(%%rip)\n\t"      \
@@ -174,7 +174,7 @@
 		       : "memory");					      \
      ret; })
 
-#if defined NOT_IN_libc || defined UP
+#if !IS_IN (libc) || defined UP
 # define __lll_lock_asm_start LOCK_INSTR "cmpxchgl %4, %2\n\t"		      \
 			      "jz 24f\n\t"
 #else
@@ -316,7 +316,7 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count,
 		       : "memory", "cx", "cc", "r10", "r11");		      \
      result; })
 
-#if defined NOT_IN_libc || defined UP
+#if !IS_IN (libc) || defined UP
 # define __lll_unlock_asm_start LOCK_INSTR "decl %0\n\t"		      \
 				"je 24f\n\t"
 #else
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h
index 2667292..cecaec1 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
 /* The code to disable cancellation depends on the fact that the called
    functions are special.  They don't modify registers other than %rax
@@ -63,7 +63,7 @@
 #  define CENABLE	call __pthread_enable_asynccancel;
 #  define CDISABLE	call __pthread_disable_asynccancel;
 #  define __local_multiple_threads __pthread_multiple_threads
-# elif !defined NOT_IN_libc
+# elif IS_IN (libc)
 #  define CENABLE	call __libc_enable_asynccancel;
 #  define CDISABLE	call __libc_disable_asynccancel;
 #  define __local_multiple_threads __libc_multiple_threads
@@ -74,7 +74,7 @@
 #  error Unsupported library
 # endif
 
-# if IS_IN (libpthread) || !defined NOT_IN_libc
+# if IS_IN (libpthread) || IS_IN (libc)
 #  ifndef __ASSEMBLER__
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P \
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index 6377183..16c497b 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -115,7 +115,7 @@
   neg %eax;					\
   movl %eax, (%rcx)
 # else
-#  ifndef NOT_IN_libc
+#  if IS_IN (libc)
 #   define SYSCALL_ERROR_ERRNO __libc_errno
 #  else
 #   define SYSCALL_ERROR_ERRNO errno
diff --git a/sysdeps/wordsize-32/symbol-hacks.h b/sysdeps/wordsize-32/symbol-hacks.h
index 11e4701..38b2b74 100644
--- a/sysdeps/wordsize-32/symbol-hacks.h
+++ b/sysdeps/wordsize-32/symbol-hacks.h
@@ -23,7 +23,7 @@
    therefore we get PLTs.  Unnecessarily so.  Changing gcc is a big
    task which might not be worth it so we play tricks with the
    assembler.  */
-#if !defined __ASSEMBLER__ && !defined in_divdi3_c && !defined NOT_IN_libc && defined SHARED
+#if !defined __ASSEMBLER__ && !defined in_divdi3_c && IS_IN (libc) && defined SHARED
 asm ("__divdi3 = __divdi3_internal");
 asm ("__udivdi3 = __udivdi3_internal");
 asm ("__moddi3 = __moddi3_internal");
diff --git a/sysdeps/x86_64/memcpy.S b/sysdeps/x86_64/memcpy.S
index 60f3c65..2c9aa5a 100644
--- a/sysdeps/x86_64/memcpy.S
+++ b/sysdeps/x86_64/memcpy.S
@@ -30,7 +30,7 @@
 #  define RETVAL	(0)
 #else
 #  define RETVAL	(-8)
-#  if defined SHARED && !defined USE_MULTIARCH && !defined NOT_IN_libc
+#  if defined SHARED && !defined USE_MULTIARCH && IS_IN (libc)
 #    define memcpy	__memcpy
 #    undef libc_hidden_builtin_def
 #    define libc_hidden_builtin_def(name) \
@@ -44,7 +44,7 @@
 
         .text
 
-#if defined PIC && !defined NOT_IN_libc
+#if defined PIC && IS_IN (libc)
 ENTRY_CHK (__memcpy_chk)
 
 	cmpq	%rdx, %rcx
@@ -253,14 +253,14 @@ L(32after):
 /* Handle blocks smaller than 1/2 L1. */
 
 L(fasttry):				/* first 1/2 L1 */
-#ifndef NOT_IN_libc			/* only up to this algorithm outside of libc.so */
+#if IS_IN (libc)			/* only up to this algorithm outside of libc.so */
 	mov	__x86_data_cache_size_half(%rip), %R11_LP
 	cmpq	%rdx, %r11		/* calculate the smaller of */
 	cmovaq	%rdx, %r11		/* remaining bytes and 1/2 L1 */
 #endif
 
 L(fast):				/* good ol' MOVS */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	movq	%r11, %rcx
 	andq	$-8, %r11
 #else
@@ -275,7 +275,7 @@ L(fast):				/* good ol' MOVS */
 	.p2align 4,, 4
 
 L(fastskip):
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	subq	%r11, %rdx		/* check for more */
 	testq	$-8, %rdx
 	jnz	L(fastafter)
@@ -294,7 +294,7 @@ L(fastskip):
 #endif
 	retq				/* exit */
 
-#ifndef NOT_IN_libc			/* none of the algorithms below for RTLD */
+#if IS_IN (libc)			/* none of the algorithms below for RTLD */
 
 	.p2align 4
 
@@ -570,13 +570,13 @@ L(NTskip):
 #endif
 	retq				/* exit */
 
-#endif /* !NOT_IN_libc */
+#endif /* IS_IN (libc) */
 
 END(memcpy)
 
 #ifndef USE_AS_MEMPCPY
 libc_hidden_builtin_def (memcpy)
-# if defined SHARED && !defined USE_MULTIARCH && !defined NOT_IN_libc
+# if defined SHARED && !defined USE_MULTIARCH && IS_IN (libc)
 #  undef memcpy
 #  include <shlib-compat.h>
 versioned_symbol (libc, __memcpy, memcpy, GLIBC_2_14);
diff --git a/sysdeps/x86_64/memmove.c b/sysdeps/x86_64/memmove.c
index 202f5b8..d538eba 100644
--- a/sysdeps/x86_64/memmove.c
+++ b/sysdeps/x86_64/memmove.c
@@ -17,7 +17,7 @@
 
 #include "string/memmove.c"
 
-#if !defined memmove && !defined NOT_IN_libc
+#if !defined memmove && IS_IN (libc)
 #include <shlib-compat.h>
 
 #if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14)
diff --git a/sysdeps/x86_64/memset.S b/sysdeps/x86_64/memset.S
index db4fb84..7fec577 100644
--- a/sysdeps/x86_64/memset.S
+++ b/sysdeps/x86_64/memset.S
@@ -20,7 +20,7 @@
 #include <sysdep.h>
 
 	.text
-#if !defined NOT_IN_libc
+#if IS_IN (libc)
 ENTRY(__bzero)
 	movq	%rdi, %rax /* Set return value.  */
 	movq	%rsi, %rdx /* Set n.  */
@@ -42,7 +42,7 @@ ENTRY(__memset_tail)
 END(__memset_tail)
 #endif
 
-#if defined PIC && !defined NOT_IN_libc
+#if defined PIC && IS_IN (libc)
 ENTRY_CHK (__memset_chk)
 	cmpq	%rdx, %rcx
 	jb	HIDDEN_JUMPTARGET (__chk_fail)
@@ -125,7 +125,7 @@ L(between8_16bytes):
 END (memset)
 libc_hidden_builtin_def (memset)
 
-#if defined PIC && !defined NOT_IN_libc && !defined USE_MULTIARCH
+#if defined PIC && IS_IN (libc) && !defined USE_MULTIARCH
 strong_alias (__memset_chk, __memset_zero_constant_len_parameter)
 	.section .gnu.warning.__memset_zero_constant_len_parameter
 	.string "memset used with constant zero length parameter; this could be due to transposed parameters"
diff --git a/sysdeps/x86_64/multiarch/init-arch.h b/sysdeps/x86_64/multiarch/init-arch.h
index ef0abbd..c701edd 100644
--- a/sysdeps/x86_64/multiarch/init-arch.h
+++ b/sysdeps/x86_64/multiarch/init-arch.h
@@ -122,7 +122,7 @@ extern void __init_cpu_features (void) attribute_hidden;
 extern const struct cpu_features *__get_cpu_features (void)
      __attribute__ ((const));
 
-# ifndef NOT_IN_libc
+# if IS_IN (libc)
 #  define __get_cpu_features()	(&__cpu_features)
 # endif
 
diff --git a/sysdeps/x86_64/multiarch/memcmp-sse4.S b/sysdeps/x86_64/multiarch/memcmp-sse4.S
index e753d62..e747e97 100644
--- a/sysdeps/x86_64/multiarch/memcmp-sse4.S
+++ b/sysdeps/x86_64/multiarch/memcmp-sse4.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/x86_64/multiarch/memcmp-ssse3.S b/sysdeps/x86_64/multiarch/memcmp-ssse3.S
index 5f7572f..82297ed 100644
--- a/sysdeps/x86_64/multiarch/memcmp-ssse3.S
+++ b/sysdeps/x86_64/multiarch/memcmp-ssse3.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/x86_64/multiarch/memcmp.S b/sysdeps/x86_64/multiarch/memcmp.S
index 627d8d0..f0beaeb 100644
--- a/sysdeps/x86_64/multiarch/memcmp.S
+++ b/sysdeps/x86_64/multiarch/memcmp.S
@@ -22,7 +22,7 @@
 #include <init-arch.h>
 
 /* Define multiple versions only for the definition in libc. */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(memcmp)
 	.type	memcmp, @gnu_indirect_function
diff --git a/sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S b/sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S
index 3cac1e3..eb5de25 100644
--- a/sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S
+++ b/sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S
@@ -18,7 +18,7 @@
 
 #include <sysdep.h>
 
-#if !defined NOT_IN_libc \
+#if IS_IN (libc) \
     && (defined SHARED \
         || defined USE_AS_MEMMOVE \
 	|| !defined USE_MULTIARCH)
diff --git a/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S b/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
index 899ccbc..2fa465b 100644
--- a/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
+++ b/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
@@ -19,7 +19,7 @@
 
 #include <sysdep.h>
 
-#if !defined NOT_IN_libc \
+#if IS_IN (libc) \
     && (defined SHARED \
         || defined USE_AS_MEMMOVE \
 	|| !defined USE_MULTIARCH)
diff --git a/sysdeps/x86_64/multiarch/memcpy-ssse3.S b/sysdeps/x86_64/multiarch/memcpy-ssse3.S
index 0ad9a00..7d0755e 100644
--- a/sysdeps/x86_64/multiarch/memcpy-ssse3.S
+++ b/sysdeps/x86_64/multiarch/memcpy-ssse3.S
@@ -19,7 +19,7 @@
 
 #include <sysdep.h>
 
-#if !defined NOT_IN_libc \
+#if IS_IN (libc) \
     && (defined SHARED \
         || defined USE_AS_MEMMOVE \
 	|| !defined USE_MULTIARCH)
diff --git a/sysdeps/x86_64/multiarch/memcpy.S b/sysdeps/x86_64/multiarch/memcpy.S
index e666695..1523313 100644
--- a/sysdeps/x86_64/multiarch/memcpy.S
+++ b/sysdeps/x86_64/multiarch/memcpy.S
@@ -25,7 +25,7 @@
 /* Define multiple versions only for the definition in lib and for
    DSO.  In static binaries we need memcpy before the initialization
    happened.  */
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 	.text
 ENTRY(__new_memcpy)
 	.type	__new_memcpy, @gnu_indirect_function
diff --git a/sysdeps/x86_64/multiarch/memcpy_chk.S b/sysdeps/x86_64/multiarch/memcpy_chk.S
index 076b19a..ded14ab 100644
--- a/sysdeps/x86_64/multiarch/memcpy_chk.S
+++ b/sysdeps/x86_64/multiarch/memcpy_chk.S
@@ -24,7 +24,7 @@
 /* Define multiple versions only for the definition in lib and for
    DSO.  There are no multiarch memcpy functions for static binaries.
  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # ifdef SHARED
 	.text
 ENTRY(__memcpy_chk)
diff --git a/sysdeps/x86_64/multiarch/memmove.c b/sysdeps/x86_64/multiarch/memmove.c
index 0c9af7e..31d00f8 100644
--- a/sysdeps/x86_64/multiarch/memmove.c
+++ b/sysdeps/x86_64/multiarch/memmove.c
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # define MEMMOVE __memmove_sse2
 # ifdef SHARED
 #  undef libc_hidden_builtin_def
@@ -41,7 +41,7 @@ extern __typeof (__redirect_memmove) __memmove_avx_unaligned attribute_hidden;
 
 #include "string/memmove.c"
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <shlib-compat.h>
 # include "init-arch.h"
 
diff --git a/sysdeps/x86_64/multiarch/mempcpy.S b/sysdeps/x86_64/multiarch/mempcpy.S
index 7589d8c..3b7bdb0 100644
--- a/sysdeps/x86_64/multiarch/mempcpy.S
+++ b/sysdeps/x86_64/multiarch/mempcpy.S
@@ -24,7 +24,7 @@
 /* Define multiple versions only for the definition in lib and for
    DSO.  In static binaries we need mempcpy before the initialization
    happened.  */
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
 ENTRY(__mempcpy)
 	.type	__mempcpy, @gnu_indirect_function
 	cmpl	$0, KIND_OFFSET+__cpu_features(%rip)
diff --git a/sysdeps/x86_64/multiarch/mempcpy_chk.S b/sysdeps/x86_64/multiarch/mempcpy_chk.S
index 88e0b74..c0d33fe 100644
--- a/sysdeps/x86_64/multiarch/mempcpy_chk.S
+++ b/sysdeps/x86_64/multiarch/mempcpy_chk.S
@@ -24,7 +24,7 @@
 /* Define multiple versions only for the definition in lib and for
    DSO.  There are no multiarch mempcpy functions for static binaries.
  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # ifdef SHARED
 	.text
 ENTRY(__mempcpy_chk)
diff --git a/sysdeps/x86_64/multiarch/memset-avx2.S b/sysdeps/x86_64/multiarch/memset-avx2.S
index b45f8a0..0de0800 100644
--- a/sysdeps/x86_64/multiarch/memset-avx2.S
+++ b/sysdeps/x86_64/multiarch/memset-avx2.S
@@ -18,7 +18,7 @@
 
 #include <sysdep.h>
 
-#if !defined NOT_IN_libc
+#if IS_IN (libc)
 
 #include "asm-syntax.h"
 #ifndef MEMSET
diff --git a/sysdeps/x86_64/multiarch/memset.S b/sysdeps/x86_64/multiarch/memset.S
index 00d46d1..61868c7 100644
--- a/sysdeps/x86_64/multiarch/memset.S
+++ b/sysdeps/x86_64/multiarch/memset.S
@@ -23,7 +23,7 @@
 #include <init-arch.h>
 
 /* Define multiple versions only for the definition in lib.  */
-# ifndef NOT_IN_libc
+# if IS_IN (libc)
 ENTRY(memset)
 	.type	memset, @gnu_indirect_function
 	cmpl	$0, __cpu_features+KIND_OFFSET(%rip)
@@ -37,7 +37,7 @@ ENTRY(memset)
 END(memset)
 # endif
 
-# if !defined NOT_IN_libc
+# if IS_IN (libc)
 #  undef memset
 #  define memset __memset_sse2
 
diff --git a/sysdeps/x86_64/multiarch/memset_chk.S b/sysdeps/x86_64/multiarch/memset_chk.S
index 8a607bd..7528a42 100644
--- a/sysdeps/x86_64/multiarch/memset_chk.S
+++ b/sysdeps/x86_64/multiarch/memset_chk.S
@@ -21,7 +21,7 @@
 #include <init-arch.h>
 
 /* Define multiple versions only for the definition in lib.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # if defined SHARED && defined HAVE_AVX2_SUPPORT
 ENTRY(__memset_chk)
 	.type	__memset_chk, @gnu_indirect_function
diff --git a/sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S b/sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S
index dc782f2..9b8db7a 100644
--- a/sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S
+++ b/sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/x86_64/multiarch/strcat-ssse3.S b/sysdeps/x86_64/multiarch/strcat-ssse3.S
index fde7b90..9448125 100644
--- a/sysdeps/x86_64/multiarch/strcat-ssse3.S
+++ b/sysdeps/x86_64/multiarch/strcat-ssse3.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 
diff --git a/sysdeps/x86_64/multiarch/strcat.S b/sysdeps/x86_64/multiarch/strcat.S
index d5c9d84..5318780 100644
--- a/sysdeps/x86_64/multiarch/strcat.S
+++ b/sysdeps/x86_64/multiarch/strcat.S
@@ -43,7 +43,7 @@
 
 
 /* Define multiple versions only for the definition in libc.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(STRCAT)
 	.type	STRCAT, @gnu_indirect_function
diff --git a/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S b/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S
index 0b3f096..7870494 100644
--- a/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S
+++ b/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef  NOT_IN_libc
+#if IS_IN (libc)
 
 # include <sysdep.h>
 # include "asm-syntax.h"
diff --git a/sysdeps/x86_64/multiarch/strchr.S b/sysdeps/x86_64/multiarch/strchr.S
index 63a35fa..3f247b6 100644
--- a/sysdeps/x86_64/multiarch/strchr.S
+++ b/sysdeps/x86_64/multiarch/strchr.S
@@ -21,7 +21,7 @@
 
 
 /* Define multiple versions only for the definition in libc.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(strchr)
 	.type	strchr, @gnu_indirect_function
diff --git a/sysdeps/x86_64/multiarch/strcmp-ssse3.S b/sysdeps/x86_64/multiarch/strcmp-ssse3.S
index 43b3f30..1b7fa33 100644
--- a/sysdeps/x86_64/multiarch/strcmp-ssse3.S
+++ b/sysdeps/x86_64/multiarch/strcmp-ssse3.S
@@ -1,4 +1,4 @@
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # define USE_SSSE3 1
 # define STRCMP __strcmp_ssse3
 # include "../strcmp.S"
diff --git a/sysdeps/x86_64/multiarch/strcmp.S b/sysdeps/x86_64/multiarch/strcmp.S
index f3e0ca1..84b97fa 100644
--- a/sysdeps/x86_64/multiarch/strcmp.S
+++ b/sysdeps/x86_64/multiarch/strcmp.S
@@ -80,7 +80,7 @@
 /* Define multiple versions only for the definition in libc.  Don't
    define multiple versions for strncmp in static library since we
    need strncmp before the initialization happened.  */
-#if (defined SHARED || !defined USE_AS_STRNCMP) && !defined NOT_IN_libc
+#if (defined SHARED || !defined USE_AS_STRNCMP) && IS_IN (libc)
 	.text
 ENTRY(STRCMP)
 	.type	STRCMP, @gnu_indirect_function
diff --git a/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S b/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S
index be7513d..d616d1a 100644
--- a/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S
+++ b/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # ifndef USE_AS_STRCAT
 #  include <sysdep.h>
diff --git a/sysdeps/x86_64/multiarch/strcpy-ssse3.S b/sysdeps/x86_64/multiarch/strcpy-ssse3.S
index 86569ff..7ca044d 100644
--- a/sysdeps/x86_64/multiarch/strcpy-ssse3.S
+++ b/sysdeps/x86_64/multiarch/strcpy-ssse3.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 # ifndef USE_AS_STRCAT
 #  include <sysdep.h>
diff --git a/sysdeps/x86_64/multiarch/strcpy.S b/sysdeps/x86_64/multiarch/strcpy.S
index 80ed98b..0467b21 100644
--- a/sysdeps/x86_64/multiarch/strcpy.S
+++ b/sysdeps/x86_64/multiarch/strcpy.S
@@ -57,7 +57,7 @@
 
 
 /* Define multiple versions only for the definition in libc.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(STRCPY)
 	.type	STRCPY, @gnu_indirect_function
diff --git a/sysdeps/x86_64/multiarch/strcspn.S b/sysdeps/x86_64/multiarch/strcspn.S
index 24f55e9..1250dc8 100644
--- a/sysdeps/x86_64/multiarch/strcspn.S
+++ b/sysdeps/x86_64/multiarch/strcspn.S
@@ -41,7 +41,7 @@
 /* Define multiple versions only for the definition in libc.  Don't
    define multiple versions for strpbrk in static library since we
    need strpbrk before the initialization happened.  */
-#if (defined SHARED || !defined USE_AS_STRPBRK) && !defined NOT_IN_libc
+#if (defined SHARED || !defined USE_AS_STRPBRK) && IS_IN (libc)
 	.text
 ENTRY(STRCSPN)
 	.type	STRCSPN, @gnu_indirect_function
diff --git a/sysdeps/x86_64/multiarch/strspn.S b/sysdeps/x86_64/multiarch/strspn.S
index bf7308e..6630926 100644
--- a/sysdeps/x86_64/multiarch/strspn.S
+++ b/sysdeps/x86_64/multiarch/strspn.S
@@ -26,7 +26,7 @@
 #include <init-arch.h>
 
 /* Define multiple versions only for the definition in libc.  */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(strspn)
 	.type	strspn, @gnu_indirect_function
diff --git a/sysdeps/x86_64/multiarch/wcscpy-c.c b/sysdeps/x86_64/multiarch/wcscpy-c.c
index f27c069..a51a83a 100644
--- a/sysdeps/x86_64/multiarch/wcscpy-c.c
+++ b/sysdeps/x86_64/multiarch/wcscpy-c.c
@@ -1,4 +1,4 @@
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # define wcscpy  __wcscpy_sse2
 #endif
 
diff --git a/sysdeps/x86_64/multiarch/wcscpy-ssse3.S b/sysdeps/x86_64/multiarch/wcscpy-ssse3.S
index c79389e..5b188ac 100644
--- a/sysdeps/x86_64/multiarch/wcscpy-ssse3.S
+++ b/sysdeps/x86_64/multiarch/wcscpy-ssse3.S
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <sysdep.h>
 
 	.section .text.ssse3,"ax",@progbits
diff --git a/sysdeps/x86_64/multiarch/wcscpy.S b/sysdeps/x86_64/multiarch/wcscpy.S
index f12ba27..43ffe6d 100644
--- a/sysdeps/x86_64/multiarch/wcscpy.S
+++ b/sysdeps/x86_64/multiarch/wcscpy.S
@@ -22,7 +22,7 @@
 #include <init-arch.h>
 
 /* Define multiple versions only for the definition in libc. */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 	.text
 ENTRY(wcscpy)
diff --git a/sysdeps/x86_64/multiarch/wmemcmp-c.c b/sysdeps/x86_64/multiarch/wmemcmp-c.c
index 1074238..46b6715 100644
--- a/sysdeps/x86_64/multiarch/wmemcmp-c.c
+++ b/sysdeps/x86_64/multiarch/wmemcmp-c.c
@@ -1,4 +1,4 @@
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 # include <wchar.h>
 
 # define WMEMCMP  __wmemcmp_sse2
diff --git a/sysdeps/x86_64/multiarch/wmemcmp.S b/sysdeps/x86_64/multiarch/wmemcmp.S
index 37b9bba..c5b211d 100644
--- a/sysdeps/x86_64/multiarch/wmemcmp.S
+++ b/sysdeps/x86_64/multiarch/wmemcmp.S
@@ -22,7 +22,7 @@
 #include <init-arch.h>
 
 /* Define multiple versions only for the definition in libc. */
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 	.text
 ENTRY(wmemcmp)
 	.type	wmemcmp, @gnu_indirect_function
diff --git a/sysdeps/x86_64/strcmp.S b/sysdeps/x86_64/strcmp.S
index fc45a62..b022a04 100644
--- a/sysdeps/x86_64/strcmp.S
+++ b/sysdeps/x86_64/strcmp.S
@@ -32,7 +32,7 @@
 /* The simplified code below is not set up to handle strncmp() so far.
    Should this become necessary it has to be implemented.  For now
    just report the problem.  */
-# ifdef NOT_IN_libc
+# if !IS_IN (libc)
 #  error "strncmp not implemented so far"
 # endif
 
@@ -51,7 +51,7 @@
 # include "locale-defines.h"
 
 /* No support for strcasecmp outside libc so far since it is not needed.  */
-# ifdef NOT_IN_libc
+# if !IS_IN (libc)
 #  error "strcasecmp_l not implemented so far"
 # endif
 
@@ -60,7 +60,7 @@
 # include "locale-defines.h"
 
 /* No support for strncasecmp outside libc so far since it is not needed.  */
-# ifdef NOT_IN_libc
+# if !IS_IN (libc)
 #  error "strncasecmp_l not implemented so far"
 # endif
 
@@ -126,7 +126,7 @@ libc_hidden_def (__strncasecmp)
 #endif
 
 ENTRY (STRCMP)
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
 /* Simple version since we can't use SSE registers in ld.so.  */
 L(oop):	movb	(%rdi), %al
 	cmpb	(%rsi), %al
@@ -144,7 +144,7 @@ L(neq):	movl	$1, %eax
 	cmovbl	%ecx, %eax
 	ret
 END (STRCMP)
-#else	/* NOT_IN_libc */
+#else	/* !IS_IN (libc) */
 # ifdef USE_AS_STRCASECMP_L
 	/* We have to fall back on the C implementation for locales
 	   with encodings not matching ASCII for single bytes.  */
@@ -2300,5 +2300,5 @@ LABEL(unaligned_table):
 	.int	LABEL(ashr_14) - LABEL(unaligned_table)
 	.int	LABEL(ashr_15) - LABEL(unaligned_table)
 	.int	LABEL(ashr_0) - LABEL(unaligned_table)
-#endif /* NOT_IN_libc */
+#endif /* !IS_IN (libc) */
 libc_hidden_builtin_def (STRCMP)
-- 
1.9.3

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

* [PATCH 06/19] Define IN_MODULE for translation units that define NOT_IN_libc
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (8 preceding siblings ...)
  2014-08-21 10:58 ` [PATCH 02/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
@ 2014-08-21 10:58 ` Siddhesh Poyarekar
  2014-08-22 18:28   ` Roland McGrath
  2014-09-17 12:29   ` [PATCH v2 06/19] Define IN_MODULE for translation units that define NOT_IN_libc Siddhesh Poyarekar
  2014-08-21 10:58 ` [PATCH 05/19] Remove IN_LIB Siddhesh Poyarekar
                   ` (10 subsequent siblings)
  20 siblings, 2 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Make sure that all instances where NOT_IN_libc is defined also defines
IN_MODULE to facilitate removal NOT_IN_libc in future passes.

Verified that the generated code is unchanged on x86_64.

	* elf/Makefile (libof-sotruss-lib): Set as extramodules.
	(libof-interp): Likewise.
---
 elf/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/elf/Makefile b/elf/Makefile
index c25bec0..d93898f 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -96,6 +96,7 @@ extra-objs += sotruss-lib.os sotruss-lib.so
 install-others += $(inst_auditdir)/sotruss-lib.so
 install-bin-script += sotruss
 generated += sotruss
+libof-sotruss-lib = extramodules
 CPPFLAGS-sotruss-lib = -DNOT_IN_libc
 $(objpfx)sotruss-lib.so: $(objpfx)sotruss-lib.os
 	$(build-module-asneeded)
@@ -354,6 +355,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
 	mv -f $@.new $@
 
 # interp.c exists just to get this string into the libraries.
+libof-interp = extramodules
 CFLAGS-interp.c = -D'RUNTIME_LINKER="$(rtlddir)/$(rtld-installed-name)"' \
 		  -DNOT_IN_libc=1
 $(objpfx)interp.os: $(common-objpfx)config.make
-- 
1.9.3

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

* [PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
  2014-08-21 10:58 ` [PATCH 13/19] Remove IS_IN_libm Siddhesh Poyarekar
  2014-08-21 10:58 ` [PATCH 16/19] Remove NOT_IN_libc Siddhesh Poyarekar
@ 2014-08-21 10:58 ` Siddhesh Poyarekar
  2014-09-17 12:47   ` [ping][PATCH " Siddhesh Poyarekar
  2014-08-21 10:58 ` [PATCH 10/19] Remove IS_IN_libdl Siddhesh Poyarekar
                   ` (17 subsequent siblings)
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Verified that the generated code is unchanged on x86_64.

	* scripts/gen-libc-modules.awk (END): Generate defines for
	MODULE_NAME.
	* include/stap-probe.h (LIBC_PROBE_1): Use MODULE_NAME instead
	of IN_LIB.
	(STAP_PROBE_ASM): Likewise.
---
 include/stap-probe.h         | 6 +++---
 scripts/gen-libc-modules.awk | 9 ++++++++-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/include/stap-probe.h b/include/stap-probe.h
index 688646c..150fc1e 100644
--- a/include/stap-probe.h
+++ b/include/stap-probe.h
@@ -30,7 +30,7 @@
 
    Systemtap's header defines the macros STAP_PROBE (provider, name) and
    STAP_PROBEn (provider, name, arg1, ..., argn).  For "provider" we paste
-   in the IN_LIB name (libc, libpthread, etc.) automagically.
+   in MODULE_NAME (libc, libpthread, etc.) automagically.
 
    The format of the arg parameters is discussed here:
 
@@ -53,7 +53,7 @@
 # endif
 
 # define LIBC_PROBE(name, n, ...)	\
-  LIBC_PROBE_1 (IN_LIB, name, n, ## __VA_ARGS__)
+  LIBC_PROBE_1 (MODULE_NAME, name, n, ## __VA_ARGS__)
 
 # define LIBC_PROBE_1(lib, name, n, ...) \
   STAP_PROBE##n (lib, name, ## __VA_ARGS__)
@@ -61,7 +61,7 @@
 # define STAP_PROBE0		STAP_PROBE
 
 # define LIBC_PROBE_ASM(name, template) \
-  STAP_PROBE_ASM (IN_LIB, name, template)
+  STAP_PROBE_ASM (MODULE_NAME, name, template)
 
 # define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS
 
diff --git a/scripts/gen-libc-modules.awk b/scripts/gen-libc-modules.awk
index d3382b6..1ae4af3 100644
--- a/scripts/gen-libc-modules.awk
+++ b/scripts/gen-libc-modules.awk
@@ -32,9 +32,16 @@ match (FILENAME, ".*soversions.i") {
 
 # Finally, print out the header file.
 END {
-  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n\n")
+  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n")
   i = 1
+  print ("\n/* Allowed values for IN_MODULE.  */")
   for (l in libs) {
     printf ("#define MODULE_%s %d\n", l, libs[l])
   }
+  print ("\n/* Module names, used in stap-probe.h */")
+  for (l in libs) {
+    printf ("#if IN_MODULE == MODULE_%s\n", l)
+    printf ("# define MODULE_NAME %s\n", l)
+    printf ("#endif\n")
+  }
 }
-- 
1.9.3

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

* [PATCH 10/19] Remove IS_IN_libdl
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (2 preceding siblings ...)
  2014-08-21 10:58 ` [PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB Siddhesh Poyarekar
@ 2014-08-21 10:58 ` Siddhesh Poyarekar
  2014-08-22 18:30   ` Roland McGrath
  2014-08-21 10:58 ` [PATCH 12/19] Remove IS_IN_libpthread Siddhesh Poyarekar
                   ` (16 subsequent siblings)
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Replace with IS_IN (libdl).  No changes to generated code on x86_64.

	* dlfcn/dladdr.c: Use IS_IN.
	* dlfcn/dladdr1.c: Likewise.
	* dlfcn/dlclose.c: Likewise.
	* dlfcn/dlerror.c: Likewise.
	* dlfcn/dlinfo.c: Likewise.
	* dlfcn/dlmopen.c: Likewise.
	* dlfcn/dlopen.c: Likewise.
	* dlfcn/dlsym.c: Likewise.
	* dlfcn/dlvsym.c: Likewise.
---
 dlfcn/dladdr.c  | 2 +-
 dlfcn/dladdr1.c | 2 +-
 dlfcn/dlclose.c | 2 +-
 dlfcn/dlerror.c | 2 +-
 dlfcn/dlinfo.c  | 2 +-
 dlfcn/dlmopen.c | 2 +-
 dlfcn/dlopen.c  | 2 +-
 dlfcn/dlsym.c   | 2 +-
 dlfcn/dlvsym.c  | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/dlfcn/dladdr.c b/dlfcn/dladdr.c
index 922ca44..2537a03 100644
--- a/dlfcn/dladdr.c
+++ b/dlfcn/dladdr.c
@@ -18,7 +18,7 @@
 
 #include <dlfcn.h>
 
-#if !defined SHARED && defined IS_IN_libdl
+#if !defined SHARED && IS_IN (libdl)
 
 int
 dladdr (const void *address, Dl_info *info)
diff --git a/dlfcn/dladdr1.c b/dlfcn/dladdr1.c
index 0efc0dc..fa40dd9 100644
--- a/dlfcn/dladdr1.c
+++ b/dlfcn/dladdr1.c
@@ -18,7 +18,7 @@
 
 #include <dlfcn.h>
 
-#if !defined SHARED && defined IS_IN_libdl
+#if !defined SHARED && IS_IN (libdl)
 
 int
 dladdr1 (const void *address, Dl_info *info, void **extra, int flags)
diff --git a/dlfcn/dlclose.c b/dlfcn/dlclose.c
index ca55b5f..3446a36 100644
--- a/dlfcn/dlclose.c
+++ b/dlfcn/dlclose.c
@@ -19,7 +19,7 @@
 #include <dlfcn.h>
 #include <ldsodefs.h>
 
-#if !defined SHARED && defined IS_IN_libdl
+#if !defined SHARED && IS_IN (libdl)
 
 int
 dlclose (void *handle)
diff --git a/dlfcn/dlerror.c b/dlfcn/dlerror.c
index 6dd47a7..48b9be2 100644
--- a/dlfcn/dlerror.c
+++ b/dlfcn/dlerror.c
@@ -25,7 +25,7 @@
 #include <bits/libc-lock.h>
 #include <ldsodefs.h>
 
-#if !defined SHARED && defined IS_IN_libdl
+#if !defined SHARED && IS_IN (libdl)
 
 char *
 dlerror (void)
diff --git a/dlfcn/dlinfo.c b/dlfcn/dlinfo.c
index 1876d9d..30becfb 100644
--- a/dlfcn/dlinfo.c
+++ b/dlfcn/dlinfo.c
@@ -21,7 +21,7 @@
 #include <ldsodefs.h>
 #include <libintl.h>
 
-#if !defined SHARED && defined IS_IN_libdl
+#if !defined SHARED && IS_IN (libdl)
 
 int
 dlinfo (void *handle, int request, void *arg)
diff --git a/dlfcn/dlmopen.c b/dlfcn/dlmopen.c
index 115f6e9..2905a0e 100644
--- a/dlfcn/dlmopen.c
+++ b/dlfcn/dlmopen.c
@@ -23,7 +23,7 @@
 #include <unistd.h>
 #include <ldsodefs.h>
 
-#if !defined SHARED && defined IS_IN_libdl
+#if !defined SHARED && IS_IN (libdl)
 
 void *
 dlmopen (Lmid_t nsid, const char *file, int mode)
diff --git a/dlfcn/dlopen.c b/dlfcn/dlopen.c
index fa58c4c..a724737 100644
--- a/dlfcn/dlopen.c
+++ b/dlfcn/dlopen.c
@@ -22,7 +22,7 @@
 #include <unistd.h>
 #include <ldsodefs.h>
 
-#if !defined SHARED && defined IS_IN_libdl
+#if !defined SHARED && IS_IN (libdl)
 
 void *
 dlopen (const char *file, int mode)
diff --git a/dlfcn/dlsym.c b/dlfcn/dlsym.c
index 7bcc78d..d852bea 100644
--- a/dlfcn/dlsym.c
+++ b/dlfcn/dlsym.c
@@ -21,7 +21,7 @@
 
 #include <ldsodefs.h>
 
-#if !defined SHARED && defined IS_IN_libdl
+#if !defined SHARED && IS_IN (libdl)
 
 void *
 dlsym (void *handle, const char *name)
diff --git a/dlfcn/dlvsym.c b/dlfcn/dlvsym.c
index d7a766b..2263429 100644
--- a/dlfcn/dlvsym.c
+++ b/dlfcn/dlvsym.c
@@ -21,7 +21,7 @@
 
 #include <ldsodefs.h>
 
-#if !defined SHARED && defined IS_IN_libdl
+#if !defined SHARED && IS_IN (libdl)
 
 void *
 weak_function
-- 
1.9.3

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

* [PATCH 17/19] Provide default definition for IS_IN when _LIBC is not defined
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (10 preceding siblings ...)
  2014-08-21 10:58 ` [PATCH 05/19] Remove IN_LIB Siddhesh Poyarekar
@ 2014-08-21 10:58 ` Siddhesh Poyarekar
  2014-08-22 19:38   ` Roland McGrath
  2014-08-28  6:55   ` [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined Siddhesh Poyarekar
  2014-08-21 10:58 ` [PATCH 08/19] Remove IS_IN_ldconfig Siddhesh Poyarekar
                   ` (8 subsequent siblings)
  20 siblings, 2 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

This is useful for installed headers and also for headers that are
used in tests without setting IN_MODULE.

        * bits/stdio-lock.h [!_LIBC]: Define IS_IN.
        * include/mqueue.h [!_LIBC]: Likewise.
        * include/stdlib.h [!_LIBC]: Likewise.
        * sysdeps/nptl/bits/stdio-lock.h [!_LIBC]: Likewise.
---
 bits/stdio-lock.h              | 6 +++++-
 include/mqueue.h               | 3 +++
 include/stdlib.h               | 4 ++++
 sysdeps/nptl/bits/stdio-lock.h | 6 +++++-
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/bits/stdio-lock.h b/bits/stdio-lock.h
index f68b13e..937cc89 100644
--- a/bits/stdio-lock.h
+++ b/bits/stdio-lock.h
@@ -19,6 +19,10 @@
 #ifndef _BITS_STDIO_LOCK_H
 #define _BITS_STDIO_LOCK_H 1
 
+#ifndef _LIBC
+# define IS_IN(lib) (0)
+#endif
+
 #include <bits/libc-lock.h>
 
 __libc_lock_define_recursive (typedef, _IO_lock_t)
@@ -44,7 +48,7 @@ __libc_lock_define_recursive (typedef, _IO_lock_t)
 #define _IO_cleanup_region_end(_doit) \
   __libc_cleanup_region_end (_doit)
 
-#if defined _LIBC && IS_IN (libc)
+#if IS_IN (libc)
 # define _IO_acquire_lock(_fp) \
   _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp));      \
   _IO_flockfile (_fp)
diff --git a/include/mqueue.h b/include/mqueue.h
index aba788e..182b7de 100644
--- a/include/mqueue.h
+++ b/include/mqueue.h
@@ -1,4 +1,7 @@
 #include <rt/mqueue.h>
+#ifndef _LIBC
+# define IS_IN(lib) (0)
+#endif
 
 #if IS_IN (librt)
 hidden_proto (mq_timedsend)
diff --git a/include/stdlib.h b/include/stdlib.h
index 734f251..fd80b6d 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -1,5 +1,9 @@
 #ifndef _STDLIB_H
 
+#ifndef _LIBC
+# define IS_IN(lib) (0)
+#endif
+
 #ifdef __need_malloc_and_calloc
 #define __Need_M_And_C
 #endif
diff --git a/sysdeps/nptl/bits/stdio-lock.h b/sysdeps/nptl/bits/stdio-lock.h
index da392ed..6675a6d 100644
--- a/sysdeps/nptl/bits/stdio-lock.h
+++ b/sysdeps/nptl/bits/stdio-lock.h
@@ -19,6 +19,10 @@
 #ifndef _BITS_STDIO_LOCK_H
 #define _BITS_STDIO_LOCK_H 1
 
+#ifndef _LIBC
+# define IS_IN(lib) (0)
+#endif
+
 #include <bits/libc-lock.h>
 #include <lowlevellock.h>
 
@@ -84,7 +88,7 @@ typedef struct { int lock; int cnt; void *owner; } _IO_lock_t;
 #define _IO_cleanup_region_end(_doit) \
   __libc_cleanup_region_end (_doit)
 
-#if defined _LIBC && IS_IN (libc)
+#if IS_IN (libc)
 
 # ifdef __EXCEPTIONS
 #  define _IO_acquire_lock(_fp) \
-- 
1.9.3

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

* [PATCH 08/19] Remove IS_IN_ldconfig
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (11 preceding siblings ...)
  2014-08-21 10:58 ` [PATCH 17/19] Provide default definition for IS_IN when _LIBC is not defined Siddhesh Poyarekar
@ 2014-08-21 10:58 ` Siddhesh Poyarekar
  2014-08-22 18:29   ` Roland McGrath
  2014-08-21 10:58 ` [PATCH 01/19] Add new macro IN_MODULE to identify module in which source is built Siddhesh Poyarekar
                   ` (7 subsequent siblings)
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Replace with IS_IN().  No change in generated code.

	* elf/Makefile (CFLAGS-ldconfig.c): Remove definition of
	IS_IN_ldconfig.
	* sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c: Use IS_IN.
	* sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h: Likewise.
---
 elf/Makefile                                 | 2 +-
 sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c | 2 +-
 sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/elf/Makefile b/elf/Makefile
index d93898f..2781cc3 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -432,7 +432,7 @@ $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
 
 SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
 CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
-		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1 -DNOT_IN_libc=1
+		    -D'SLIBDIR="$(slibdir)"' -DNOT_IN_libc
 libof-ldconfig = ldconfig
 CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
 CFLAGS-cache.c = $(SYSCONF-FLAGS)
diff --git a/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c b/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c
index 6662a94..8ac351e 100644
--- a/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c
+++ b/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c
@@ -1,4 +1,4 @@
-#ifdef IS_IN_ldconfig
+#if IS_IN (ldconfig)
 # include <sysdeps/i386/dl-procinfo.c>
 #else
 # include <sysdeps/generic/dl-procinfo.c>
diff --git a/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h b/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h
index 3145520..7829e1c 100644
--- a/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h
@@ -1,4 +1,4 @@
-#ifdef IS_IN_ldconfig
+#if IS_IN (ldconfig)
 # include <sysdeps/unix/sysv/linux/i386/dl-procinfo.h>
 #else
 # include <sysdeps/generic/dl-procinfo.h>
-- 
1.9.3

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

* [PATCH 11/19] Remove IS_IN_librt
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (4 preceding siblings ...)
  2014-08-21 10:58 ` [PATCH 12/19] Remove IS_IN_libpthread Siddhesh Poyarekar
@ 2014-08-21 10:58 ` Siddhesh Poyarekar
  2014-08-22 18:31   ` Roland McGrath
  2014-08-21 10:58 ` [PATCH 09/19] Remove IS_IN_nscd Siddhesh Poyarekar
                   ` (14 subsequent siblings)
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Replace with IS_IN (librt).  Generated code unchanged on x86_64

        * include/mqueue.h: Use IS_IN instead of IS_IN_librt.
        * nptl/pthreadP.h: Likewise.
        * sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise.
        * sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/not-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/tile/sysdep-cancel.h: Likewise.
        * sysdeps/unix/sysv/linux/tile/waitpid.S: Likewise.
        * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
---
 include/mqueue.h                                          | 2 +-
 nptl/pthreadP.h                                           | 2 +-
 sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h           | 4 ++--
 sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h             | 4 ++--
 sysdeps/unix/sysv/linux/arm/sysdep-cancel.h               | 4 ++--
 sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h         | 8 ++++----
 sysdeps/unix/sysv/linux/i386/sysdep-cancel.h              | 4 ++--
 sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h              | 4 ++--
 sysdeps/unix/sysv/linux/ia64/sysdep.h                     | 2 +-
 sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h              | 4 ++--
 sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h        | 6 +++---
 sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h       | 4 ++--
 sysdeps/unix/sysv/linux/mips/sysdep-cancel.h              | 4 ++--
 sysdeps/unix/sysv/linux/not-cancel.h                      | 2 +-
 sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h | 4 ++--
 sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h | 4 ++--
 sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h      | 4 ++--
 sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h      | 4 ++--
 sysdeps/unix/sysv/linux/sh/sysdep-cancel.h                | 4 ++--
 sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h     | 4 ++--
 sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h     | 4 ++--
 sysdeps/unix/sysv/linux/tile/sysdep-cancel.h              | 4 ++--
 sysdeps/unix/sysv/linux/tile/waitpid.S                    | 2 +-
 sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h            | 4 ++--
 24 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/include/mqueue.h b/include/mqueue.h
index 1ac4f13..aba788e 100644
--- a/include/mqueue.h
+++ b/include/mqueue.h
@@ -1,6 +1,6 @@
 #include <rt/mqueue.h>
 
-#ifdef IS_IN_librt
+#if IS_IN (librt)
 hidden_proto (mq_timedsend)
 hidden_proto (mq_timedreceive)
 hidden_proto (mq_setattr)
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index d4415ba..2f13ea5 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -302,7 +302,7 @@ __do_cancel (void)
 # define LIBC_CANCEL_HANDLED() \
   __asm (".globl " __SYMBOL_PREFIX "__pthread_enable_asynccancel"); \
   __asm (".globl " __SYMBOL_PREFIX "__pthread_disable_asynccancel")
-#elif defined IS_IN_librt
+#elif IS_IN (librt)
 # define LIBC_CANCEL_ASYNC() \
   __librt_enable_asynccancel ()
 # define LIBC_CANCEL_RESET(val) \
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h
index 546ed7b..9e347de 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				\
@@ -89,7 +89,7 @@ ENTRY (name);								\
 #  define CENABLE	bl __libc_enable_asynccancel
 #  define CDISABLE	bl __libc_disable_asynccancel
 #  define __local_multiple_threads __libc_multiple_threads
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define CENABLE	bl __librt_enable_asynccancel
 #  define CDISABLE	bl __librt_disable_asynccancel
 # else
diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h b/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h
index 69809bc..45bf93b 100644
--- a/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h
@@ -21,7 +21,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 /* ??? Assumes that nothing comes between PSEUDO and PSEUDO_END
    besides "ret".  */
@@ -121,7 +121,7 @@ __LABEL($multi_error)						\
 #  define __local_enable_asynccancel	__libc_enable_asynccancel
 #  define __local_disable_asynccancel	__libc_disable_asynccancel
 #  define __local_multiple_threads	__libc_multiple_threads
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define __local_enable_asynccancel	__librt_enable_asynccancel
 #  define __local_disable_asynccancel	__librt_disable_asynccancel
 # else
diff --git a/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h b/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
index a0a8696..e5a8e36 100644
--- a/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
@@ -21,7 +21,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 /* NOTE: We do mark syscalls with unwind annotations, for the benefit of
    cancellation; but they're really only accurate at the point of the
@@ -189,7 +189,7 @@
 #  define CENABLE	bl PLTJMP(__libc_enable_asynccancel)
 #  define CDISABLE	bl PLTJMP(__libc_disable_asynccancel)
 #  define __local_multiple_threads __libc_multiple_threads
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define CENABLE	bl PLTJMP(__librt_enable_asynccancel)
 #  define CDISABLE	bl PLTJMP(__librt_disable_asynccancel)
 # else
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h
index 6f1c9d7..365237e 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 # ifndef NO_ERROR
 #  define NO_ERROR -0x1000
@@ -228,7 +228,7 @@ L(pre_end):						ASM_LINE_SEP	\
 #   define CDISABLE	.import __libc_disable_asynccancel,code ASM_LINE_SEP \
 			bl __libc_disable_asynccancel,%r2 ASM_LINE_SEP
 #  endif
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  ifdef PIC
 #   define CENABLE .import __librt_enable_asynccancel,code ASM_LINE_SEP \
 			bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP
@@ -248,7 +248,7 @@ L(pre_end):						ASM_LINE_SEP	\
 #  define __local_multiple_threads __pthread_multiple_threads
 # elif !defined NOT_IN_libc
 #  define __local_multiple_threads __libc_multiple_threads
-# elif IS_IN_librt
+# elif IS_IN (librt)
 #  define __local_multiple_threads __librt_multiple_threads
 # else
 #  error Unsupported library
@@ -271,7 +271,7 @@ L(pre_end):						ASM_LINE_SEP	\
 # define NO_CANCELLATION 1
 
 #endif
-/* !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt */
+/* !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) */
 
 #ifndef __ASSEMBLER__
 # define RTLD_SINGLE_THREAD_P \
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h b/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
index 4f4318d..75fe2e6 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				      \
@@ -114,7 +114,7 @@
 # elif !defined NOT_IN_libc
 #  define CENABLE	call __libc_enable_asynccancel;
 #  define CDISABLE	call __libc_disable_asynccancel
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define CENABLE	call __librt_enable_asynccancel;
 #  define CDISABLE	call __librt_disable_asynccancel
 # else
diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
index c44c484..366728f 100644
--- a/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 # undef PSEUDO
 
@@ -185,7 +185,7 @@ __GC_##name:								      \
 # elif !defined NOT_IN_libc
 #  define CENABLE	br.call.sptk.many b0 = __libc_enable_asynccancel
 #  define CDISABLE	br.call.sptk.many b0 = __libc_disable_asynccancel
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define CENABLE	br.call.sptk.many b0 = __librt_enable_asynccancel
 #  define CDISABLE	br.call.sptk.many b0 = __librt_disable_asynccancel
 # else
diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.h b/sysdeps/unix/sysv/linux/ia64/sysdep.h
index e0ec861..49d289c 100644
--- a/sysdeps/unix/sysv/linux/ia64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/ia64/sysdep.h
@@ -62,7 +62,7 @@
 
 #if defined USE_DL_SYSINFO \
 	&& (!defined NOT_IN_libc \
-	    || defined IS_IN_libpthread || defined IS_IN_librt)
+	    || defined IS_IN_libpthread || IS_IN (librt))
 # define IA64_USE_NEW_STUB
 #else
 # undef IA64_USE_NEW_STUB
diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h b/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h
index 868ce56..0e19a38 100644
--- a/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				      \
@@ -106,7 +106,7 @@
 # elif !defined NOT_IN_libc
 #  define CENABLE	PSEUDO_JMP (__libc_enable_asynccancel)
 #  define CDISABLE	PSEUDO_JMP (__libc_disable_asynccancel)
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define CENABLE	PSEUDO_JMP (__librt_enable_asynccancel)
 #  define CDISABLE	PSEUDO_JMP (__librt_disable_asynccancel)
 # else
diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h b/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
index 0080d8d..4d371ef 100644
--- a/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
@@ -21,9 +21,9 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
-# if !defined(IS_IN_librt) || !defined(PIC)
+# if !IS_IN (librt) || !defined(PIC)
 #  define AC_STACK_SIZE  16  /* space for r15, async_cancel arg and 2 temp words */
 #  define AC_SET_GOT /* empty */
 #  define AC_RESTORE_GOT /* empty */
@@ -110,7 +110,7 @@ L(pseudo_cancel):                                                    \
 #  define CENABLE PSEUDO_JMP (__libc_enable_asynccancel)
 #  define CDISABLE  PSEUDO_JMP (__libc_disable_asynccancel)
 #  define __local_multiple_threads __libc_multiple_threads
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define CENABLE PSEUDO_JMP (__librt_enable_asynccancel)
 #  define CDISABLE  PSEUDO_JMP (__librt_disable_asynccancel)
 # else
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
index 341b9a0..acbc5da 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
@@ -27,7 +27,7 @@
    happen before any instructions.  So we use cfi_same_value instead of
    cfi_restore.  */
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 #ifdef __PIC__
 # undef PSEUDO
@@ -216,7 +216,7 @@
 # ifdef IS_IN_libpthread
 #  define CENABLE	PSEUDO_JMP (__pthread_enable_asynccancel)
 #  define CDISABLE	PSEUDO_JMP (__pthread_disable_asynccancel)
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define CENABLE	PSEUDO_JMP (__librt_enable_asynccancel)
 #  define CDISABLE	PSEUDO_JMP (__librt_disable_asynccancel)
 # else
diff --git a/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h b/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
index 3666081..5fdd567 100644
--- a/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 # ifdef __PIC__
 #  define PSEUDO_CPLOAD .cpload t9;
@@ -157,7 +157,7 @@
 # ifdef IS_IN_libpthread
 #  define CENABLE	PSEUDO_JMP (__pthread_enable_asynccancel)
 #  define CDISABLE	PSEUDO_JMP (__pthread_disable_asynccancel)
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define CENABLE	PSEUDO_JMP (__librt_enable_asynccancel)
 #  define CDISABLE	PSEUDO_JMP (__librt_disable_asynccancel)
 # else
diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h
index 14f5e8b..d089531 100644
--- a/sysdeps/unix/sysv/linux/not-cancel.h
+++ b/sysdeps/unix/sysv/linux/not-cancel.h
@@ -19,7 +19,7 @@
 
 #include <sysdep.h>
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 extern int __open_nocancel (const char *, int, ...) attribute_hidden;
 extern int __close_nocancel (int) attribute_hidden;
 extern int __read_nocancel (int, void *, size_t) attribute_hidden;
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
index b6eedcb..962beaf 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
@@ -23,7 +23,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				\
@@ -87,7 +87,7 @@
 # elif !defined NOT_IN_libc
 #  define CENABLE	bl __libc_enable_asynccancel@local
 #  define CDISABLE	bl __libc_disable_asynccancel@local
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define CENABLE	bl __librt_enable_asynccancel@local
 #  define CDISABLE	bl __librt_disable_asynccancel@local
 # else
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
index 5807d9d..0447062 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
@@ -23,7 +23,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
 #  define DASHDASHPFX(str) .__##str
@@ -115,7 +115,7 @@
 #   define CENABLE	bl JUMPTARGET(__libc_enable_asynccancel); nop
 #   define CDISABLE	bl JUMPTARGET(__libc_disable_asynccancel); nop
 #  endif
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  ifdef SHARED
 #   define CENABLE	bl JUMPTARGET(__librt_enable_asynccancel)
 #   define CDISABLE	bl JUMPTARGET(__librt_disable_asynccancel)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
index 0eeefca..bc5d852 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				      \
@@ -81,7 +81,7 @@ L(pseudo_end):
 # elif !defined NOT_IN_libc
 #  define CENABLE	__libc_enable_asynccancel
 #  define CDISABLE	__libc_disable_asynccancel
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define CENABLE	__librt_enable_asynccancel
 #  define CDISABLE	__librt_disable_asynccancel
 # else
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
index b3560c8..885bf7e 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				      \
@@ -77,7 +77,7 @@ L(pseudo_end):
 #  define CENABLE	__libc_enable_asynccancel
 #  define CDISABLE	__libc_disable_asynccancel
 #  define __local_multiple_threads	__libc_multiple_threads
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define CENABLE	__librt_enable_asynccancel
 #  define CDISABLE	__librt_disable_asynccancel
 # else
diff --git a/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h b/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
index 4278f25..4ef51c0 100644
--- a/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
@@ -21,7 +21,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 # define _IMM12 #-12
 # define _IMM16 #-16
@@ -111,7 +111,7 @@
 # elif !defined NOT_IN_libc
 #  define __local_enable_asynccancel	__libc_enable_asynccancel
 #  define __local_disable_asynccancel	__libc_disable_asynccancel
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define __local_enable_asynccancel	__librt_enable_asynccancel
 #  define __local_disable_asynccancel	__librt_disable_asynccancel
 # else
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
index fd9968f..2e24d2a 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)	\
@@ -74,7 +74,7 @@ __##syscall_name##_nocancel:			\
 # elif !defined NOT_IN_libc
 #  define CENABLE	call __libc_enable_asynccancel
 #  define CDISABLE	call __libc_disable_asynccancel
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define CENABLE	call __librt_enable_asynccancel
 #  define CDISABLE	call __librt_disable_asynccancel
 # else
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
index 4dad994..0ae3b61 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)	\
@@ -72,7 +72,7 @@ __##syscall_name##_nocancel:			\
 # elif !defined NOT_IN_libc
 #  define CENABLE	call __libc_enable_asynccancel
 #  define CDISABLE	call __libc_disable_asynccancel
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define CENABLE	call __librt_enable_asynccancel
 #  define CDISABLE	call __librt_disable_asynccancel
 # else
diff --git a/sysdeps/unix/sysv/linux/tile/sysdep-cancel.h b/sysdeps/unix/sysv/linux/tile/sysdep-cancel.h
index 2333338..8140273 100644
--- a/sysdeps/unix/sysv/linux/tile/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/tile/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 /* Allow hacking in some extra code if desired. */
 #ifndef PSEUDO_EXTRA
@@ -120,7 +120,7 @@
 # ifdef IS_IN_libpthread
 #  define CENABLE	jal __pthread_enable_asynccancel
 #  define CDISABLE	jal __pthread_disable_asynccancel
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define CENABLE	jal __librt_enable_asynccancel
 #  define CDISABLE	jal __librt_disable_asynccancel
 # else
diff --git a/sysdeps/unix/sysv/linux/tile/waitpid.S b/sysdeps/unix/sysv/linux/tile/waitpid.S
index 9aa793e..ac8e59e 100644
--- a/sysdeps/unix/sysv/linux/tile/waitpid.S
+++ b/sysdeps/unix/sysv/linux/tile/waitpid.S
@@ -1,7 +1,7 @@
 /*
 extern pid_t __waitpid_nocancel (pid_t, int *, int) attribute_hidden;
 */
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 /* Call __NR_wait4, providing fourth argument (struct rusage *) as NULL. */
 #define PSEUDO_EXTRA move r3, zero;
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h
index 83cd25f..efdb1c6 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
 
 /* The code to disable cancellation depends on the fact that the called
    functions are special.  They don't modify registers other than %rax
@@ -67,7 +67,7 @@
 #  define CENABLE	call __libc_enable_asynccancel;
 #  define CDISABLE	call __libc_disable_asynccancel;
 #  define __local_multiple_threads __libc_multiple_threads
-# elif defined IS_IN_librt
+# elif IS_IN (librt)
 #  define CENABLE	call __librt_enable_asynccancel;
 #  define CDISABLE	call __librt_disable_asynccancel;
 # else
-- 
1.9.3

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

* [PATCH 12/19] Remove IS_IN_libpthread
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (3 preceding siblings ...)
  2014-08-21 10:58 ` [PATCH 10/19] Remove IS_IN_libdl Siddhesh Poyarekar
@ 2014-08-21 10:58 ` Siddhesh Poyarekar
  2014-08-22 18:31   ` Roland McGrath
  2014-08-21 10:58 ` [PATCH 11/19] Remove IS_IN_librt Siddhesh Poyarekar
                   ` (15 subsequent siblings)
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Replace with IS_IN (libpthread).  Generated code unchanged on
x86_64.

	* nptl/lowlevellock.c: Use IS_IN instead of IS_IN_libpthread.
	* nptl/pthreadP.h: Likewise.
	* nptl_db/structs.def: Likewise.
	* sysdeps/arm/sysdep.h: Likewise.
	* sysdeps/nptl/bits/libc-lock.h: Likewise.
	* sysdeps/nptl/bits/libc-lockP.h: Likewise.
	* sysdeps/sparc/sparc32/lowlevellock.c: Likewise.
	* sysdeps/unix/alpha/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/arm/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/not-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/tile/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/tile/waitpid.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/cancellation.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
---
 nptl/lowlevellock.c                                       |  2 +-
 nptl/pthreadP.h                                           | 12 ++++++------
 nptl_db/structs.def                                       |  2 +-
 sysdeps/arm/sysdep.h                                      |  2 +-
 sysdeps/nptl/bits/libc-lock.h                             | 14 +++++++-------
 sysdeps/nptl/bits/libc-lockP.h                            | 14 +++++++-------
 sysdeps/sparc/sparc32/lowlevellock.c                      |  2 +-
 sysdeps/unix/alpha/sysdep.h                               |  2 +-
 sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h           |  6 +++---
 sysdeps/unix/sysv/linux/aarch64/sysdep.h                  |  2 +-
 sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h             |  6 +++---
 sysdeps/unix/sysv/linux/arm/sysdep-cancel.h               |  6 +++---
 sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h         |  8 ++++----
 sysdeps/unix/sysv/linux/i386/sysdep-cancel.h              |  4 ++--
 sysdeps/unix/sysv/linux/i386/sysdep.h                     |  2 +-
 sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h              |  4 ++--
 sysdeps/unix/sysv/linux/ia64/sysdep.h                     |  2 +-
 sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h              |  4 ++--
 sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h        |  6 +++---
 sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h       |  4 ++--
 sysdeps/unix/sysv/linux/mips/sysdep-cancel.h              |  4 ++--
 sysdeps/unix/sysv/linux/not-cancel.h                      |  2 +-
 sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h |  4 ++--
 sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h |  4 ++--
 sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h      |  4 ++--
 sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h      |  6 +++---
 sysdeps/unix/sysv/linux/sh/sysdep-cancel.h                |  4 ++--
 sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h     |  4 ++--
 sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h     |  4 ++--
 sysdeps/unix/sysv/linux/tile/sysdep-cancel.h              |  4 ++--
 sysdeps/unix/sysv/linux/tile/sysdep.h                     |  2 +-
 sysdeps/unix/sysv/linux/tile/waitpid.S                    |  2 +-
 sysdeps/unix/sysv/linux/x86_64/cancellation.S             |  2 +-
 sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h            |  6 +++---
 34 files changed, 78 insertions(+), 78 deletions(-)

diff --git a/nptl/lowlevellock.c b/nptl/lowlevellock.c
index e198af7..4c093fc 100644
--- a/nptl/lowlevellock.c
+++ b/nptl/lowlevellock.c
@@ -35,7 +35,7 @@ __lll_lock_wait_private (int *futex)
 
 
 /* These functions don't get included in libc.so  */
-#ifdef IS_IN_libpthread
+#if IS_IN (libpthread)
 void
 __lll_lock_wait (int *futex, int private)
 {
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 2f13ea5..d75aeac 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -238,7 +238,7 @@ extern int __pthread_debug attribute_hidden;
 
 extern void __pthread_unwind (__pthread_unwind_buf_t *__buf)
      __cleanup_fct_attribute __attribute ((__noreturn__))
-#if !defined SHARED && !defined IS_IN_libpthread
+#if !defined SHARED && !IS_IN (libpthread)
      weak_function
 #endif
      ;
@@ -252,7 +252,7 @@ extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
      __cleanup_fct_attribute;
 extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
      __cleanup_fct_attribute;
-#ifdef IS_IN_libpthread
+#if IS_IN (libpthread)
 hidden_proto (__pthread_unwind)
 hidden_proto (__pthread_unwind_next)
 hidden_proto (__pthread_register_cancel)
@@ -296,7 +296,7 @@ __do_cancel (void)
 # define LIBC_CANCEL_HANDLED() \
   __asm (".globl " __SYMBOL_PREFIX "__libc_enable_asynccancel"); \
   __asm (".globl " __SYMBOL_PREFIX "__libc_disable_asynccancel")
-#elif defined IS_IN_libpthread
+#elif IS_IN (libpthread)
 # define LIBC_CANCEL_ASYNC() CANCEL_ASYNC ()
 # define LIBC_CANCEL_RESET(val) CANCEL_RESET (val)
 # define LIBC_CANCEL_HANDLED() \
@@ -341,7 +341,7 @@ extern int __make_stacks_executable (void **stack_endp)
 
 /* longjmp handling.  */
 extern void __pthread_cleanup_upto (__jmp_buf target, char *targetframe);
-#ifdef IS_IN_libpthread
+#if IS_IN (libpthread)
 hidden_proto (__pthread_cleanup_upto)
 #endif
 
@@ -486,7 +486,7 @@ extern int __pthread_enable_asynccancel (void) attribute_hidden;
 extern void __pthread_disable_asynccancel (int oldtype)
      internal_function attribute_hidden;
 
-#ifdef IS_IN_libpthread
+#if IS_IN (libpthread)
 hidden_proto (__pthread_mutex_init)
 hidden_proto (__pthread_mutex_destroy)
 hidden_proto (__pthread_mutex_lock)
@@ -525,7 +525,7 @@ extern int __librt_enable_asynccancel (void) attribute_hidden;
 extern void __librt_disable_asynccancel (int oldtype)
      internal_function attribute_hidden;
 
-#ifdef IS_IN_libpthread
+#if IS_IN (libpthread)
 /* Special versions which use non-exported functions.  */
 extern void __pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer,
 				    void (*routine) (void *), void *arg)
diff --git a/nptl_db/structs.def b/nptl_db/structs.def
index ec72ef1..5b905e2 100644
--- a/nptl_db/structs.def
+++ b/nptl_db/structs.def
@@ -74,7 +74,7 @@ DB_STRUCT_FIELD (link_map, l_tls_modid)
 DB_STRUCT_ARRAY_FIELD (dtv, dtv)
 #define pointer_val pointer.val /* Field of anonymous struct in dtv_t.  */
 DB_STRUCT_FIELD (dtv_t, pointer_val)
-#if !defined IS_IN_libpthread || TLS_TCB_AT_TP
+#if !IS_IN (libpthread) || TLS_TCB_AT_TP
 DB_STRUCT_FIELD (pthread, dtvp)
 #endif
 
diff --git a/sysdeps/arm/sysdep.h b/sysdeps/arm/sysdep.h
index 4c41213..f476d69 100644
--- a/sysdeps/arm/sysdep.h
+++ b/sysdeps/arm/sysdep.h
@@ -293,7 +293,7 @@
 
 /* Pointer mangling support.  */
 #if (defined IS_IN_rtld || \
-     (!defined SHARED && (!defined NOT_IN_libc || defined IS_IN_libpthread)))
+     (!defined SHARED && (!defined NOT_IN_libc || IS_IN (libpthread))))
 # ifdef __ASSEMBLER__
 #  define PTR_MANGLE_LOAD(guard, tmp)					\
   LDST_PCREL(ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard_local));
diff --git a/sysdeps/nptl/bits/libc-lock.h b/sysdeps/nptl/bits/libc-lock.h
index 532cf2c..b782b98 100644
--- a/sysdeps/nptl/bits/libc-lock.h
+++ b/sysdeps/nptl/bits/libc-lock.h
@@ -26,7 +26,7 @@
 
 /* Mutex type.  */
 #if defined _LIBC || defined _IO_MTSAFE_IO
-# if (defined NOT_IN_libc && !defined IS_IN_libpthread) || !defined _LIBC
+# if (defined NOT_IN_libc && !IS_IN (libpthread)) || !defined _LIBC
 typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
 # else
 typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t;
@@ -47,7 +47,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
 
 /* Define an initialized recursive lock variable NAME with storage
    class CLASS.  */
-#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread))
 # define __libc_lock_define_initialized_recursive(CLASS, NAME) \
   CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
 # define _LIBC_LOCK_RECURSIVE_INITIALIZER \
@@ -60,7 +60,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
 #endif
 
 /* Initialize a recursive mutex.  */
-#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread))
 # define __libc_lock_init_recursive(NAME) \
   ((NAME) = (__libc_lock_recursive_t) _LIBC_LOCK_RECURSIVE_INITIALIZER, 0)
 #else
@@ -78,7 +78,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
 #endif
 
 /* Finalize recursive named lock.  */
-#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread))
 # define __libc_lock_fini_recursive(NAME) ((void) 0)
 #else
 # define __libc_lock_fini_recursive(NAME) \
@@ -86,7 +86,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
 #endif
 
 /* Lock the recursive named lock variable.  */
-#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread))
 # define __libc_lock_lock_recursive(NAME) \
   do {									      \
     void *self = THREAD_SELF;						      \
@@ -103,7 +103,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
 #endif
 
 /* Try to lock the recursive named lock variable.  */
-#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread))
 # define __libc_lock_trylock_recursive(NAME) \
   ({									      \
     int result = 0;							      \
@@ -128,7 +128,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
 #endif
 
 /* Unlock the recursive named lock variable.  */
-#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+#if defined _LIBC && (!defined NOT_IN_libc || IS_IN (libpthread))
 /* We do no error checking here.  */
 # define __libc_lock_unlock_recursive(NAME) \
   do {									      \
diff --git a/sysdeps/nptl/bits/libc-lockP.h b/sysdeps/nptl/bits/libc-lockP.h
index ec20271..c84e778 100644
--- a/sysdeps/nptl/bits/libc-lockP.h
+++ b/sysdeps/nptl/bits/libc-lockP.h
@@ -35,7 +35,7 @@
 #include <pthread-functions.h>
 
 /* Mutex type.  */
-#if defined NOT_IN_libc && !defined IS_IN_libpthread
+#if defined NOT_IN_libc && !IS_IN (libpthread)
 typedef pthread_mutex_t __libc_lock_t;
 #else
 typedef int __libc_lock_t;
@@ -69,7 +69,7 @@ typedef pthread_key_t __libc_key_t;
    initialized locks must be set to one due to the lack of normal
    atomic operations.) */
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread
+#if !defined NOT_IN_libc || IS_IN (libpthread)
 # if LLL_LOCK_INITIALIZER == 0
 #  define __libc_lock_define_initialized(CLASS,NAME) \
   CLASS __libc_lock_t NAME;
@@ -125,7 +125,7 @@ typedef pthread_key_t __libc_key_t;
 
 /* Initialize the named lock variable, leaving it in a consistent, unlocked
    state.  */
-#if !defined NOT_IN_libc || defined IS_IN_libpthread
+#if !defined NOT_IN_libc || IS_IN (libpthread)
 # define __libc_lock_init(NAME) ((NAME) = LLL_LOCK_INITIALIZER, 0)
 #else
 # define __libc_lock_init(NAME) \
@@ -144,7 +144,7 @@ typedef pthread_key_t __libc_key_t;
 /* Finalize the named lock variable, which must be locked.  It cannot be
    used again until __libc_lock_init is called again on it.  This must be
    called on a lock variable before the containing storage is reused.  */
-#if !defined NOT_IN_libc || defined IS_IN_libpthread
+#if !defined NOT_IN_libc || IS_IN (libpthread)
 # define __libc_lock_fini(NAME) ((void) 0)
 #else
 # define __libc_lock_fini(NAME) \
@@ -158,7 +158,7 @@ typedef pthread_key_t __libc_key_t;
 #endif
 
 /* Lock the named lock variable.  */
-#if !defined NOT_IN_libc || defined IS_IN_libpthread
+#if !defined NOT_IN_libc || IS_IN (libpthread)
 # ifndef __libc_lock_lock
 #  define __libc_lock_lock(NAME) \
   ({ lll_lock (NAME, LLL_PRIVATE); 0; })
@@ -174,7 +174,7 @@ typedef pthread_key_t __libc_key_t;
   __libc_ptf_call (__pthread_rwlock_wrlock, (&(NAME)), 0)
 
 /* Try to lock the named lock variable.  */
-#if !defined NOT_IN_libc || defined IS_IN_libpthread
+#if !defined NOT_IN_libc || IS_IN (libpthread)
 # ifndef __libc_lock_trylock
 #  define __libc_lock_trylock(NAME) \
   lll_trylock (NAME)
@@ -193,7 +193,7 @@ typedef pthread_key_t __libc_key_t;
   __libc_maybe_call (__pthread_mutex_trylock, (&(NAME).mutex), 0)
 
 /* Unlock the named lock variable.  */
-#if !defined NOT_IN_libc || defined IS_IN_libpthread
+#if !defined NOT_IN_libc || IS_IN (libpthread)
 # define __libc_lock_unlock(NAME) \
   lll_unlock (NAME, LLL_PRIVATE)
 #else
diff --git a/sysdeps/sparc/sparc32/lowlevellock.c b/sysdeps/sparc/sparc32/lowlevellock.c
index 8384281..78cfad9 100644
--- a/sysdeps/sparc/sparc32/lowlevellock.c
+++ b/sysdeps/sparc/sparc32/lowlevellock.c
@@ -37,7 +37,7 @@ __lll_lock_wait_private (int *futex)
 
 
 /* These functions don't get included in libc.so  */
-#ifdef IS_IN_libpthread
+#if IS_IN (libpthread)
 void
 __lll_lock_wait (int *futex, int private)
 {
diff --git a/sysdeps/unix/alpha/sysdep.h b/sysdeps/unix/alpha/sysdep.h
index 17dad91..68b06e1 100644
--- a/sysdeps/unix/alpha/sysdep.h
+++ b/sysdeps/unix/alpha/sysdep.h
@@ -373,7 +373,7 @@ __LABEL(name)						\
 # include <stdint.h>
 # if (defined IS_IN_rtld \
       || (!defined SHARED && (!defined NOT_IN_libc \
-			      || defined IS_IN_libpthread)))
+			      || IS_IN (libpthread))))
 extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
 #  define PTR_MANGLE(var) \
 	(var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h
index 9e347de..f2f8009 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				\
@@ -81,7 +81,7 @@ ENTRY (name);								\
 # define UNDOCARGS_5	UNDOCARGS_3; ldp x3, x4, [sp, 32]
 # define UNDOCARGS_6	UNDOCARGS_4; ldp x4, x5, [sp, 40]
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define CENABLE	bl __pthread_enable_asynccancel
 #  define CDISABLE	bl __pthread_disable_asynccancel
 #  define __local_multiple_threads __pthread_multiple_threads
@@ -96,7 +96,7 @@ ENTRY (name);								\
 #  error Unsupported library
 # endif
 
-# if defined IS_IN_libpthread || !defined NOT_IN_libc
+# if IS_IN (libpthread) || !defined NOT_IN_libc
 #  ifndef __ASSEMBLER__
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
index 84999f1..84bec80 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
@@ -311,7 +311,7 @@
 /* Pointer mangling is supported for AArch64.  */
 #if (defined IS_IN_rtld || \
      (!defined SHARED && (!defined NOT_IN_libc \
-			  || defined IS_IN_libpthread)))
+			  || IS_IN (libpthread))))
 # ifdef __ASSEMBLER__
 #  define PTR_MANGLE(dst, src, guard, tmp)                                \
   LDST_PCREL (ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard_local)); \
diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h b/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h
index 45bf93b..5479556 100644
--- a/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h
@@ -21,7 +21,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 /* ??? Assumes that nothing comes between PSEUDO and PSEUDO_END
    besides "ret".  */
@@ -113,7 +113,7 @@ __LABEL($multi_error)						\
 # define LOAD_ARGS_5	LOAD_ARGS_4; ldq a4, 40(sp)
 # define LOAD_ARGS_6	LOAD_ARGS_5; ldq a5, 48(sp)
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define __local_enable_asynccancel	__pthread_enable_asynccancel
 #  define __local_disable_asynccancel	__pthread_disable_asynccancel
 #  define __local_multiple_threads	__pthread_multiple_threads
@@ -136,7 +136,7 @@ __LABEL($multi_error)						\
 #  define CDISABLE	jsr ra, __local_disable_asynccancel; ldgp ra, 0(gp)
 # endif
 
-# if defined IS_IN_libpthread || !defined NOT_IN_libc
+# if IS_IN (libpthread) || !defined NOT_IN_libc
 #  ifndef __ASSEMBLER__
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P \
diff --git a/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h b/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
index e5a8e36..9211d04 100644
--- a/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
@@ -21,7 +21,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 /* NOTE: We do mark syscalls with unwind annotations, for the benefit of
    cancellation; but they're really only accurate at the point of the
@@ -181,7 +181,7 @@
 # define RESTORE_LR_6				\
 	RESTORE_LR_0
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define CENABLE	bl PLTJMP(__pthread_enable_asynccancel)
 #  define CDISABLE	bl PLTJMP(__pthread_disable_asynccancel)
 #  define __local_multiple_threads __pthread_multiple_threads
@@ -196,7 +196,7 @@
 #  error Unsupported library
 # endif
 
-# if defined IS_IN_libpthread || !defined NOT_IN_libc
+# if IS_IN (libpthread) || !defined NOT_IN_libc
 #  ifndef __ASSEMBLER__
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h
index 365237e..5d4ff34 100644
--- a/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 # ifndef NO_ERROR
 #  define NO_ERROR -0x1000
@@ -204,7 +204,7 @@ L(pre_end):						ASM_LINE_SEP	\
 # define POPARGS_6	POPARGS_5 ldw -56(%sr0,%sp), %r21	ASM_LINE_SEP	\
 			.cfi_restore 21				ASM_LINE_SEP
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  ifdef PIC
 #   define CENABLE .import __pthread_enable_asynccancel,code ASM_LINE_SEP \
 			bl __pthread_enable_asynccancel,%r2 ASM_LINE_SEP
@@ -244,7 +244,7 @@ L(pre_end):						ASM_LINE_SEP	\
 #  error Unsupported library
 # endif
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define __local_multiple_threads __pthread_multiple_threads
 # elif !defined NOT_IN_libc
 #  define __local_multiple_threads __libc_multiple_threads
@@ -271,7 +271,7 @@ L(pre_end):						ASM_LINE_SEP	\
 # define NO_CANCELLATION 1
 
 #endif
-/* !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt) */
+/* !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt) */
 
 #ifndef __ASSEMBLER__
 # define RTLD_SINGLE_THREAD_P \
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h b/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
index 75fe2e6..c17ff6c 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				      \
@@ -108,7 +108,7 @@
 # define _POPCARGS_6	_POPCARGS_5; popl %ebp; \
 			cfi_adjust_cfa_offset (-4); cfi_restore (ebp);
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define CENABLE	call __pthread_enable_asynccancel;
 #  define CDISABLE	call __pthread_disable_asynccancel
 # elif !defined NOT_IN_libc
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
index 57d5ea0..0282761 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -34,7 +34,7 @@
 #define SYS_ify(syscall_name)	__NR_##syscall_name
 
 #if defined USE_DL_SYSINFO \
-    && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+    && (!defined NOT_IN_libc || IS_IN (libpthread))
 # define I386_USE_SYSENTER	1
 #else
 # undef I386_USE_SYSENTER
diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
index 366728f..0458fce 100644
--- a/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 
@@ -179,7 +179,7 @@ __GC_##name:								      \
 # undef PSEUDO_END
 # define PSEUDO_END(name) .endp
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define CENABLE	br.call.sptk.many b0 = __pthread_enable_asynccancel
 #  define CDISABLE	br.call.sptk.many b0 = __pthread_disable_asynccancel
 # elif !defined NOT_IN_libc
diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.h b/sysdeps/unix/sysv/linux/ia64/sysdep.h
index 49d289c..47fd577 100644
--- a/sysdeps/unix/sysv/linux/ia64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/ia64/sysdep.h
@@ -62,7 +62,7 @@
 
 #if defined USE_DL_SYSINFO \
 	&& (!defined NOT_IN_libc \
-	    || defined IS_IN_libpthread || IS_IN (librt))
+	    || IS_IN (libpthread) || IS_IN (librt))
 # define IA64_USE_NEW_STUB
 #else
 # undef IA64_USE_NEW_STUB
diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h b/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h
index 0e19a38..33ce922 100644
--- a/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				      \
@@ -100,7 +100,7 @@
 #  define PSEUDO_JMP(sym) jbsr sym
 # endif
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define CENABLE	PSEUDO_JMP (__pthread_enable_asynccancel)
 #  define CDISABLE	PSEUDO_JMP (__pthread_disable_asynccancel)
 # elif !defined NOT_IN_libc
diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h b/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
index 4d371ef..0fe5b12 100644
--- a/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
@@ -21,7 +21,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 # if !IS_IN (librt) || !defined(PIC)
 #  define AC_STACK_SIZE  16  /* space for r15, async_cancel arg and 2 temp words */
@@ -102,7 +102,7 @@ L(pseudo_cancel):                                                    \
 #  define PSEUDO_JMP(sym)  brlid r15, sym; addk r0, r0, r0
 # endif
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define CENABLE PSEUDO_JMP (__pthread_enable_asynccancel)
 #  define CDISABLE  PSEUDO_JMP (__pthread_disable_asynccancel)
 #  define __local_multiple_threads __pthread_multiple_threads
@@ -118,7 +118,7 @@ L(pseudo_cancel):                                                    \
 # endif
 
 
-# if defined IS_IN_libpthread || !defined NOT_IN_libc
+# if IS_IN (libpthread) || !defined NOT_IN_libc
 #  ifndef __ASSEMBLER__
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
index acbc5da..6f79b14 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
@@ -27,7 +27,7 @@
    happen before any instructions.  So we use cfi_same_value instead of
    cfi_restore.  */
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 #ifdef __PIC__
 # undef PSEUDO
@@ -213,7 +213,7 @@
 #  define PSEUDO_JMP(sym) jal sym
 # endif
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define CENABLE	PSEUDO_JMP (__pthread_enable_asynccancel)
 #  define CDISABLE	PSEUDO_JMP (__pthread_disable_asynccancel)
 # elif IS_IN (librt)
diff --git a/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h b/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
index 5fdd567..1d711f7 100644
--- a/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 # ifdef __PIC__
 #  define PSEUDO_CPLOAD .cpload t9;
@@ -154,7 +154,7 @@
 #  define PSEUDO_JMP(sym) jal sym;
 # endif
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define CENABLE	PSEUDO_JMP (__pthread_enable_asynccancel)
 #  define CDISABLE	PSEUDO_JMP (__pthread_disable_asynccancel)
 # elif IS_IN (librt)
diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h
index d089531..1d65f20 100644
--- a/sysdeps/unix/sysv/linux/not-cancel.h
+++ b/sysdeps/unix/sysv/linux/not-cancel.h
@@ -19,7 +19,7 @@
 
 #include <sysdep.h>
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 extern int __open_nocancel (const char *, int, ...) attribute_hidden;
 extern int __close_nocancel (int) attribute_hidden;
 extern int __read_nocancel (int, void *, size_t) attribute_hidden;
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
index 962beaf..25bf797 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
@@ -23,7 +23,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				\
@@ -81,7 +81,7 @@
 # define DOCARGS_6	stw 8,40(1); DOCARGS_5
 # define UNDOCARGS_6	lwz 8,40(1); UNDOCARGS_5
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define CENABLE	bl __pthread_enable_asynccancel@local
 #  define CDISABLE	bl __pthread_disable_asynccancel@local
 # elif !defined NOT_IN_libc
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
index 0447062..8683b6b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
@@ -23,7 +23,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 # ifdef HAVE_ASM_GLOBAL_DOT_NAME
 #  define DASHDASHPFX(str) .__##str
@@ -99,7 +99,7 @@
 # define DOCARGS_6	std 8,CANCEL_PARM_SAVE+40(1); DOCARGS_5
 # define UNDOCARGS_6	ld 8,CANCEL_PARM_SAVE+40(1); UNDOCARGS_5
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  ifdef SHARED
 #   define CENABLE	bl JUMPTARGET(__pthread_enable_asynccancel)
 #   define CDISABLE	bl JUMPTARGET(__pthread_disable_asynccancel)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
index bc5d852..d19500d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				      \
@@ -75,7 +75,7 @@ L(pseudo_check):							      \
 .size	__##syscall_name##_nocancel,.-__##syscall_name##_nocancel;	      \
 L(pseudo_end):
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define CENABLE	__pthread_enable_asynccancel
 #  define CDISABLE	__pthread_disable_asynccancel
 # elif !defined NOT_IN_libc
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
index 885bf7e..9622d5a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				      \
@@ -69,7 +69,7 @@ L(pseudo_check):							      \
 .size	__##syscall_name##_nocancel,.-__##syscall_name##_nocancel;	      \
 L(pseudo_end):
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define CENABLE	__pthread_enable_asynccancel
 #  define CDISABLE	__pthread_disable_asynccancel
 #  define __local_multiple_threads	__pthread_multiple_threads
@@ -111,7 +111,7 @@ L(pseudo_end):
 #define LR7_6		lg %r7,56+160(%r15); \
 			cfi_restore (%r7);
 
-# if defined IS_IN_libpthread || !defined NOT_IN_libc
+# if IS_IN (libpthread) || !defined NOT_IN_libc
 #  ifndef __ASSEMBLER__
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P \
diff --git a/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h b/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
index 4ef51c0..131f42b 100644
--- a/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
@@ -21,7 +21,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 # define _IMM12 #-12
 # define _IMM16 #-16
@@ -105,7 +105,7 @@
 # define LOAD_ARGS_5	LOAD_ARGS_4
 # define LOAD_ARGS_6	LOAD_ARGS_5
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define __local_enable_asynccancel	__pthread_enable_asynccancel
 #  define __local_disable_asynccancel	__pthread_disable_asynccancel
 # elif !defined NOT_IN_libc
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
index 2e24d2a..cc7adfc 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)	\
@@ -68,7 +68,7 @@ __##syscall_name##_nocancel:			\
 	 restore %g0, %l1, %o0;
 
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define CENABLE	call __pthread_enable_asynccancel
 #  define CDISABLE	call __pthread_disable_asynccancel
 # elif !defined NOT_IN_libc
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
index 0ae3b61..aee3dee 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)	\
@@ -66,7 +66,7 @@ __##syscall_name##_nocancel:			\
 2:	jmpl %i7 + 8, %g0;			\
 	 restore %g0, %l1, %o0;
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define CENABLE	call __pthread_enable_asynccancel
 #  define CDISABLE	call __pthread_disable_asynccancel
 # elif !defined NOT_IN_libc
diff --git a/sysdeps/unix/sysv/linux/tile/sysdep-cancel.h b/sysdeps/unix/sysv/linux/tile/sysdep-cancel.h
index 8140273..028c393 100644
--- a/sysdeps/unix/sysv/linux/tile/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/tile/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 /* Allow hacking in some extra code if desired. */
 #ifndef PSEUDO_EXTRA
@@ -117,7 +117,7 @@
 
 # define STKSPACE	(13 * REGSIZE)
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define CENABLE	jal __pthread_enable_asynccancel
 #  define CDISABLE	jal __pthread_disable_asynccancel
 # elif IS_IN (librt)
diff --git a/sysdeps/unix/sysv/linux/tile/sysdep.h b/sysdeps/unix/sysv/linux/tile/sysdep.h
index a09f8a4..191f95a 100644
--- a/sysdeps/unix/sysv/linux/tile/sysdep.h
+++ b/sysdeps/unix/sysv/linux/tile/sysdep.h
@@ -45,7 +45,7 @@
 #ifndef PIC
 /* For static code, on error jump to __syscall_error directly. */
 # define SYSCALL_ERROR_NAME __syscall_error
-#elif !defined NOT_IN_libc || defined IS_IN_libpthread
+#elif !defined NOT_IN_libc || IS_IN (libpthread)
 /* Use the internal name for libc/libpthread shared objects. */
 # define SYSCALL_ERROR_NAME __GI___syscall_error
 #else
diff --git a/sysdeps/unix/sysv/linux/tile/waitpid.S b/sysdeps/unix/sysv/linux/tile/waitpid.S
index ac8e59e..e613b1c 100644
--- a/sysdeps/unix/sysv/linux/tile/waitpid.S
+++ b/sysdeps/unix/sysv/linux/tile/waitpid.S
@@ -1,7 +1,7 @@
 /*
 extern pid_t __waitpid_nocancel (pid_t, int *, int) attribute_hidden;
 */
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 /* Call __NR_wait4, providing fourth argument (struct rusage *) as NULL. */
 #define PSEUDO_EXTRA move r3, zero;
diff --git a/sysdeps/unix/sysv/linux/x86_64/cancellation.S b/sysdeps/unix/sysv/linux/x86_64/cancellation.S
index 89fda5e..5189bbc 100644
--- a/sysdeps/unix/sysv/linux/x86_64/cancellation.S
+++ b/sysdeps/unix/sysv/linux/x86_64/cancellation.S
@@ -21,7 +21,7 @@
 #include <kernel-features.h>
 #include "lowlevellock.h"
 
-#ifdef IS_IN_libpthread
+#if IS_IN (libpthread)
 # if defined SHARED && !defined NO_HIDDEN
 #  define __pthread_unwind __GI___pthread_unwind
 # endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h
index efdb1c6..2667292 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h
@@ -22,7 +22,7 @@
 # include <nptl/pthreadP.h>
 #endif
 
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || IS_IN (librt)
+#if !defined NOT_IN_libc || IS_IN (libpthread) || IS_IN (librt)
 
 /* The code to disable cancellation depends on the fact that the called
    functions are special.  They don't modify registers other than %rax
@@ -59,7 +59,7 @@
     jae SYSCALL_ERROR_LABEL
 
 
-# ifdef IS_IN_libpthread
+# if IS_IN (libpthread)
 #  define CENABLE	call __pthread_enable_asynccancel;
 #  define CDISABLE	call __pthread_disable_asynccancel;
 #  define __local_multiple_threads __pthread_multiple_threads
@@ -74,7 +74,7 @@
 #  error Unsupported library
 # endif
 
-# if defined IS_IN_libpthread || !defined NOT_IN_libc
+# if IS_IN (libpthread) || !defined NOT_IN_libc
 #  ifndef __ASSEMBLER__
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P \
-- 
1.9.3

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

* [PATCH 13/19] Remove IS_IN_libm
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
@ 2014-08-21 10:58 ` Siddhesh Poyarekar
  2014-08-22 19:33   ` Roland McGrath
  2014-08-21 10:58 ` [PATCH 16/19] Remove NOT_IN_libc Siddhesh Poyarekar
                   ` (19 subsequent siblings)
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Replace with IS_IN (libm). Generated code unchanged on x86_64.

        * include/math.h: Use IS_IN instead of IS_IN_libm.
        * sysdeps/alpha/fpu/s_copysign.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_copysignl.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_finitel.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_fmal.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_frexpl.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_isinfl.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_isnanl.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_modfl.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_signbitl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_copysignl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_finitel.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_frexpl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_isinfl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_isnanl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_modfl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_scalbnl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_signbitl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/w_scalblnl.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_copysign.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_finite.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_frexp.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_isinf.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_isnan.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_ldexp.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_ldexpl.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_modf.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_scalbln.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_scalbn.c: Likewise.
        * sysdeps/powerpc/power5+/fpu/s_modf.c: Likewise.
        * sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Likewise.
        * sysdeps/powerpc/powerpc32/fpu/s_copysignl.S: Likewise.
        * sysdeps/powerpc/powerpc32/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c: Likewise.
        * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c: Likewise.
        * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c: Likewise.
        * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c: Likewise.
        * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf.c: Likewise.
        * sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S: Likewise.
        * sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S: Likewise.
        * sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S: Likewise.
        * sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c: Likewise.
        * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c: Likewise.
        * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c: Likewise.
        * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c: Likewise.
        * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c: Likewise.
        * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Likewise.
        * sysdeps/powerpc/powerpc64/fpu/s_copysignl.S: Likewise.
        * sysdeps/powerpc/powerpc64/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S: Likewise.
        * sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S: Likewise.
        * sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S: Likewise.
        * sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S: Likewise.
        * sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S: Likewise.
        * sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S: Likewise.
        * sysdeps/sparc/sparc32/fpu/s_signbitl.S: Likewise.
        * sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S: Likewise.
        * sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S: Likewise.
---
 include/math.h                                              | 2 +-
 sysdeps/alpha/fpu/s_copysign.c                              | 2 +-
 sysdeps/ieee754/ldbl-128ibm/s_copysignl.c                   | 2 +-
 sysdeps/ieee754/ldbl-128ibm/s_finitel.c                     | 2 +-
 sysdeps/ieee754/ldbl-128ibm/s_fmal.c                        | 2 +-
 sysdeps/ieee754/ldbl-128ibm/s_frexpl.c                      | 2 +-
 sysdeps/ieee754/ldbl-128ibm/s_isinfl.c                      | 2 +-
 sysdeps/ieee754/ldbl-128ibm/s_isnanl.c                      | 2 +-
 sysdeps/ieee754/ldbl-128ibm/s_modfl.c                       | 2 +-
 sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c                     | 2 +-
 sysdeps/ieee754/ldbl-128ibm/s_signbitl.c                    | 2 +-
 sysdeps/ieee754/ldbl-64-128/s_copysignl.c                   | 2 +-
 sysdeps/ieee754/ldbl-64-128/s_finitel.c                     | 2 +-
 sysdeps/ieee754/ldbl-64-128/s_frexpl.c                      | 2 +-
 sysdeps/ieee754/ldbl-64-128/s_isinfl.c                      | 4 ++--
 sysdeps/ieee754/ldbl-64-128/s_isnanl.c                      | 4 ++--
 sysdeps/ieee754/ldbl-64-128/s_modfl.c                       | 2 +-
 sysdeps/ieee754/ldbl-64-128/s_scalbnl.c                     | 2 +-
 sysdeps/ieee754/ldbl-64-128/s_signbitl.c                    | 2 +-
 sysdeps/ieee754/ldbl-64-128/w_scalblnl.c                    | 2 +-
 sysdeps/ieee754/ldbl-opt/s_copysign.c                       | 2 +-
 sysdeps/ieee754/ldbl-opt/s_finite.c                         | 2 +-
 sysdeps/ieee754/ldbl-opt/s_frexp.c                          | 2 +-
 sysdeps/ieee754/ldbl-opt/s_isinf.c                          | 2 +-
 sysdeps/ieee754/ldbl-opt/s_isnan.c                          | 2 +-
 sysdeps/ieee754/ldbl-opt/s_ldexp.c                          | 2 +-
 sysdeps/ieee754/ldbl-opt/s_ldexpl.c                         | 2 +-
 sysdeps/ieee754/ldbl-opt/s_modf.c                           | 2 +-
 sysdeps/ieee754/ldbl-opt/s_scalbln.c                        | 2 +-
 sysdeps/ieee754/ldbl-opt/s_scalbn.c                         | 2 +-
 sysdeps/powerpc/power5+/fpu/s_modf.c                        | 2 +-
 sysdeps/powerpc/powerpc32/fpu/s_copysign.S                  | 2 +-
 sysdeps/powerpc/powerpc32/fpu/s_copysignl.S                 | 2 +-
 sysdeps/powerpc/powerpc32/fpu/s_isnan.S                     | 2 +-
 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c | 2 +-
 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c   | 2 +-
 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c    | 2 +-
 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c    | 2 +-
 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf.c     | 2 +-
 sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S              | 2 +-
 sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S           | 2 +-
 sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S              | 2 +-
 sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S             | 2 +-
 sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S              | 2 +-
 sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S              | 2 +-
 sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c        | 2 +-
 sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c          | 2 +-
 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c           | 2 +-
 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c           | 2 +-
 sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c            | 2 +-
 sysdeps/powerpc/powerpc64/fpu/s_copysign.S                  | 2 +-
 sysdeps/powerpc/powerpc64/fpu/s_copysignl.S                 | 2 +-
 sysdeps/powerpc/powerpc64/fpu/s_isnan.S                     | 2 +-
 sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S              | 2 +-
 sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S           | 2 +-
 sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S              | 2 +-
 sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S             | 2 +-
 sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S             | 2 +-
 sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S              | 2 +-
 sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S              | 2 +-
 sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S             | 2 +-
 sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S              | 2 +-
 sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S              | 2 +-
 sysdeps/sparc/sparc32/fpu/s_signbitl.S                      | 2 +-
 sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S                 | 2 +-
 sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S                 | 2 +-
 66 files changed, 68 insertions(+), 68 deletions(-)

diff --git a/include/math.h b/include/math.h
index cbbce59..b10bfa0 100644
--- a/include/math.h
+++ b/include/math.h
@@ -6,7 +6,7 @@
 /* Now define the internal interfaces.  */
 extern int __matherr (struct exception *__exc);
 
-# if !defined NOT_IN_libc || defined IS_IN_libm
+# if !defined NOT_IN_libc || IS_IN (libm)
 hidden_proto (__finite)
 hidden_proto (__isinf)
 hidden_proto (__isnan)
diff --git a/sysdeps/alpha/fpu/s_copysign.c b/sysdeps/alpha/fpu/s_copysign.c
index 13f5f1b..9092613 100644
--- a/sysdeps/alpha/fpu/s_copysign.c
+++ b/sysdeps/alpha/fpu/s_copysign.c
@@ -30,7 +30,7 @@ weak_alias (__copysign, copysign)
 strong_alias (__copysign, __copysignl)
 weak_alias (__copysign, copysignl)
 #endif
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
 # endif
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c b/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c
index a16a886..3b8ec1a 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c
@@ -34,7 +34,7 @@ long double __copysignl(long double x, long double y)
   return x;
 }
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, __copysignl, copysignl);
 #else
 long_double_symbol (libc, __copysignl, copysignl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_finitel.c b/sysdeps/ieee754/ldbl-128ibm/s_finitel.c
index 7b4655f..b562ce6 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_finitel.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_finitel.c
@@ -40,7 +40,7 @@ ___finitel (long double x)
 }
 hidden_ver (___finitel, __finitel)
 weak_alias (___finitel, ____finitel)
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, ____finitel, finitel);
 long_double_symbol (libm, ___finitel, __finitel);
 #else
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fmal.c b/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
index 46dedf8..a2111d0 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
@@ -37,7 +37,7 @@ __fmal (long double x, long double y, long double z)
 
        return (x * y) + z;
 }
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, __fmal, fmal);
 #else
 long_double_symbol (libc, __fmal, fmal);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c b/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c
index a644f92..483c6a8 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c
@@ -141,7 +141,7 @@ long double __frexpl(long double x, int *eptr)
   *eptr = expon;
   return x;
 }
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, __frexpl, frexpl);
 #else
 long_double_symbol (libc, __frexpl, frexpl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_isinfl.c b/sysdeps/ieee754/ldbl-128ibm/s_isinfl.c
index 6a72822..730aa4d 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_isinfl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_isinfl.c
@@ -33,7 +33,7 @@ ___isinfl (long double x)
   return ~mask & (hx >> 62);
 }
 hidden_ver (___isinfl, __isinfl)
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 weak_alias (___isinfl, ____isinfl)
 long_double_symbol (libc, ___isinfl, isinfl);
 long_double_symbol (libc, ____isinfl, __isinfl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c b/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c
index d12f1d3..9980875 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c
@@ -39,7 +39,7 @@ ___isnanl (long double x)
   return (int) (hx >> 63);
 }
 hidden_ver (___isnanl, __isnanl)
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 weak_alias (___isnanl, ____isnanl)
 long_double_symbol (libc, ___isnanl, isnanl);
 long_double_symbol (libc, ____isnanl, __isnanl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_modfl.c b/sysdeps/ieee754/ldbl-128ibm/s_modfl.c
index ed03ce2..260cc3e 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_modfl.c
@@ -89,7 +89,7 @@ long double __modfl(long double x, long double *iptr)
 	    }
 	}
 }
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, __modfl, modfl);
 #else
 long_double_symbol (libc, __modfl, modfl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c b/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c
index 161172d..a0d7aa9 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c
@@ -102,7 +102,7 @@ long double __scalbnl (long double x, int n)
 	x = ldbl_pack (xhi, xlo);
 	return x*twolm54;
 }
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, __scalbnl, scalbnl);
 #else
 long_double_symbol (libc, __scalbnl, scalbnl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c b/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c
index 6d25711..fbccaf1 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c
@@ -31,7 +31,7 @@ ___signbitl (long double x)
   EXTRACT_WORDS64 (e, xhi);
   return e < 0;
 }
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, ___signbitl, __signbitl);
 #else
 long_double_symbol (libc, ___signbitl, __signbitl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
index 1319584..211e724 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
@@ -2,7 +2,7 @@
 #undef weak_alias
 #define weak_alias(n,a)
 #include <sysdeps/ieee754/ldbl-128/s_copysignl.c>
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, __copysignl, copysignl);
 #else
 long_double_symbol (libc, __copysignl, copysignl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_finitel.c b/sysdeps/ieee754/ldbl-64-128/s_finitel.c
index 90717a1..c0862a7 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_finitel.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_finitel.c
@@ -8,7 +8,7 @@
 #undef __finitel
 hidden_ver (___finitel, __finitel)
 _weak_alias (___finitel, ____finitel)
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, ____finitel, finitel);
 long_double_symbol (libm, ___finitel, __finitel);
 #else
diff --git a/sysdeps/ieee754/ldbl-64-128/s_frexpl.c b/sysdeps/ieee754/ldbl-64-128/s_frexpl.c
index 685bbba..c7b6aaa 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_frexpl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_frexpl.c
@@ -2,7 +2,7 @@
 #undef weak_alias
 #define weak_alias(n,a)
 #include <sysdeps/ieee754/ldbl-128/s_frexpl.c>
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, __frexpl, frexpl);
 #else
 long_double_symbol (libc, __frexpl, frexpl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_isinfl.c b/sysdeps/ieee754/ldbl-64-128/s_isinfl.c
index e046032..6dab0e9 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_isinfl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_isinfl.c
@@ -1,5 +1,5 @@
 #include <math_ldbl_opt.h>
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # undef weak_alias
 # define weak_alias(n,a)
 # undef hidden_def
@@ -7,7 +7,7 @@
 # define __isinfl(arg) ___isinfl(arg)
 #endif
 #include <sysdeps/ieee754/ldbl-128/s_isinfl.c>
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # undef __isinfl
 hidden_ver (___isinfl, __isinfl)
 _weak_alias (___isinfl, ____isinfl)
diff --git a/sysdeps/ieee754/ldbl-64-128/s_isnanl.c b/sysdeps/ieee754/ldbl-64-128/s_isnanl.c
index 3673463..ad5ecc5 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_isnanl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_isnanl.c
@@ -1,5 +1,5 @@
 #include <math_ldbl_opt.h>
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # undef weak_alias
 # define weak_alias(n,a)
 # undef hidden_def
@@ -7,7 +7,7 @@
 # define __isnanl(arg) ___isnanl(arg)
 #endif
 #include <sysdeps/ieee754/ldbl-128/s_isnanl.c>
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # undef __isnanl
 hidden_ver (___isnanl, __isnanl)
 _weak_alias (___isnanl, ____isnanl)
diff --git a/sysdeps/ieee754/ldbl-64-128/s_modfl.c b/sysdeps/ieee754/ldbl-64-128/s_modfl.c
index c17d669..fa4d3ad 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_modfl.c
@@ -2,7 +2,7 @@
 #undef weak_alias
 #define weak_alias(n,a)
 #include <sysdeps/ieee754/ldbl-128/s_modfl.c>
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, __modfl, modfl);
 #else
 long_double_symbol (libc, __modfl, modfl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_scalbnl.c b/sysdeps/ieee754/ldbl-64-128/s_scalbnl.c
index 78520e9..fe2412b 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_scalbnl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_scalbnl.c
@@ -2,7 +2,7 @@
 #undef weak_alias
 #define weak_alias(n,a)
 #include <sysdeps/ieee754/ldbl-128/s_scalbnl.c>
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, __scalbnl, scalbnl);
 #else
 long_double_symbol (libc, __scalbnl, scalbnl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_signbitl.c b/sysdeps/ieee754/ldbl-64-128/s_signbitl.c
index f66db2f..850db73 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_signbitl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_signbitl.c
@@ -4,7 +4,7 @@
 #define __signbitl(arg) ___signbitl(arg)
 #include <sysdeps/ieee754/ldbl-128/s_signbitl.c>
 #undef __signbitl
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, ___signbitl, __signbitl);
 #else
 long_double_symbol (libc, ___signbitl, __signbitl);
diff --git a/sysdeps/ieee754/ldbl-64-128/w_scalblnl.c b/sysdeps/ieee754/ldbl-64-128/w_scalblnl.c
index fc6c4cf..2f3fc1f 100644
--- a/sysdeps/ieee754/ldbl-64-128/w_scalblnl.c
+++ b/sysdeps/ieee754/ldbl-64-128/w_scalblnl.c
@@ -20,7 +20,7 @@
 #undef weak_alias
 #define weak_alias(name, alias)
 #include <math/w_scalblnl.c>
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, __w_scalblnl, scalblnl);
 #else
 long_double_symbol (libc, __w_scalblnl, scalblnl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_copysign.c b/sysdeps/ieee754/ldbl-opt/s_copysign.c
index 425e0ea..f4303f5 100644
--- a/sysdeps/ieee754/ldbl-opt/s_copysign.c
+++ b/sysdeps/ieee754/ldbl-opt/s_copysign.c
@@ -1,6 +1,6 @@
 #include <math_ldbl_opt.h>
 #include <sysdeps/ieee754/dbl-64/s_copysign.c>
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
 # endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_finite.c b/sysdeps/ieee754/ldbl-opt/s_finite.c
index 897dbfd..7d3ab00 100644
--- a/sysdeps/ieee754/ldbl-opt/s_finite.c
+++ b/sysdeps/ieee754/ldbl-opt/s_finite.c
@@ -1,7 +1,7 @@
 #include <math_ldbl_opt.h>
 #include <sysdeps/ieee754/dbl-64/s_finite.c>
 weak_alias (__finite, ___finite)
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
 compat_symbol (libm, __finite, __finitel, GLIBC_2_1);
 # endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_frexp.c b/sysdeps/ieee754/ldbl-opt/s_frexp.c
index 59ce352..0e3a5e0 100644
--- a/sysdeps/ieee754/ldbl-opt/s_frexp.c
+++ b/sysdeps/ieee754/ldbl-opt/s_frexp.c
@@ -1,6 +1,6 @@
 #include <math_ldbl_opt.h>
 #include <sysdeps/ieee754/dbl-64/s_frexp.c>
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __frexp, frexpl, GLIBC_2_0);
 # endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_isinf.c b/sysdeps/ieee754/ldbl-opt/s_isinf.c
index 401c8b1..1f760a0 100644
--- a/sysdeps/ieee754/ldbl-opt/s_isinf.c
+++ b/sysdeps/ieee754/ldbl-opt/s_isinf.c
@@ -1,6 +1,6 @@
 #include <math_ldbl_opt.h>
 #include <sysdeps/ieee754/dbl-64/s_isinf.c>
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
 compat_symbol (libc, isinf, isinfl, GLIBC_2_0);
diff --git a/sysdeps/ieee754/ldbl-opt/s_isnan.c b/sysdeps/ieee754/ldbl-opt/s_isnan.c
index 164b800..33f57f1 100644
--- a/sysdeps/ieee754/ldbl-opt/s_isnan.c
+++ b/sysdeps/ieee754/ldbl-opt/s_isnan.c
@@ -1,6 +1,6 @@
 #include <math_ldbl_opt.h>
 #include <sysdeps/ieee754/dbl-64/s_isnan.c>
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexp.c b/sysdeps/ieee754/ldbl-opt/s_ldexp.c
index f0f6519..20e107b 100644
--- a/sysdeps/ieee754/ldbl-opt/s_ldexp.c
+++ b/sysdeps/ieee754/ldbl-opt/s_ldexp.c
@@ -1,6 +1,6 @@
 #include <math_ldbl_opt.h>
 #include <math/s_ldexp.c>
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __ldexp, ldexpl, GLIBC_2_0);
 # endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
index d4636b9..0dce1b1 100644
--- a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
+++ b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
@@ -2,7 +2,7 @@
 #undef weak_alias
 #define weak_alias(n,a)
 #include <math/s_ldexpl.c>
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, __ldexpl, ldexpl);
 #else
 long_double_symbol (libc, __ldexpl, ldexpl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_modf.c b/sysdeps/ieee754/ldbl-opt/s_modf.c
index 2263811..93acb43 100644
--- a/sysdeps/ieee754/ldbl-opt/s_modf.c
+++ b/sysdeps/ieee754/ldbl-opt/s_modf.c
@@ -1,6 +1,6 @@
 #include <math_ldbl_opt.h>
 #include <sysdeps/ieee754/dbl-64/s_modf.c>
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __modf, modfl, GLIBC_2_0);
 # endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_scalbln.c b/sysdeps/ieee754/ldbl-opt/s_scalbln.c
index 2398bba..391142b 100644
--- a/sysdeps/ieee754/ldbl-opt/s_scalbln.c
+++ b/sysdeps/ieee754/ldbl-opt/s_scalbln.c
@@ -1,6 +1,6 @@
 #include <math_ldbl_opt.h>
 #include <sysdeps/ieee754/dbl-64/s_scalbln.c>
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 #if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
 compat_symbol (libm, __scalbln, scalblnl, GLIBC_2_1);
 #endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_scalbn.c b/sysdeps/ieee754/ldbl-opt/s_scalbn.c
index 094735e..1ad81b1 100644
--- a/sysdeps/ieee754/ldbl-opt/s_scalbn.c
+++ b/sysdeps/ieee754/ldbl-opt/s_scalbn.c
@@ -1,6 +1,6 @@
 #include <math_ldbl_opt.h>
 #include <sysdeps/ieee754/dbl-64/s_scalbn.c>
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __scalbn, scalbnl, GLIBC_2_0);
 # endif
diff --git a/sysdeps/powerpc/power5+/fpu/s_modf.c b/sysdeps/powerpc/power5+/fpu/s_modf.c
index 06da3ac..7d6cc84 100644
--- a/sysdeps/powerpc/power5+/fpu/s_modf.c
+++ b/sysdeps/powerpc/power5+/fpu/s_modf.c
@@ -49,7 +49,7 @@ weak_alias (__modf, modf)
 strong_alias (__modf, __modfl)
 weak_alias (__modf, modfl)
 #endif
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __modf, modfl, GLIBC_2_0);
 # endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_copysign.S b/sysdeps/powerpc/powerpc32/fpu/s_copysign.S
index 0d172d7..25b7ce1 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_copysign.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_copysign.S
@@ -50,7 +50,7 @@ strong_alias(__copysign,__copysignf)
 weak_alias (__copysign,copysignl)
 strong_alias(__copysign,__copysignl)
 #endif
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __copysign, copysignl, GLIBC_2_0)
 # endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S b/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S
index ecfeafc..31fe9fe 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S
@@ -42,7 +42,7 @@ L(0):	bgelr	cr6
 	blr
 END (__copysignl)
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, __copysignl, copysignl)
 #else
 long_double_symbol (libc, __copysignl, copysignl)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/fpu/s_isnan.S
index d82a3c6..caa85e9 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_isnan.S
@@ -48,7 +48,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c
index 52df99d..74cd540 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c
@@ -42,7 +42,7 @@ weak_alias (__copysign, copysign)
 weak_alias (__copysign,copysignl)
 strong_alias(__copysign,__copysignl)
 #endif
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
 # endif
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c
index c56e7ca..5244d9a 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c
@@ -36,7 +36,7 @@ strong_alias (__finite, __finitel)
 weak_alias (__finite, finitel)
 #endif
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
 compat_symbol (libm, finite, finitel, GLIBC_2_0);
 # endif
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c
index 2f72c34..ba57a25 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c
@@ -36,7 +36,7 @@ strong_alias (__isinf, __isinfl)
 weak_alias (__isinf, isinfl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
 compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
 compat_symbol (libc, isinf, isinfl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c
index 8f3666b..f182d50 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c
@@ -42,7 +42,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf.c
index 596b32c..383156b 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf.c
@@ -35,7 +35,7 @@ weak_alias (__modf, modf)
 strong_alias (__modf, __modfl)
 weak_alias (__modf, modfl)
 #endif
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __modf, modfl, GLIBC_2_0);
 # endif
diff --git a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
index 99879a8..e91c567 100644
--- a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
@@ -52,7 +52,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S
index d767dcb..90e0d29 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S
+++ b/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S
@@ -47,7 +47,7 @@ strong_alias (__copysign, __copysignl)
 weak_alias (__copysign, copysignl)
 #endif
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
 compat_symbol (libm, copysign, copysignl, GLIBC_2_0)
 # endif
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
index 563e70a..461ae0d 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
@@ -52,7 +52,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
index 20e266b..cd1b184 100644
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
+++ b/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
@@ -78,7 +78,7 @@ strong_alias (__finite, __finitel)
 weak_alias (__finite, finitel)
 #endif
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
 compat_symbol (libm, finite, finitel, GLIBC_2_0)
 # endif
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S
index 47d608a..f9d5ca1 100644
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S
+++ b/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S
@@ -77,7 +77,7 @@ strong_alias (__isinf, __isinfl)
 weak_alias (__isinf, isinfl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
 compat_symbol (libc, isinf, isinfl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
index 9cb8284..6aa9e11 100644
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
@@ -82,7 +82,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c
index f3e6b3a..c42b37c 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c
@@ -42,7 +42,7 @@ weak_alias (__copysign, copysign)
 weak_alias (__copysign,copysignl)
 strong_alias(__copysign,__copysignl)
 #endif
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
 # endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
index b9e908d..078540d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
@@ -39,7 +39,7 @@ strong_alias (__finite, __finitel)
 weak_alias (__finite, finitel)
 #endif
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
 compat_symbol (libm, finite, finitel, GLIBC_2_0);
 # endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
index e349a06..5781c3d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
@@ -39,7 +39,7 @@ strong_alias (__isinf, __isinfl)
 weak_alias (__isinf, isinfl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
 compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
 compat_symbol (libc, isinf, isinfl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
index 65a5ca0..2fd76b4 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
@@ -48,7 +48,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c
index f416fa9..a61adf5 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c
@@ -35,7 +35,7 @@ weak_alias (__modf, modf)
 strong_alias (__modf, __modfl)
 weak_alias (__modf, modfl)
 #endif
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __modf, modfl, GLIBC_2_0);
 # endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_copysign.S b/sysdeps/powerpc/powerpc64/fpu/s_copysign.S
index 49c793d..78b3756 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_copysign.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_copysign.S
@@ -50,7 +50,7 @@ strong_alias(__copysign,__copysignf)
 weak_alias (__copysign,copysignl)
 strong_alias(__copysign,__copysignl)
 #endif
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __copysign, copysignl, GLIBC_2_0)
 # endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S b/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S
index 39e180a..453c01a 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S
@@ -43,7 +43,7 @@ L(0):
 	blr
 END (__copysignl)
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, __copysignl, copysignl)
 #else
 long_double_symbol (libc, __copysignl, copysignl)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/fpu/s_isnan.S
index 629dae6..71e79f6 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_isnan.S
@@ -47,7 +47,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S
index 4ce6cf9..46796ab 100644
--- a/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S
@@ -51,7 +51,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S b/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
index e1ea089..c5bb161 100644
--- a/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
+++ b/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
@@ -47,7 +47,7 @@ strong_alias (__copysign, __copysignl)
 weak_alias (__copysign, copysignl)
 #endif
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
 compat_symbol (libm, copysign, copysignl, GLIBC_2_0)
 # endif
diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
index 8a149b2..0ba6ad4 100644
--- a/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
@@ -50,7 +50,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S
index 3172fe3..20ed867 100644
--- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S
@@ -49,7 +49,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
index 765d689..8d4916d 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
+++ b/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
@@ -57,7 +57,7 @@ strong_alias (__finite, __finitef)
 hidden_def (__finitef)
 weak_alias (__finitef, finitef)
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
 compat_symbol (libm, __finite, __finitel, GLIBC_2_0)
 compat_symbol (libm, finite, finitel, GLIBC_2_0)
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
index e102d4b..79fd2e6 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
+++ b/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
@@ -61,7 +61,7 @@ strong_alias (__isinf, __isinfl)
 weak_alias (__isinf, isinfl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
 compat_symbol (libc, isinf, isinfl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S
index eabee71..5056261 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S
@@ -60,7 +60,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S
index 2b27e7b..640f75f 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S
@@ -48,7 +48,7 @@ strong_alias (__finite, __finitef)
 hidden_def (__finitef)
 weak_alias (__finitef, finitef)
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
 compat_symbol (libm, __finite, __finitel, GLIBC_2_0)
 compat_symbol (libm, finite, finitel, GLIBC_2_0)
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S
index d09b7fc..0e01be7 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S
@@ -58,7 +58,7 @@ strong_alias (__isinf, __isinfl)
 weak_alias (__isinf, isinfl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
 compat_symbol (libc, isinf, isinfl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S
index cf119e5..7e3d2d1 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S
@@ -53,7 +53,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/sparc/sparc32/fpu/s_signbitl.S b/sysdeps/sparc/sparc32/fpu/s_signbitl.S
index 64813f1..52f1baa 100644
--- a/sysdeps/sparc/sparc32/fpu/s_signbitl.S
+++ b/sysdeps/sparc/sparc32/fpu/s_signbitl.S
@@ -25,7 +25,7 @@ ENTRY (___signbitl)
 	 srl	%o1, 31, %o0
 END (___signbitl)
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 long_double_symbol (libm, ___signbitl, __signbitl);
 #else
 long_double_symbol (libc, ___signbitl, __signbitl);
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S
index f2e40b1..584204e 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S
@@ -32,7 +32,7 @@ END (__isnan)
 hidden_def (__isnan)
 weak_alias (__isnan, isnan)
 
-#ifndef IS_IN_libm
+#if !IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S b/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S
index c5fa62b..b8f344e 100644
--- a/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S
+++ b/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S
@@ -46,7 +46,7 @@ ENTRY(__feraiseexcept)
 END(__feraiseexcept)
 	cfi_endproc
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # include <shlib-compat.h>
 # if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
 strong_alias (__feraiseexcept, __old_feraiseexcept)
-- 
1.9.3

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

* [PATCH 01/19] Add new macro IN_MODULE to identify module in which source is built
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (12 preceding siblings ...)
  2014-08-21 10:58 ` [PATCH 08/19] Remove IS_IN_ldconfig Siddhesh Poyarekar
@ 2014-08-21 10:58 ` Siddhesh Poyarekar
  2014-08-22 18:22   ` Roland McGrath
  2014-08-21 10:58 ` [PATCH 14/19] Remove IS_IN_rtld Siddhesh Poyarekar
                   ` (6 subsequent siblings)
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 10:58 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

The current scheme to identify which module a translation unit is
built in depends on defining multiple macros IS_IN_* and also defining
NOT_IN_libc if we're building a non-libc module.  In addition, there
is an IN_LIB macro that does effectively the same thing, but for
different modules (notably the systemtap probes).  This macro scheme
unifies both ideas to use just one macro IN_MODULE and assign it a
value depending on the module it is being built into.  If the module
is not defined, it defaults to MODULE_libc.

Patches that follow will remove uses of IS_IN_* variables with the
IS_IN() macro.  libc-symbols.h has been converted already to give an
example of how such a transition will look.

Verified that there are no relevant source changes.  One source change
that will crop up repeatedly is that of nscd_stat, since it uses the
build timestamp as a constant in its logic.

	* Makeconfig (in-module): Get value of libof set for the
	translation unit.
	(module-def): Set IN_MODULE based on value of libof-*.
	(CPPFLAGS): Add $(module-def) to CPPFLAGS.
	* Makerules: Don't suffix routine names for nonlib.
	* include/libc-modules.h: New file.
	* include/libc-symbols.h: Include libc-modules.h
	(IS_IN): New macro to replace IS_IN_* macros.
	* crypt/Makefile: Set libof-* for each routine.
	* debug/Makefile: Likewise.
	* dlfcn/Makefile: Likewise.
	* elf/Makefile: Likewise.
	* elf/rtld-Rules: Likewise.
	* extra-modules.mk: Likewise.
	* hesiod/Makefile: Likewise.
	* iconv/Makefile: Likewise.
	* iconvdata/Makefile: Likewise.
	* libidn/Makefile: Likewise.
	* locale/Makefile: Likewise.
	* login/Makefile: Likewise.
	* mach/Machrules: Likewise.
	* malloc/Makefile: Likewise.
	* math/Makefile: Likewise.
	* nis/Makefile: Likewise.
	* nptl/Makefile: Likewise.
	* nptl_db/Makefile: Likewise.
	* nss/Makefile: Likewise.
	* resolv/Makefile: Likewise.
	* rt/Makefile: Likewise.
	* stdlib/Makefile: Likewise.
	* sunrpc/Makefile: Likewise.
	* sysdeps/gnu/Makefile: Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile: Likewise.
	* sysdeps/unix/sysv/linux/Makefile: Likewise.
	* sysdeps/s390/s390-64/Makefile: Likewise.
	* nscd/Makefile: Set libof-* for each routine.  Set CFLAGS and
	CPPFLAGS for nscd instead of nonlib.
---
 Makeconfig                        |  7 ++++++-
 Makerules                         |  2 +-
 crypt/Makefile                    |  5 +++++
 debug/Makefile                    | 10 ++++++++++
 dlfcn/Makefile                    |  5 +++++
 elf/Makefile                      |  7 ++++++-
 elf/rtld-Rules                    |  5 +++++
 extra-modules.mk                  |  1 +
 hesiod/Makefile                   |  5 +++++
 iconv/Makefile                    | 11 ++++++-----
 iconvdata/Makefile                |  6 ++++++
 include/libc-modules.h            | 37 +++++++++++++++++++++++++++++++++++++
 include/libc-symbols.h            | 24 ++++++++++++++----------
 libidn/Makefile                   |  5 +++++
 locale/Makefile                   | 13 +++++++++----
 login/Makefile                    |  4 ++++
 mach/Machrules                    |  5 +++++
 malloc/Makefile                   |  9 +++++++++
 math/Makefile                     |  4 ++++
 nis/Makefile                      | 12 ++++++++++++
 nptl/Makefile                     |  5 +++++
 nptl_db/Makefile                  |  4 ++++
 nscd/Makefile                     | 13 ++++++-------
 nss/Makefile                      | 13 ++++++++++++-
 resolv/Makefile                   |  8 ++++++++
 rt/Makefile                       |  4 ++++
 stdlib/Makefile                   |  1 +
 sunrpc/Makefile                   |  4 ++++
 sysdeps/gnu/Makefile              |  2 ++
 sysdeps/ieee754/ldbl-opt/Makefile |  4 ++++
 sysdeps/s390/s390-64/Makefile     |  4 ++++
 sysdeps/unix/sysv/linux/Makefile  |  1 +
 32 files changed, 210 insertions(+), 30 deletions(-)
 create mode 100644 include/libc-modules.h

diff --git a/Makeconfig b/Makeconfig
index cef0f06..5c6de39 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -813,6 +813,11 @@ endif	# $(+cflags) == ""
 # of many little headers in the include directory.
 libio-include = -I$(..)libio
 
+in-module = $(strip $(foreach lib,$(libof-$(basename $(@F))) $(libof-$(<F)) \
+				  $(libof-$(@F)),-DIN_MODULE=MODULE_$(lib)))
+
+module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
+
 # These are the variables that the implicit compilation rules use.
 # Note that we can't use -std=* in CPPFLAGS, because it overrides
 # the implicit -lang-asm and breaks cpp behavior for .S files--notably
@@ -821,7 +826,7 @@ CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
 	   $($(subdir)-CPPFLAGS) \
 	   $(+includes) $(defines) \
 	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
-	   $(CPPFLAGS-$(suffix $@)) \
+	   $(CPPFLAGS-$(suffix $@)) $(module-def) \
 	   $(foreach lib,$(libof-$(basename $(@F))) \
 			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
diff --git a/Makerules b/Makerules
index 6b30e8c..2736db7 100644
--- a/Makerules
+++ b/Makerules
@@ -1156,7 +1156,7 @@ xcheck: xtests
 
 all-nonlib = $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) $(others))
 ifneq (,$(all-nonlib))
-cpp-srcs-left = $(all-nonlib:=.c) $(all-nonlib:=.cc)
+cpp-srcs-left = $(all-nonlib)
 lib := nonlib
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 endif
diff --git a/crypt/Makefile b/crypt/Makefile
index b1645de..21fd59b 100644
--- a/crypt/Makefile
+++ b/crypt/Makefile
@@ -64,6 +64,11 @@ $(objpfx)sha256test: $(patsubst %, $(objpfx)%.o,$(sha256-routines))
 $(objpfx)sha512test: $(patsubst %, $(objpfx)%.o,$(sha512-routines))
 endif
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(libcrypt-routines)
+lib := libcrypt
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 ifeq (yes,$(build-shared))
 $(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.so
 else
diff --git a/debug/Makefile b/debug/Makefile
index c284c51..c53a03a 100644
--- a/debug/Makefile
+++ b/debug/Makefile
@@ -158,6 +158,16 @@ generated += catchsegv xtrace
 
 include ../Rules
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(libSegFault-routines)
+lib := libSegFault
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
+# Set libof-* for each routine.
+cpp-srcs-left := $(libpcprofile-routines)
+lib := libpcprofile
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 sLIBdir := $(shell echo $(slibdir) | sed 's,lib\(\|64\)$$,\\\\$$LIB,')
 
 $(objpfx)catchsegv: catchsegv.sh $(common-objpfx)soversions.mk \
diff --git a/dlfcn/Makefile b/dlfcn/Makefile
index 1fad0a5..a0ad953 100644
--- a/dlfcn/Makefile
+++ b/dlfcn/Makefile
@@ -64,6 +64,11 @@ generated += $(modules-names:=.so)
 
 include ../Rules
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(libdl-routines)
+lib := libdl
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names)))
 
 ifeq ($(build-shared),yes)
diff --git a/elf/Makefile b/elf/Makefile
index 25012cc..f7d384d 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -430,7 +430,8 @@ $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
 
 SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
 CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
-		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
+		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1 -DNOT_IN_libc=1
+libof-ldconfig = ldconfig
 CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
 CFLAGS-cache.c = $(SYSCONF-FLAGS)
 CFLAGS-rtld.c = $(SYSCONF-FLAGS)
@@ -438,6 +439,10 @@ CFLAGS-rtld.c = $(SYSCONF-FLAGS)
 CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
 		     -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
 
+cpp-srcs-left := $(all-rtld-routines:=.os)
+lib := rtld
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
 generated += $(addsuffix .so,$(strip $(modules-names)))
 
diff --git a/elf/rtld-Rules b/elf/rtld-Rules
index 0a5d6af..4d78d90 100644
--- a/elf/rtld-Rules
+++ b/elf/rtld-Rules
@@ -138,6 +138,11 @@ ifdef rtld-depfiles
 -include $(rtld-depfiles)
 endif
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(subst .os,,$(rtld-modules))
+lib := rtld
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 # This here is the whole point of all the shenanigans.
 rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld
 
diff --git a/extra-modules.mk b/extra-modules.mk
index c7ed850..9c2e4d2 100644
--- a/extra-modules.mk
+++ b/extra-modules.mk
@@ -6,4 +6,5 @@
 module := $(firstword $(extra-modules-left))
 extra-modules-left := $(filter-out $(module),$(extra-modules-left))
 
+libof-$(notdir $(module)) := extramodules
 CPPFLAGS-$(module).c += -DNOT_IN_libc
diff --git a/hesiod/Makefile b/hesiod/Makefile
index 19952af..40ad4a4 100644
--- a/hesiod/Makefile
+++ b/hesiod/Makefile
@@ -35,6 +35,11 @@ libnss_hesiod-inhibit-o	= $(filter-out .os,$(object-suffixes))
 
 include ../Rules
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(libnss_hesiod-routines)
+lib := libnss_hesiod
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 # The Hesiod NSS module also needs the resolver and some help from
 # the file service.
 $(objpfx)libnss_hesiod.so: $(common-objpfx)resolv/libresolv.so \
diff --git a/iconv/Makefile b/iconv/Makefile
index 48d17d7..8031a88 100644
--- a/iconv/Makefile
+++ b/iconv/Makefile
@@ -52,11 +52,12 @@ CFLAGS-gconv_cache.c += -DGCONV_DIR='"$(gconvdir)"'
 CFLAGS-gconv_conf.c = -DGCONV_PATH='"$(gconvdir)"'
 CFLAGS-iconvconfig.c = -DGCONV_PATH='"$(gconvdir)"' -DGCONV_DIR='"$(gconvdir)"'
 
-CPPFLAGS-iconv_charmap = -DNOT_IN_libc
-CPPFLAGS-linereader = -DNOT_IN_libc
-CPPFLAGS-strtab = -DNOT_IN_libc
-CPPFLAGS-charmap = -DNOT_IN_libc
-CPPFLAGS-charmap-dir = -DNOT_IN_libc
+CPPFLAGS-iconvprogs = -DNOT_IN_libc
+
+# Set libof-* for each routine.
+cpp-srcs-left := $(iconv_prog-modules) $(iconvconfig-modules)
+lib := iconvprogs
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
 ifeq ($(run-built-tests),yes)
 xtests-special += $(objpfx)test-iconvconfig.out
diff --git a/iconvdata/Makefile b/iconvdata/Makefile
index 0a410a1..63ed612 100644
--- a/iconvdata/Makefile
+++ b/iconvdata/Makefile
@@ -211,6 +211,7 @@ $(objpfx)iconv-rules: Makefile
 	$(AWK) 'NR == 1 { \
 		  for (i = 1; i <= NF; i++) { \
 		    printf "%s-routines := %s\n", $$i, tolower($$i); \
+		    printf "libof-%s := iconvdata\n", tolower($$i); \
 		    printf "%s-map := gconv.map\n", $$i; \
 		  } \
 		}; \
@@ -273,6 +274,11 @@ endif
 
 include ../Rules
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(modules) $(generated-modules)
+lib := iconvdata
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 tst-loading-ENV = MALLOC_TRACE=$(objpfx)tst-loading.mtrace
 $(objpfx)mtrace-tst-loading.out: $(objpfx)tst-loading.out
 	$(common-objpfx)malloc/mtrace $(objpfx)tst-loading.mtrace > $@; \
diff --git a/include/libc-modules.h b/include/libc-modules.h
new file mode 100644
index 0000000..d12fb90
--- /dev/null
+++ b/include/libc-modules.h
@@ -0,0 +1,37 @@
+#define MODULE_libc		1
+#define MODULE_libpthread	2
+#define MODULE_rtld		3
+#define MODULE_libdl		4
+#define MODULE_libm		5
+#define MODULE_iconvprogs	6
+#define MODULE_iconvdata	7
+#define MODULE_lddlibc4		8
+#define MODULE_locale_programs	9
+#define MODULE_memusagestat	10
+#define MODULE_libutil		12
+#define MODULE_libBrokenLocale	13
+#define MODULE_libmemusage	15
+#define MODULE_libresolv	16
+#define MODULE_libnss_db	17
+#define MODULE_libnss_files	18
+#define	MODULE_libnss_dns	19
+#define MODULE_libnss_compat	20
+#define MODULE_libnss_hesiod	21
+#define MODULE_libnss_nis	22
+#define MODULE_libnss_nisplus	23
+#define MODULE_libanl		24
+#define MODULE_librt		25
+#define MODULE_libSegFault	26
+#define MODULE_libthread_db	27
+#define MODULE_libcidn		28
+#define MODULE_libcrypt		29
+#define MODULE_libnsl		30
+#define MODULE_libpcprofile	31
+#define MODULE_librpcsvc	32
+#define MODULE_nscd		33
+#define MODULE_ldconfig 	34
+#define MODULE_libnldbl 	35
+
+/* Catch-all for test modules and other binaries.  */
+#define MODULE_nonlib		98
+#define MODULE_extramodules	99
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index d4ab1f3..131d7eb 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -20,6 +20,10 @@
 #ifndef _LIBC_SYMBOLS_H
 #define _LIBC_SYMBOLS_H	1
 
+#include "libc-modules.h"
+
+#define IS_IN(lib) (IN_MODULE == MODULE_##lib)
+
 /* This file's macros are included implicitly in the compilation of every
    file in the C library by -imacros.
 
@@ -468,7 +472,7 @@ for linking")
    If the function should be internal to multiple objects, say ld.so and
    libc.so, the best way is to use:
 
-   #if !defined NOT_IN_libc || defined IS_IN_rtld
+   #if IS_IN (libc) || IS_IN (rtld)
    hidden_proto (foo)
    #endif
 
@@ -584,7 +588,7 @@ for linking")
 # define libc_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
 # define rtld_hidden_def(name) hidden_def (name)
@@ -604,7 +608,7 @@ for linking")
 # define rtld_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libm_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
 # define libm_hidden_def(name) hidden_def (name)
@@ -624,7 +628,7 @@ for linking")
 # define libm_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libresolv
+#if IS_IN (libresolv)
 # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libresolv_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -645,7 +649,7 @@ for linking")
 # define libresolv_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_librt
+#if IS_IN (librt)
 # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define librt_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -666,7 +670,7 @@ for linking")
 # define librt_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libdl
+#if IS_IN (libdl)
 # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libdl_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -687,7 +691,7 @@ for linking")
 # define libdl_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libnss_files
+#if IS_IN (libnss_files)
 # define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libnss_files_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -708,7 +712,7 @@ for linking")
 # define libnss_files_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libnsl
+#if IS_IN (libnsl)
 # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libnsl_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -729,7 +733,7 @@ for linking")
 # define libnsl_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libnss_nisplus
+#if IS_IN (libnss_nisplus)
 # define libnss_nisplus_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libnss_nisplus_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -758,7 +762,7 @@ for linking")
 # define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name)
 #endif
 
-#ifdef IS_IN_libutil
+#if IS_IN (libutil)
 # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libutil_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
diff --git a/libidn/Makefile b/libidn/Makefile
index a40f08e..3c07838 100644
--- a/libidn/Makefile
+++ b/libidn/Makefile
@@ -32,3 +32,8 @@ libcidn-routines := punycode toutf8 nfkc stringprep rfc3454 profiles idna \
 libcidn-inhibit-o = $(filter-out .os,$(object-suffixes))
 
 include $(..)Rules
+#
+# Set libof-* for each routine.
+cpp-srcs-left := $(libcidn-routines)
+lib := libcidn
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
diff --git a/locale/Makefile b/locale/Makefile
index e4c3878..4c22c74 100644
--- a/locale/Makefile
+++ b/locale/Makefile
@@ -85,7 +85,7 @@ locale-CPPFLAGS = -DLOCALEDIR='"$(localedir)"' \
 		  -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \
 		  -Iprograms
 
-CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
+CPPFLAGS-locale_programs = -DLOCALE_PATH='$(localepath)' \
 			   -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
 			   -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
 			   -DLOCSRCDIR='"$(i18ndir)/locales"' \
@@ -96,7 +96,12 @@ CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-charmap-dir.c = -Wno-write-strings
 
 # This makes sure -DNOT_IN_libc et al are passed for all these modules.
-cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \
-				$(locale-modules) $(lib-modules))
-lib := locale-programs
+cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
+		 $(lib-modules)
+lib := locale_programs
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
+# Set libof-* for each routine.
+cpp-srcs-left := $(libBrokenLocale-routines)
+lib := libBrokenLocale
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
diff --git a/login/Makefile b/login/Makefile
index d758ac5..dbfa574 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -53,6 +53,10 @@ libutil-routines:= login login_tty logout logwtmp openpty forkpty
 
 include ../Rules
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(libutil-routines)
+lib := libutil
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 CFLAGS-getpt.c = -fexceptions
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
diff --git a/mach/Machrules b/mach/Machrules
index 8b35cf6..8ac0676 100644
--- a/mach/Machrules
+++ b/mach/Machrules
@@ -225,7 +225,12 @@ $(interface-library)-routines = $(interface-routines)
 extra-libs += $(interface-library)
 extra-libs-others += $(interface-library)
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(interface-routines)
+lib := $(interface-library)
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 ifeq (yes,$(build-shared))
+
 interface.so = $(interface-library:=.so)
 
 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
diff --git a/malloc/Makefile b/malloc/Makefile
index 9e93523..10a53f6 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -89,6 +89,11 @@ endif
 do-memusagestat: $(objpfx)memusagestat
 
 memusagestat-modules = memusagestat
+
+cpp-srcs-left := $(memusagestat-modules)
+lib := memusagestat
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 $(objpfx)memusagestat: $(memusagestat-modules:%=$(objpfx)%.o)
 	$(LINK.o) -o $@ $^ $(libgd-LDFLAGS) -lgd -lpng -lz -lm
 
@@ -102,6 +107,10 @@ endif
 
 include ../Rules
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(libmemusage-routines)
+lib := libmemusage
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 CFLAGS-mcheck-init.c = $(PIC-ccflag)
 CFLAGS-obstack.c = $(uses-callbacks)
 
diff --git a/math/Makefile b/math/Makefile
index 866bc0f..c900717 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -154,6 +154,10 @@ extra-objs += libieee.a ieee-math.o
 
 include ../Rules
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(libm-routines)
+lib := libm
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 ifneq (no,$(PERL))
 # Run the math programs to automatically generate ULPs files.
 .PHONY: regen-ulps
diff --git a/nis/Makefile b/nis/Makefile
index 7688604..463cc6c 100644
--- a/nis/Makefile
+++ b/nis/Makefile
@@ -70,6 +70,18 @@ libnss_nisplus-inhibit-o = $(filter-out .os,$(object-suffixes))
 
 include ../Rules
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(libnsl-routines)
+lib := libnsl
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
+cpp-srcs-left := $(libnss_nisplus-routines)
+lib := libnss_nisplus
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
+cpp-srcs-left := $(libnss_nis-routines)
+lib := libnss_nis
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
 $(objpfx)libnss_compat.so: $(objpfx)libnsl.so$(libnsl.so-version)
 $(objpfx)libnss_nis.so: $(objpfx)libnsl.so$(libnsl.so-version) \
diff --git a/nptl/Makefile b/nptl/Makefile
index 157fe62..ba555c9 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -384,6 +384,11 @@ endif
 
 include ../Rules
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(libpthread-routines)
+lib := libpthread
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 ifeq (yes,$(build-shared))
 # Make sure these things are built in the `make lib' pass so they can be used
 # to run programs during the `make others' pass.
diff --git a/nptl_db/Makefile b/nptl_db/Makefile
index ff873ca..0f90b5e 100644
--- a/nptl_db/Makefile
+++ b/nptl_db/Makefile
@@ -55,6 +55,10 @@ tests-special += $(objpfx)db-symbols.out
 
 include ../Rules
 
+cpp-srcs-left := $(libthread_db-routines)
+lib := libthread_db
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 $(objpfx)db-symbols.out: $(objpfx)db-symbols.v.i \
 			 $(common-objpfx)nptl/libpthread.so
 	LC_ALL=C $(READELF) -W -s $(filter %.so,$^) | $(AWK) -f $< > $@; \
diff --git a/nscd/Makefile b/nscd/Makefile
index 639d87b..7ab4e9d 100644
--- a/nscd/Makefile
+++ b/nscd/Makefile
@@ -79,23 +79,22 @@ CFLAGS-nscd_gethst_r.c = -fexceptions
 CFLAGS-nscd_getai.c = -fexceptions
 CFLAGS-nscd_initgroups.c = -fexceptions
 
-CPPFLAGS-nonlib += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2
+CPPFLAGS-nscd += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2 -DNOT_IN_libc=1
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
-CFLAGS-nonlib += $(pie-ccflag)
+CFLAGS-nscd += $(pie-ccflag)
 endif
 ifeq (yes,$(have-ssp))
-CFLAGS-nonlib += -fstack-protector
+CFLAGS-nscd += -fstack-protector
 endif
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
 LDFLAGS-nscd = -Wl,-z,now
 endif
 
-# This makes sure CPPFLAGS-nonlib and CFLAGS-nonlib are passed
-# for all these modules.
-cpp-srcs-left := $(nscd-modules:=.c)
-lib := nonlib
+# Set libof-nscd.
+cpp-srcs-left := $(nscd-modules)
+lib := nscd
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
 $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
diff --git a/nss/Makefile b/nss/Makefile
index 1fa7f1f..41d685c 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -80,6 +80,16 @@ endif
 
 include ../Rules
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(libnss_files-routines)
+lib := libnss_files
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
+cpp-srcs-left := $(libnss_db-routines)
+lib := libnss_db
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
+
 ifeq (yes,$(have-selinux))
 LDLIBS-makedb		:= -lselinux
 endif
@@ -105,7 +115,8 @@ $(objpfx)makedb: $(makedb-modules:%=$(objpfx)%.o)
 $(inst_vardbdir)/Makefile: db-Makefile $(+force)
 	$(do-install)
 
-CFLAGS-nss_test1.c = -DNOT_IN_libc=1
+libof-nss_test1 = extramodules
+CPPFLAGS-nss_test1 = -DNOT_IN_libc=1
 $(objpfx)/libnss_test1.so: $(objpfx)nss_test1.os $(link-libc-deps)
 	$(build-module)
 ifdef libnss_test1.so-version
diff --git a/resolv/Makefile b/resolv/Makefile
index 22575e5..ae78d3c 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -82,6 +82,14 @@ CPPFLAGS += -Dgethostbyname=res_gethostbyname \
 	    -Dgetnetbyname=res_getnetbyname \
 	    -Dgetnetbyaddr=res_getnetbyaddr
 
+cpp-srcs-left := $(libresolv-routines)
+lib := libresolv
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
+cpp-srcs-left := $(libnss_dns-routines)
+lib := libnss_dns
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 ifeq (yes,$(have-ssp))
 CFLAGS-libresolv += -fstack-protector
 endif
diff --git a/rt/Makefile b/rt/Makefile
index 875deb3..fd3d9f0 100644
--- a/rt/Makefile
+++ b/rt/Makefile
@@ -60,6 +60,10 @@ extra-libs-others := $(extra-libs)
 
 include ../Rules
 
+cpp-srcs-left := $(librt-routines)
+lib := librt
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 CFLAGS-aio_suspend.c = -fexceptions
 CFLAGS-clock_nanosleep.c = -fexceptions -fasynchronous-unwind-tables
 CFLAGS-librt-cancellation.c = -fasynchronous-unwind-tables
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 9b2271b..da6e076 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -145,6 +145,7 @@ LDFLAGS-tst-putenv = $(no-as-needed)
 
 $(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os $(link-libc-deps)
 	$(build-module)
+libof-tst-putenvmod = extramodules
 CFLAGS-tst-putenvmod.c = -DNOT_IN_libc=1
 
 $(objpfx)bug-getcontext: $(libm)
diff --git a/sunrpc/Makefile b/sunrpc/Makefile
index a2722af..f64a554 100644
--- a/sunrpc/Makefile
+++ b/sunrpc/Makefile
@@ -117,6 +117,10 @@ endif
 
 include ../Rules
 
+cpp-srcs-left := $(librpcsvc-routines)
+lib := librpcsvc
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 ifeq (yes,$(build-shared))
 subdir_lib: $(objpfx)librpc_compat_pic.a
 $(objpfx)librpc_compat_pic.a: $(rpc-compat-routines.os)
diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
index c05708d..b5b2cf0 100644
--- a/sysdeps/gnu/Makefile
+++ b/sysdeps/gnu/Makefile
@@ -29,6 +29,8 @@ ifeq ($(subdir),stdio-common)
 
 errlist-c = $(firstword $(wildcard $(addsuffix /errlist.c,$(sysdirs) .)))
 
+libof-errlist-compat = extramodules
+
 ifeq ($(build-shared),yes)
 $(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \
 			   $(common-objpfx)Versions.v.i $(before-compile)
diff --git a/sysdeps/ieee754/ldbl-opt/Makefile b/sysdeps/ieee754/ldbl-opt/Makefile
index 222122d..6d612f6 100644
--- a/sysdeps/ieee754/ldbl-opt/Makefile
+++ b/sysdeps/ieee754/ldbl-opt/Makefile
@@ -145,4 +145,8 @@ CFLAGS-nldbl-y0.c = -fno-builtin-y0l
 CFLAGS-nldbl-y1.c = -fno-builtin-y1l
 CFLAGS-nldbl-yn.c = -fno-builtin-ynl
 
+cpp-srcs-left := $(libnldbl-routines)
+lib := libnldbl
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 endif
diff --git a/sysdeps/s390/s390-64/Makefile b/sysdeps/s390/s390-64/Makefile
index fe5030e..ce4f0c5 100644
--- a/sysdeps/s390/s390-64/Makefile
+++ b/sysdeps/s390/s390-64/Makefile
@@ -28,6 +28,10 @@ s390x-iconv-modules = ISO-8859-1_CP037_Z900 UTF8_UTF16_Z9 UTF16_UTF32_Z9 UTF8_UT
 extra-modules-left += $(s390x-iconv-modules)
 include extra-module.mk
 
+cpp-srcs-left := $(foreach mod,$(s390x-iconv-modules),$($(mod)-routines))
+lib := iconvdata
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 extra-objs      += $(addsuffix .so, $(s390x-iconv-modules))
 install-others  += $(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules))
 
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 9ad6d22..2d6d8bb 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -178,6 +178,7 @@ ifeq ($(subdir),elf)
 sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \
 			dl-fxstatat64
 
+libof-lddlibc4 = lddlibc4
 CPPFLAGS-lddlibc4 += -DNOT_IN_libc
 
 others += pldd
-- 
1.9.3

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

* [PATCH 19/19] Define NOT_IN when building outside glibc.
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (14 preceding siblings ...)
  2014-08-21 10:58 ` [PATCH 14/19] Remove IS_IN_rtld Siddhesh Poyarekar
@ 2014-08-21 11:17 ` Siddhesh Poyarekar
  2014-08-22 13:51   ` Richard Henderson
  2014-08-21 11:37 ` [PATCH 07/19] Remove IS_IN_libc Siddhesh Poyarekar
                   ` (4 subsequent siblings)
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 11:17 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

       * nptl_db/structs.def [!_LIBC]: Define NOT_IN.
---
 nptl_db/structs.def | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/nptl_db/structs.def b/nptl_db/structs.def
index ea8b7ac..82e7157 100644
--- a/nptl_db/structs.def
+++ b/nptl_db/structs.def
@@ -16,6 +16,10 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifndef _LIBC
+# define NOT_IN(lib) (0)
+#endif
+
 #ifndef DB_STRUCT_ARRAY_FIELD
 # define DB_STRUCT_ARRAY_FIELD(type, field) DB_STRUCT_FIELD (type, field)
 # define DB_ARRAY_VARIABLE(name) DB_VARIABLE (name)
-- 
1.9.3

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

* [PATCH 07/19] Remove IS_IN_libc
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (15 preceding siblings ...)
  2014-08-21 11:17 ` [PATCH 19/19] Define NOT_IN when building outside glibc Siddhesh Poyarekar
@ 2014-08-21 11:37 ` Siddhesh Poyarekar
  2014-08-22 18:29   ` Roland McGrath
  2014-08-21 11:52 ` [PATCH 18/19] Define new macro NOT_IN Siddhesh Poyarekar
                   ` (3 subsequent siblings)
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 11:37 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Replace it with IS_IN_MODULE (libc) and remove the one place that it
is defined in.  The generated code remains unchanged on x86_64.

	* include/shlib-compat.h [!NOT_IN_libc]: Remove.
	* nss/nss_files/files-parse.c (IS_IN_libc): Replace with
	IS_IN (libc).
---
 include/shlib-compat.h      | 4 ----
 nss/nss_files/files-parse.c | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/include/shlib-compat.h b/include/shlib-compat.h
index 30804d3..062da8d 100644
--- a/include/shlib-compat.h
+++ b/include/shlib-compat.h
@@ -45,10 +45,6 @@
    && (!(ABI_##lib##_##obsoleted - 0)					      \
        || ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0))))
 
-# ifndef NOT_IN_libc
-#  define IS_IN_libc 1
-# endif
-
 /* That header also defines symbols like `VERSION_libm_GLIBC_2_1' to
    the version set name to use for e.g. symbols first introduced into
    libm in the GLIBC_2.1 version.  Definitions of symbols with explicit
diff --git a/nss/nss_files/files-parse.c b/nss/nss_files/files-parse.c
index 1da1a6f..42fd1f3 100644
--- a/nss/nss_files/files-parse.c
+++ b/nss/nss_files/files-parse.c
@@ -73,7 +73,7 @@ struct parser_data
 /* Export the line parser function so it can be used in nss_db.  */
 # define parser_stclass /* Global */
 # define parse_line CONCAT(_nss_files_parse_,ENTNAME)
-# ifdef IS_IN_libc
+# if IS_IN (libc)
 /* We are defining one of the functions that actually lives in libc
    because it is used to implement fget*ent and suchlike.  */
 #  define nss_files_parse_hidden_def(name) libc_hidden_def (name)
-- 
1.9.3

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

* [PATCH 15/19] Remove last place for definition of IS_IN_* macros
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (17 preceding siblings ...)
  2014-08-21 11:52 ` [PATCH 18/19] Define new macro NOT_IN Siddhesh Poyarekar
@ 2014-08-21 11:52 ` Siddhesh Poyarekar
  2014-08-22 19:34   ` Roland McGrath
  2014-08-22  4:57 ` [all-arch][PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
  2014-11-05 11:07 ` [PING] " Siddhesh Poyarekar
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 11:52 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Ignoring IS_IN_build, which has a different purpose altogether, this
patch removes the last bit of IS_IN_* macro definitions.  Now barring
NOT_IN_libc, all cases use the IN_MODULE scheme.

Generated code unchanged on x86_64.

	* extra-lib.mk (CPPFLAGS-$(lib)): Remove IS_IN_$(lib).
---
 extra-lib.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/extra-lib.mk b/extra-lib.mk
index c719bd9..7cdf823 100644
--- a/extra-lib.mk
+++ b/extra-lib.mk
@@ -106,4 +106,4 @@ ifneq (,$(cpp-srcs-left))
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 endif
 
-CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1
+CPPFLAGS-$(lib) := -DNOT_IN_libc=1
-- 
1.9.3

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

* [PATCH 18/19] Define new macro NOT_IN
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (16 preceding siblings ...)
  2014-08-21 11:37 ` [PATCH 07/19] Remove IS_IN_libc Siddhesh Poyarekar
@ 2014-08-21 11:52 ` Siddhesh Poyarekar
  2014-08-22 19:39   ` Roland McGrath
  2014-08-21 11:52 ` [PATCH 15/19] Remove last place for definition of IS_IN_* macros Siddhesh Poyarekar
                   ` (2 subsequent siblings)
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 11:52 UTC (permalink / raw)
  To: libc-alpha; +Cc: Siddhesh Poyarekar

Define a simple macro which is a negation of IS_IN to make the macro
conditions a bit more readable.

	* include/libc-symbols.h (NOT_IN): New macro.
	* include/bits/stdlib-float.h: Use it.
	* intl/l10nflist.c: Likewise.
	* nptl/pthreadP.h: Likewise.
	* nptl_db/structs.def: Likewise.
	* sysdeps/arm/aeabi_unwind_cpp_pr1.c: Likewise.
	* sysdeps/arm/memmove.S: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_isinfl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_isnanl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_isinfl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_isnanl.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/s_isinf.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/s_isnan.c: Likewise.
	* sysdeps/nptl/bits/libc-lock.h: Likewise.
	* sysdeps/nptl/bits/libc-lockP.h: Likewise.
	* sysdeps/posix/profil.c: Likewise.
	* sysdeps/powerpc/powerpc32/__longjmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/bsd-_setjmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/fpu/__longjmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc32/fpu/setjmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h: Likewise.
	* sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc32/power6/memset.S: Likewise.
	* sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S: Likewise.
	* sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc32/setjmp.S: Likewise.
	* sysdeps/powerpc/powerpc64/__longjmp-common.S: Likewise.
	* sysdeps/powerpc/powerpc64/__longjmp.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S: Likewise.
	* sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S: Likewise.
	* sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc64/setjmp-common.S: Likewise.
	* sysdeps/powerpc/powerpc64/setjmp.S: Likewise.
	* sysdeps/s390/dl-tls.h: Likewise.
	* sysdeps/s390/s390-32/multiarch/memcmp.S: Likewise.
	* sysdeps/s390/s390-32/multiarch/memcpy.S: Likewise.
	* sysdeps/s390/s390-32/multiarch/memset.S: Likewise.
	* sysdeps/s390/s390-32/setjmp.S: Likewise.
	* sysdeps/s390/s390-64/multiarch/memcmp.S: Likewise.
	* sysdeps/s390/s390-64/multiarch/memcpy.S: Likewise.
	* sysdeps/s390/s390-64/multiarch/memset.S: Likewise.
	* sysdeps/s390/s390-64/setjmp.S: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S: Likewise.
	* sysdeps/unix/arm/sysdep.S: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/getpid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
	* sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
	* sysdeps/x86_64/strcmp.S: Likewise.
---
 include/bits/stdlib-float.h                              |  2 +-
 include/libc-symbols.h                                   |  1 +
 intl/l10nflist.c                                         |  2 +-
 nptl/pthreadP.h                                          |  2 +-
 nptl_db/structs.def                                      |  2 +-
 sysdeps/arm/aeabi_unwind_cpp_pr1.c                       |  6 +++---
 sysdeps/arm/memmove.S                                    |  2 +-
 sysdeps/ieee754/ldbl-128ibm/s_isinfl.c                   |  2 +-
 sysdeps/ieee754/ldbl-128ibm/s_isnanl.c                   |  2 +-
 sysdeps/ieee754/ldbl-64-128/s_isinfl.c                   |  4 ++--
 sysdeps/ieee754/ldbl-64-128/s_isnanl.c                   |  4 ++--
 sysdeps/ieee754/ldbl-opt/s_isinf.c                       |  2 +-
 sysdeps/ieee754/ldbl-opt/s_isnan.c                       |  2 +-
 sysdeps/nptl/bits/libc-lock.h                            |  2 +-
 sysdeps/nptl/bits/libc-lockP.h                           |  2 +-
 sysdeps/posix/profil.c                                   |  2 +-
 sysdeps/powerpc/powerpc32/__longjmp.S                    |  2 +-
 sysdeps/powerpc/powerpc32/bsd-_setjmp.S                  |  2 +-
 sysdeps/powerpc/powerpc32/fpu/__longjmp.S                |  2 +-
 sysdeps/powerpc/powerpc32/fpu/s_isnan.S                  |  2 +-
 sysdeps/powerpc/powerpc32/fpu/setjmp.S                   |  2 +-
 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c |  2 +-
 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c |  2 +-
 sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h   |  2 +-
 sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S           |  2 +-
 sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S           |  2 +-
 sysdeps/powerpc/powerpc32/power6/memset.S                |  2 +-
 sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S           |  2 +-
 sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S           |  2 +-
 sysdeps/powerpc/powerpc32/setjmp.S                       |  2 +-
 sysdeps/powerpc/powerpc64/__longjmp-common.S             |  2 +-
 sysdeps/powerpc/powerpc64/__longjmp.S                    |  2 +-
 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c        |  2 +-
 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c        |  2 +-
 sysdeps/powerpc/powerpc64/fpu/s_isnan.S                  |  2 +-
 sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S           |  2 +-
 sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S           |  2 +-
 sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S          |  2 +-
 sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S           |  2 +-
 sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S           |  2 +-
 sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S           |  2 +-
 sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S           |  2 +-
 sysdeps/powerpc/powerpc64/setjmp-common.S                |  4 ++--
 sysdeps/powerpc/powerpc64/setjmp.S                       |  2 +-
 sysdeps/s390/dl-tls.h                                    |  2 +-
 sysdeps/s390/s390-32/multiarch/memcmp.S                  |  2 +-
 sysdeps/s390/s390-32/multiarch/memcpy.S                  |  2 +-
 sysdeps/s390/s390-32/multiarch/memset.S                  |  2 +-
 sysdeps/s390/s390-32/setjmp.S                            |  8 ++++----
 sysdeps/s390/s390-64/multiarch/memcmp.S                  |  2 +-
 sysdeps/s390/s390-64/multiarch/memcpy.S                  |  2 +-
 sysdeps/s390/s390-64/multiarch/memset.S                  |  2 +-
 sysdeps/s390/s390-64/setjmp.S                            |  8 ++++----
 sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S              |  2 +-
 sysdeps/unix/arm/sysdep.S                                |  2 +-
 sysdeps/unix/sysv/linux/aarch64/sysdep.h                 |  2 +-
 sysdeps/unix/sysv/linux/arm/sysdep.h                     |  2 +-
 sysdeps/unix/sysv/linux/getpid.c                         |  2 +-
 sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S         |  4 ++--
 sysdeps/unix/sysv/linux/i386/lowlevellock.h              |  6 +++---
 sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h            |  4 ++--
 sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h       |  2 +-
 sysdeps/unix/sysv/linux/sh/lowlevellock.S                |  4 ++--
 sysdeps/unix/sysv/linux/x86_64/lowlevellock.S            |  4 ++--
 sysdeps/unix/sysv/linux/x86_64/lowlevellock.h            |  6 +++---
 sysdeps/x86_64/strcmp.S                                  | 12 ++++++------
 66 files changed, 90 insertions(+), 89 deletions(-)

diff --git a/include/bits/stdlib-float.h b/include/bits/stdlib-float.h
index 3466314..8f7e683 100644
--- a/include/bits/stdlib-float.h
+++ b/include/bits/stdlib-float.h
@@ -1,4 +1,4 @@
 /* No floating-point inline functions in rtld.  */
-#if !IS_IN (rtld)
+#if NOT_IN (rtld)
 # include <stdlib/bits/stdlib-float.h>
 #endif
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 5eb9e83..0081301 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -23,6 +23,7 @@
 #include "libc-modules.h"
 
 #define IS_IN(lib) (IN_MODULE == MODULE_##lib)
+#define NOT_IN(lib) !IS_IN (lib)
 
 /* Returns true if the current module is a versioned library.  Versioned
    library names are culled from shlib-versions files are assigned a MODULE_*
diff --git a/intl/l10nflist.c b/intl/l10nflist.c
index ca04ad3..6f7ab7f 100644
--- a/intl/l10nflist.c
+++ b/intl/l10nflist.c
@@ -324,7 +324,7 @@ _nl_normalize_codeset (codeset, name_len)
   char *retval;
   char *wp;
   size_t cnt;
-#if !IS_IN (libc)
+#if NOT_IN (libc)
   locale_t locale = newlocale (0, "C", NULL);
 #else
 # define locale _nl_C_locobj_ptr
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index a8d5fb4..73f6c26 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -238,7 +238,7 @@ extern int __pthread_debug attribute_hidden;
 
 extern void __pthread_unwind (__pthread_unwind_buf_t *__buf)
      __cleanup_fct_attribute __attribute ((__noreturn__))
-#if !defined SHARED && !IS_IN (libpthread)
+#if !defined SHARED && NOT_IN (libpthread)
      weak_function
 #endif
      ;
diff --git a/nptl_db/structs.def b/nptl_db/structs.def
index 5b905e2..ea8b7ac 100644
--- a/nptl_db/structs.def
+++ b/nptl_db/structs.def
@@ -74,7 +74,7 @@ DB_STRUCT_FIELD (link_map, l_tls_modid)
 DB_STRUCT_ARRAY_FIELD (dtv, dtv)
 #define pointer_val pointer.val /* Field of anonymous struct in dtv_t.  */
 DB_STRUCT_FIELD (dtv_t, pointer_val)
-#if !IS_IN (libpthread) || TLS_TCB_AT_TP
+#if NOT_IN (libpthread) || TLS_TCB_AT_TP
 DB_STRUCT_FIELD (pthread, dtvp)
 #endif
 
diff --git a/sysdeps/arm/aeabi_unwind_cpp_pr1.c b/sysdeps/arm/aeabi_unwind_cpp_pr1.c
index fa7e960..929379b 100644
--- a/sysdeps/arm/aeabi_unwind_cpp_pr1.c
+++ b/sysdeps/arm/aeabi_unwind_cpp_pr1.c
@@ -27,7 +27,7 @@ attribute_hidden
 void
 __aeabi_unwind_cpp_pr0 (void)
 {
-#if !IS_IN (rtld)
+#if NOT_IN (rtld)
   abort ();
 #endif
 }
@@ -36,7 +36,7 @@ attribute_hidden
 void
 __aeabi_unwind_cpp_pr1 (void)
 {
-#if !IS_IN (rtld)
+#if NOT_IN (rtld)
   abort ();
 #endif
 }
@@ -45,7 +45,7 @@ attribute_hidden
 void
 __aeabi_unwind_cpp_pr2 (void)
 {
-#if !IS_IN (rtld)
+#if NOT_IN (rtld)
   abort ();
 #endif
 }
diff --git a/sysdeps/arm/memmove.S b/sysdeps/arm/memmove.S
index 488e156..6032e51 100644
--- a/sysdeps/arm/memmove.S
+++ b/sysdeps/arm/memmove.S
@@ -69,7 +69,7 @@ ENTRY(memmove)
 
 		subs	ip, r0, r1
 		cmphi	r2, ip
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 		bls	memcpy
 #else
 		bls	HIDDEN_JUMPTARGET(memcpy)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_isinfl.c b/sysdeps/ieee754/ldbl-128ibm/s_isinfl.c
index 730aa4d..7fc3585 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_isinfl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_isinfl.c
@@ -33,7 +33,7 @@ ___isinfl (long double x)
   return ~mask & (hx >> 62);
 }
 hidden_ver (___isinfl, __isinfl)
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 weak_alias (___isinfl, ____isinfl)
 long_double_symbol (libc, ___isinfl, isinfl);
 long_double_symbol (libc, ____isinfl, __isinfl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c b/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c
index 9980875..3eab03f 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c
@@ -39,7 +39,7 @@ ___isnanl (long double x)
   return (int) (hx >> 63);
 }
 hidden_ver (___isnanl, __isnanl)
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 weak_alias (___isnanl, ____isnanl)
 long_double_symbol (libc, ___isnanl, isnanl);
 long_double_symbol (libc, ____isnanl, __isnanl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_isinfl.c b/sysdeps/ieee754/ldbl-64-128/s_isinfl.c
index 6dab0e9..b36cd1b 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_isinfl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_isinfl.c
@@ -1,5 +1,5 @@
 #include <math_ldbl_opt.h>
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # undef weak_alias
 # define weak_alias(n,a)
 # undef hidden_def
@@ -7,7 +7,7 @@
 # define __isinfl(arg) ___isinfl(arg)
 #endif
 #include <sysdeps/ieee754/ldbl-128/s_isinfl.c>
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # undef __isinfl
 hidden_ver (___isinfl, __isinfl)
 _weak_alias (___isinfl, ____isinfl)
diff --git a/sysdeps/ieee754/ldbl-64-128/s_isnanl.c b/sysdeps/ieee754/ldbl-64-128/s_isnanl.c
index ad5ecc5..9a2c023 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_isnanl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_isnanl.c
@@ -1,5 +1,5 @@
 #include <math_ldbl_opt.h>
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # undef weak_alias
 # define weak_alias(n,a)
 # undef hidden_def
@@ -7,7 +7,7 @@
 # define __isnanl(arg) ___isnanl(arg)
 #endif
 #include <sysdeps/ieee754/ldbl-128/s_isnanl.c>
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # undef __isnanl
 hidden_ver (___isnanl, __isnanl)
 _weak_alias (___isnanl, ____isnanl)
diff --git a/sysdeps/ieee754/ldbl-opt/s_isinf.c b/sysdeps/ieee754/ldbl-opt/s_isinf.c
index 1f760a0..f3db150 100644
--- a/sysdeps/ieee754/ldbl-opt/s_isinf.c
+++ b/sysdeps/ieee754/ldbl-opt/s_isinf.c
@@ -1,6 +1,6 @@
 #include <math_ldbl_opt.h>
 #include <sysdeps/ieee754/dbl-64/s_isinf.c>
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
 compat_symbol (libc, isinf, isinfl, GLIBC_2_0);
diff --git a/sysdeps/ieee754/ldbl-opt/s_isnan.c b/sysdeps/ieee754/ldbl-opt/s_isnan.c
index 33f57f1..5f6d7b4 100644
--- a/sysdeps/ieee754/ldbl-opt/s_isnan.c
+++ b/sysdeps/ieee754/ldbl-opt/s_isnan.c
@@ -1,6 +1,6 @@
 #include <math_ldbl_opt.h>
 #include <sysdeps/ieee754/dbl-64/s_isnan.c>
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/nptl/bits/libc-lock.h b/sysdeps/nptl/bits/libc-lock.h
index 7500790..eeb0331 100644
--- a/sysdeps/nptl/bits/libc-lock.h
+++ b/sysdeps/nptl/bits/libc-lock.h
@@ -26,7 +26,7 @@
 
 /* Mutex type.  */
 #if defined _LIBC || defined _IO_MTSAFE_IO
-# if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC
+# if (NOT_IN (libc) && NOT_IN (libpthread)) || !defined _LIBC
 typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
 # else
 typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t;
diff --git a/sysdeps/nptl/bits/libc-lockP.h b/sysdeps/nptl/bits/libc-lockP.h
index f6495b6..b0f0b4a 100644
--- a/sysdeps/nptl/bits/libc-lockP.h
+++ b/sysdeps/nptl/bits/libc-lockP.h
@@ -35,7 +35,7 @@
 #include <pthread-functions.h>
 
 /* Mutex type.  */
-#if !IS_IN (libc) && !IS_IN (libpthread)
+#if NOT_IN (libc) && NOT_IN (libpthread)
 typedef pthread_mutex_t __libc_lock_t;
 #else
 typedef int __libc_lock_t;
diff --git a/sysdeps/posix/profil.c b/sysdeps/posix/profil.c
index 54ace22..f3b6212 100644
--- a/sysdeps/posix/profil.c
+++ b/sysdeps/posix/profil.c
@@ -64,7 +64,7 @@ __profil (u_short *sample_buffer, size_t size, size_t offset, u_int scale)
 {
   struct sigaction act;
   struct itimerval timer;
-#if !IS_IN (rtld)
+#if NOT_IN (rtld)
   static struct sigaction oact;
   static struct itimerval otimer;
 # define oact_ptr &oact
diff --git a/sysdeps/powerpc/powerpc32/__longjmp.S b/sysdeps/powerpc/powerpc32/__longjmp.S
index 9a83369..1c993e4 100644
--- a/sysdeps/powerpc/powerpc32/__longjmp.S
+++ b/sysdeps/powerpc/powerpc32/__longjmp.S
@@ -19,7 +19,7 @@
 #include <libc-symbols.h>
 #include <shlib-compat.h>
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 /* Build a non-versioned object for rtld-*.  */
 # define __longjmp_symbol __longjmp
 # include "__longjmp-common.S"
diff --git a/sysdeps/powerpc/powerpc32/bsd-_setjmp.S b/sysdeps/powerpc/powerpc32/bsd-_setjmp.S
index b952170..27cb7ba 100644
--- a/sysdeps/powerpc/powerpc32/bsd-_setjmp.S
+++ b/sysdeps/powerpc/powerpc32/bsd-_setjmp.S
@@ -19,7 +19,7 @@
 #include <libc-symbols.h>
 #include <sysdep.h>
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 /* Build a non-versioned object for rtld-*.  */
 ENTRY (_setjmp)
 	li r4,0			/* Set second argument to 0.  */
diff --git a/sysdeps/powerpc/powerpc32/fpu/__longjmp.S b/sysdeps/powerpc/powerpc32/fpu/__longjmp.S
index e68eb73..a45fbde 100644
--- a/sysdeps/powerpc/powerpc32/fpu/__longjmp.S
+++ b/sysdeps/powerpc/powerpc32/fpu/__longjmp.S
@@ -20,7 +20,7 @@
 #include <rtld-global-offsets.h>
 #include <shlib-compat.h>
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 /* Build a non-versioned object for rtld-*.  */
 # define __longjmp_symbol __longjmp
 # include "__longjmp-common.S"
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/fpu/s_isnan.S
index caa85e9..e95600c 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_isnan.S
@@ -48,7 +48,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc32/fpu/setjmp.S b/sysdeps/powerpc/powerpc32/fpu/setjmp.S
index 169704f..43fda46 100644
--- a/sysdeps/powerpc/powerpc32/fpu/setjmp.S
+++ b/sysdeps/powerpc/powerpc32/fpu/setjmp.S
@@ -20,7 +20,7 @@
 #include <rtld-global-offsets.h>
 #include <shlib-compat.h>
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 /* Build a non-versioned object for rtld-*.  */
 # define __sigsetjmp_symbol __sigsetjmp
 # define __sigjmp_save_symbol __sigjmp_save
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c
index ba57a25..e6468e6 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c
@@ -36,7 +36,7 @@ strong_alias (__isinf, __isinfl)
 weak_alias (__isinf, isinfl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
 compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
 compat_symbol (libc, isinf, isinfl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c
index f182d50..37dbc59 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c
@@ -42,7 +42,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h b/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
index ca479d8..96e6b5e 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
@@ -21,7 +21,7 @@
    the dl_hwcap field. The assembly is to make the compiler not optimize the
    test (&_rtld_global_ro != NULL), which is always true in ISO C (but not
    in that case since _rtld_global_ro might not been realocated yet).  */
-#if defined(SHARED) && !IS_IN (rtld)
+#if defined(SHARED) && NOT_IN (rtld)
 # define __GLRO(value) \
   ({ volatile void **__p = (volatile void**)(&_rtld_global_ro);	\
     unsigned long int __ret;					\
diff --git a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
index e91c567..a58fa53 100644
--- a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
@@ -52,7 +52,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
index 461ae0d..ec33bbe 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
@@ -52,7 +52,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc32/power6/memset.S b/sysdeps/powerpc/powerpc32/power6/memset.S
index 811a7ef..64f1f00 100644
--- a/sysdeps/powerpc/powerpc32/power6/memset.S
+++ b/sysdeps/powerpc/powerpc32/power6/memset.S
@@ -236,7 +236,7 @@ L(nzCacheAligned128):
 L(nzCacheAligned256):
 	cmplwi	cr1,rLEN,256
 	addi	rMEMP3,rMEMP,64
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 /* When we are not in libc we should use only GPRs to avoid the FPU lock
    interrupt.  */
 	stw	rCHR,0(rMEMP)
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S
index f9d5ca1..6ca3f1c 100644
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S
+++ b/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S
@@ -77,7 +77,7 @@ strong_alias (__isinf, __isinfl)
 weak_alias (__isinf, isinfl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
 compat_symbol (libc, isinf, isinfl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
index 6aa9e11..a8a8b3c 100644
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
@@ -82,7 +82,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc32/setjmp.S b/sysdeps/powerpc/powerpc32/setjmp.S
index c73e65c..65e9e44 100644
--- a/sysdeps/powerpc/powerpc32/setjmp.S
+++ b/sysdeps/powerpc/powerpc32/setjmp.S
@@ -19,7 +19,7 @@
 #include <shlib-compat.h>
 #include <libc-symbols.h>
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 /* Build a non-versioned object for rtld-*.  */
 # define __sigsetjmp_symbol __sigsetjmp
 # define __sigjmp_save_symbol __sigjmp_save
diff --git a/sysdeps/powerpc/powerpc64/__longjmp-common.S b/sysdeps/powerpc/powerpc64/__longjmp-common.S
index e489224..bd792b5 100644
--- a/sysdeps/powerpc/powerpc64/__longjmp-common.S
+++ b/sysdeps/powerpc/powerpc64/__longjmp-common.S
@@ -130,7 +130,7 @@ L(no_vmx):
 	ld r0,(JB_LR*8)(r3)
 	ld r14,((JB_GPRS+0)*8)(r3)
 	lfd fp14,((JB_FPRS+0)*8)(r3)
-#if defined SHARED && !IS_IN (rtld)
+#if defined SHARED && NOT_IN (rtld)
 	std r2,FRAME_TOC_SAVE(r1)	/* Restore the callers TOC save area.  */
 #endif
 	ld r15,((JB_GPRS+1)*8)(r3)
diff --git a/sysdeps/powerpc/powerpc64/__longjmp.S b/sysdeps/powerpc/powerpc64/__longjmp.S
index 9313eab..ee02ccf 100644
--- a/sysdeps/powerpc/powerpc64/__longjmp.S
+++ b/sysdeps/powerpc/powerpc64/__longjmp.S
@@ -20,7 +20,7 @@
 #include <rtld-global-offsets.h>
 #include <shlib-compat.h>
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 /* Build a non-versioned object for rtld-*.  */
 # include "__longjmp-common.S"
 
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
index 5781c3d..4342b1b 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
@@ -39,7 +39,7 @@ strong_alias (__isinf, __isinfl)
 weak_alias (__isinf, isinfl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
 compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
 compat_symbol (libc, isinf, isinfl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
index 2fd76b4..32a8153 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
@@ -48,7 +48,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/fpu/s_isnan.S
index 71e79f6..8bfd4cf 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_isnan.S
@@ -47,7 +47,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S
index 46796ab..e521696 100644
--- a/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S
@@ -51,7 +51,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
index 0ba6ad4..83ed68d 100644
--- a/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
@@ -50,7 +50,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S
index 20ed867..a2bc0fd 100644
--- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S
@@ -49,7 +49,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
index 79fd2e6..f0af637 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
+++ b/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
@@ -61,7 +61,7 @@ strong_alias (__isinf, __isinfl)
 weak_alias (__isinf, isinfl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
 compat_symbol (libc, isinf, isinfl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S
index 5056261..c4a3d55 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S
@@ -60,7 +60,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S
index 0e01be7..8346676 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S
@@ -58,7 +58,7 @@ strong_alias (__isinf, __isinfl)
 weak_alias (__isinf, isinfl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
 compat_symbol (libc, isinf, isinfl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S
index 7e3d2d1..f072cef 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S
@@ -53,7 +53,7 @@ strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/powerpc/powerpc64/setjmp-common.S b/sysdeps/powerpc/powerpc64/setjmp-common.S
index 5979cde..51acdaa 100644
--- a/sysdeps/powerpc/powerpc64/setjmp-common.S
+++ b/sysdeps/powerpc/powerpc64/setjmp-common.S
@@ -49,7 +49,7 @@ ENTRY (setjmp_symbol)
 	b JUMPTARGET (GLUE(__sigsetjmp_symbol,_ent))
 END (setjmp_symbol)
 
-#if defined SHARED && !IS_IN (rtld) && !defined __NO_VMX__
+#if defined SHARED && NOT_IN (rtld) && !defined __NO_VMX__
 /* When called from within libc we need a special version of _setjmp
    that saves r2 since the call won't go via a plt call stub.  See
    bugz #269.  __GI__setjmp is used in csu/libc-start.c when
@@ -80,7 +80,7 @@ JUMPTARGET(GLUE(__sigsetjmp_symbol,_ent)):
 	std  r1,(JB_GPR1*8)(3)
 #endif
 	mflr r0
-#if defined SHARED && !IS_IN (rtld)
+#if defined SHARED && NOT_IN (rtld)
 	ld   r5,FRAME_TOC_SAVE(r1)	/* Retrieve the callers TOC.  */
 	std  r5,(JB_GPR2*8)(3)
 #else
diff --git a/sysdeps/powerpc/powerpc64/setjmp.S b/sysdeps/powerpc/powerpc64/setjmp.S
index a8de3bb..c04c55d 100644
--- a/sysdeps/powerpc/powerpc64/setjmp.S
+++ b/sysdeps/powerpc/powerpc64/setjmp.S
@@ -20,7 +20,7 @@
 #include <rtld-global-offsets.h>
 #include <shlib-compat.h>
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 /* Build a non-versioned object for rtld-*.  */
 # define setjmp_symbol setjmp
 # define _setjmp_symbol _setjmp
diff --git a/sysdeps/s390/dl-tls.h b/sysdeps/s390/dl-tls.h
index 0ceb6f2..2fec72b 100644
--- a/sysdeps/s390/dl-tls.h
+++ b/sysdeps/s390/dl-tls.h
@@ -80,7 +80,7 @@ __tls_get_offset:\n\
 #  endif
 # else /* IS_IN (rtld) */
 extern void *__tls_get_addr_internal (tls_index *ti);
-# endif /* !IS_IN (rtld) */
+# endif /* NOT_IN (rtld) */
 
 # define GET_ADDR_OFFSET \
   (ti->ti_offset - (unsigned long) __builtin_thread_pointer ())
diff --git a/sysdeps/s390/s390-32/multiarch/memcmp.S b/sysdeps/s390/s390-32/multiarch/memcmp.S
index 32f08ef..5ab8f2b 100644
--- a/sysdeps/s390/s390-32/multiarch/memcmp.S
+++ b/sysdeps/s390/s390-32/multiarch/memcmp.S
@@ -96,7 +96,7 @@ END(memcmp_z10)
 
 #include "../memcmp.S"
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 .globl   memcmp
 .set     memcmp,memcmp_g5
 .weak    bcmp
diff --git a/sysdeps/s390/s390-32/multiarch/memcpy.S b/sysdeps/s390/s390-32/multiarch/memcpy.S
index bc65bd8..e6aea91 100644
--- a/sysdeps/s390/s390-32/multiarch/memcpy.S
+++ b/sysdeps/s390/s390-32/multiarch/memcpy.S
@@ -92,7 +92,7 @@ END(memcpy_z10)
 
 #include "../memcpy.S"
 
-#if !defined SHARED || !IS_IN (libc)
+#if !defined SHARED || NOT_IN (libc)
 .globl   memcpy
 .set     memcpy,memcpy_g5
 #endif
diff --git a/sysdeps/s390/s390-32/multiarch/memset.S b/sysdeps/s390/s390-32/multiarch/memset.S
index 971c593..26edf9c 100644
--- a/sysdeps/s390/s390-32/multiarch/memset.S
+++ b/sysdeps/s390/s390-32/multiarch/memset.S
@@ -107,7 +107,7 @@ END(memset_mvcle)
 
 #include "../memset.S"
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 .globl   memset
 .set     memset,memset_g5
 #endif
diff --git a/sysdeps/s390/s390-32/setjmp.S b/sysdeps/s390/s390-32/setjmp.S
index ea59cf9..c1437f5 100644
--- a/sysdeps/s390/s390-32/setjmp.S
+++ b/sysdeps/s390/s390-32/setjmp.S
@@ -23,12 +23,12 @@
 #include <bits/setjmp.h>
 #include <shlib-compat.h>
 
-#if !IS_IN (rtld)
+#if NOT_IN (rtld)
 # if defined SHARED &&  SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
 	/* we need a unique name in case of symbol versioning.  */
 #  define __sigsetjmp __v1__sigsetjmp
 # endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)  */
-#endif /* !IS_IN (rtld)  */
+#endif /* NOT_IN (rtld)  */
 
 	/* We include the BSD entry points here as well but we make
 	   them weak.  */
@@ -87,7 +87,7 @@ ENTRY(__sigsetjmp)
 #endif
 END (__sigsetjmp)
 
-#if !IS_IN (rtld)
+#if NOT_IN (rtld)
 # if defined SHARED &&  SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
 /* In glibc release 2.19 new versions of setjmp-functions were introduced,
    but were reverted before 2.20. Thus both versions are the same function.  */
@@ -108,4 +108,4 @@ strong_alias (__v1__sigsetjmp, __v2__sigsetjmp);
 versioned_symbol (libc, __v1__sigsetjmp, __sigsetjmp, GLIBC_2_0);
 compat_symbol (libc, __v2__sigsetjmp, __sigsetjmp, GLIBC_2_19);
 # endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)  */
-#endif /* if !IS_IN (rtld)  */
+#endif /* if NOT_IN (rtld)  */
diff --git a/sysdeps/s390/s390-64/multiarch/memcmp.S b/sysdeps/s390/s390-64/multiarch/memcmp.S
index 8e4eca2..6b14879 100644
--- a/sysdeps/s390/s390-64/multiarch/memcmp.S
+++ b/sysdeps/s390/s390-64/multiarch/memcmp.S
@@ -93,7 +93,7 @@ END(memcmp_z10)
 
 #include "../memcmp.S"
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 .globl   memcmp
 .set     memcmp,memcmp_z900
 .weak    bcmp
diff --git a/sysdeps/s390/s390-64/multiarch/memcpy.S b/sysdeps/s390/s390-64/multiarch/memcpy.S
index 2536ef4..9552ecb 100644
--- a/sysdeps/s390/s390-64/multiarch/memcpy.S
+++ b/sysdeps/s390/s390-64/multiarch/memcpy.S
@@ -88,7 +88,7 @@ END(memcpy_z10)
 
 #include "../memcpy.S"
 
-#if !defined SHARED || !IS_IN (libc)
+#if !defined SHARED || NOT_IN (libc)
 .globl   memcpy
 .set     memcpy,memcpy_z900
 #endif
diff --git a/sysdeps/s390/s390-64/multiarch/memset.S b/sysdeps/s390/s390-64/multiarch/memset.S
index 4d52051..d5389cb 100644
--- a/sysdeps/s390/s390-64/multiarch/memset.S
+++ b/sysdeps/s390/s390-64/multiarch/memset.S
@@ -103,7 +103,7 @@ END(memset_mvcle)
 
 #include "../memset.S"
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 .globl   memset
 .set     memset,memset_z900
 #endif
diff --git a/sysdeps/s390/s390-64/setjmp.S b/sysdeps/s390/s390-64/setjmp.S
index e3762e0..0cefce6 100644
--- a/sysdeps/s390/s390-64/setjmp.S
+++ b/sysdeps/s390/s390-64/setjmp.S
@@ -23,12 +23,12 @@
 #include <bits/setjmp.h>
 #include <shlib-compat.h>
 
-#if !IS_IN (rtld)
+#if NOT_IN (rtld)
 # if defined SHARED &&  SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
 	/* we need a unique name in case of symbol versioning.  */
 #  define __sigsetjmp __v1__sigsetjmp
 # endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)  */
-#endif /* !IS_IN (rtld)  */
+#endif /* NOT_IN (rtld)  */
 
 	/* We include the BSD entry points here as well but we make
 	   them weak.  */
@@ -82,7 +82,7 @@ ENTRY(__sigsetjmp)
 #endif
 END (__sigsetjmp)
 
-#if !IS_IN (rtld)
+#if NOT_IN (rtld)
 # if defined SHARED &&  SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
 /* In glibc release 2.19 new versions of setjmp-functions were introduced,
    but were reverted before 2.20. Thus both versions are the same function.  */
@@ -103,4 +103,4 @@ strong_alias (__v1__sigsetjmp, __v2__sigsetjmp);
 versioned_symbol (libc, __v1__sigsetjmp, __sigsetjmp, GLIBC_2_0);
 compat_symbol (libc, __v2__sigsetjmp, __sigsetjmp, GLIBC_2_19);
 # endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)  */
-#endif /* if !IS_IN (rtld)  */
+#endif /* if NOT_IN (rtld)  */
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S
index 584204e..17859c7 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S
@@ -32,7 +32,7 @@ END (__isnan)
 hidden_def (__isnan)
 weak_alias (__isnan, isnan)
 
-#if !IS_IN (libm)
+#if NOT_IN (libm)
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
diff --git a/sysdeps/unix/arm/sysdep.S b/sysdeps/unix/arm/sysdep.S
index 5566528..a801ea2 100644
--- a/sysdeps/unix/arm/sysdep.S
+++ b/sysdeps/unix/arm/sysdep.S
@@ -36,7 +36,7 @@ __syscall_error:
 	moveq	r0, $EAGAIN	/* Yes; translate it to EAGAIN.  */
 #endif
 
-#if !IS_IN (rtld)
+#if NOT_IN (rtld)
 	mov	r1, r0
 	GET_TLS (r2)
 	ldr	r2, 1f
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
index 45a8636..cda1afd 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
@@ -92,7 +92,7 @@
 
 # define ret_ERRVAL ret
 
-# if !IS_IN (libc)
+# if NOT_IN (libc)
 #  define SYSCALL_ERROR  .Lsyscall_error
 #  if RTLD_PRIVATE_ERRNO
 #   define SYSCALL_ERROR_HANDLER				\
diff --git a/sysdeps/unix/sysv/linux/arm/sysdep.h b/sysdeps/unix/sysv/linux/arm/sysdep.h
index 4863f0e..2efec6e 100644
--- a/sysdeps/unix/sysv/linux/arm/sysdep.h
+++ b/sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -137,7 +137,7 @@
 
 #define ret_ERRVAL PSEUDO_RET_NOERRNO
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 # define SYSCALL_ERROR __local_syscall_error
 # if RTLD_PRIVATE_ERRNO
 #  define SYSCALL_ERROR_HANDLER					\
diff --git a/sysdeps/unix/sysv/linux/getpid.c b/sysdeps/unix/sysv/linux/getpid.c
index af5db44..390e4ff 100644
--- a/sysdeps/unix/sysv/linux/getpid.c
+++ b/sysdeps/unix/sysv/linux/getpid.c
@@ -48,7 +48,7 @@ really_getpid (pid_t oldval)
 pid_t
 __getpid (void)
 {
-#if !IS_IN (libc)
+#if NOT_IN (libc)
   INTERNAL_SYSCALL_DECL (err);
   pid_t result = INTERNAL_SYSCALL (getpid, err, 0);
 #else
diff --git a/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S b/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
index 13596f1..240a442 100644
--- a/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
+++ b/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
@@ -115,7 +115,7 @@ __lll_lock_wait_private:
 	cfi_endproc
 	.size	__lll_lock_wait_private,.-__lll_lock_wait_private
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 	.globl	__lll_lock_wait
 	.type	__lll_lock_wait,@function
 	.hidden	__lll_lock_wait
@@ -361,7 +361,7 @@ __lll_unlock_wake_private:
 	cfi_endproc
 	.size	__lll_unlock_wake_private,.-__lll_unlock_wake_private
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 	.globl	__lll_unlock_wake
 	.type	__lll_unlock_wake,@function
 	.hidden	__lll_unlock_wake
diff --git a/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/sysdeps/unix/sysv/linux/i386/lowlevellock.h
index 1032f4b..3192d38 100644
--- a/sysdeps/unix/sysv/linux/i386/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/i386/lowlevellock.h
@@ -169,7 +169,7 @@
    value is zero.  In case the operation failed, the cmpxchg instruction
    has loaded the current value of the memory work which is guaranteed
    to be nonzero.  */
-#if !IS_IN (libc) || defined UP
+#if NOT_IN (libc) || defined UP
 # define __lll_trylock_asm LOCK_INSTR "cmpxchgl %2, %1"
 #else
 # define __lll_trylock_asm "cmpl $0, %%gs:%P5\n\t" \
@@ -198,7 +198,7 @@
 		       : "memory");					      \
      ret; })
 
-#if !IS_IN (libc) || defined UP
+#if NOT_IN (libc) || defined UP
 # define __lll_lock_asm_start LOCK_INSTR "cmpxchgl %1, %2\n\t"
 #else
 # define __lll_lock_asm_start "cmpl $0, %%gs:%P6\n\t"			      \
@@ -324,7 +324,7 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count,
 		       : "memory");					      \
      result; })
 
-#if !IS_IN (libc) || defined UP
+#if NOT_IN (libc) || defined UP
 # define __lll_unlock_asm LOCK_INSTR "subl $1, %0\n\t"
 #else
 # define __lll_unlock_asm "cmpl $0, %%gs:%P3\n\t"			      \
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h b/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h
index aa116c4..1d4a265 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h
@@ -47,11 +47,11 @@ extern void __vdso_atomic_barrier_stub (void);
 #  endif /* IS_IN (rtld) || IS_IN (libc) */
 
 /* RTLD should only use its own copies.  */
-#  if !IS_IN (rtld)
+#  if NOT_IN (rtld)
 extern void *__vdso_read_tp;
 extern void *__vdso_atomic_cmpxchg_32;
 extern void *__vdso_atomic_barrier;
-#  endif /* !IS_IN (rtld) */
+#  endif /* NOT_IN (rtld) */
 
 # endif /* !__ASSEMBLER__ */
 
diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h b/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
index 5e185a3..a0f7394 100644
--- a/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
@@ -23,7 +23,7 @@
 
 #if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
 
-# if !IS_IN (librt) || !defined(PIC)
+# if NOT_IN (librt) || !defined(PIC)
 #  define AC_STACK_SIZE  16  /* space for r15, async_cancel arg and 2 temp words */
 #  define AC_SET_GOT /* empty */
 #  define AC_RESTORE_GOT /* empty */
diff --git a/sysdeps/unix/sysv/linux/sh/lowlevellock.S b/sysdeps/unix/sysv/linux/sh/lowlevellock.S
index 3fab373..ffd06d0 100644
--- a/sysdeps/unix/sysv/linux/sh/lowlevellock.S
+++ b/sysdeps/unix/sysv/linux/sh/lowlevellock.S
@@ -172,7 +172,7 @@ __lll_lock_wait_private:
 	cfi_endproc
 	.size	__lll_lock_wait_private,.-__lll_lock_wait_private
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 	.globl	__lll_lock_wait
 	.type	__lll_lock_wait,@function
 	.hidden	__lll_lock_wait
@@ -454,7 +454,7 @@ __lll_unlock_wake_private:
 	cfi_endproc
 	.size	__lll_unlock_wake_private,.-__lll_unlock_wake_private
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 	.globl	__lll_unlock_wake
 	.type	__lll_unlock_wake,@function
 	.hidden	__lll_unlock_wake
diff --git a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
index 5d8e77c..3f53667 100644
--- a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
+++ b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
@@ -108,7 +108,7 @@ __lll_lock_wait_private:
 	cfi_endproc
 	.size	__lll_lock_wait_private,.-__lll_lock_wait_private
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 	.globl	__lll_lock_wait
 	.type	__lll_lock_wait,@function
 	.hidden	__lll_lock_wait
@@ -348,7 +348,7 @@ __lll_unlock_wake_private:
 	cfi_endproc
 	.size	__lll_unlock_wake_private,.-__lll_unlock_wake_private
 
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 	.globl	__lll_unlock_wake
 	.type	__lll_unlock_wake,@function
 	.hidden	__lll_unlock_wake
diff --git a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
index 2f0cf5c..1be8773 100644
--- a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
@@ -145,7 +145,7 @@
    value is zero.  In case the operation failed, the cmpxchg instruction
    has loaded the current value of the memory work which is guaranteed
    to be nonzero.  */
-#if !IS_IN (libc) || defined UP
+#if NOT_IN (libc) || defined UP
 # define __lll_trylock_asm LOCK_INSTR "cmpxchgl %2, %1"
 #else
 # define __lll_trylock_asm "cmpl $0, __libc_multiple_threads(%%rip)\n\t"      \
@@ -174,7 +174,7 @@
 		       : "memory");					      \
      ret; })
 
-#if !IS_IN (libc) || defined UP
+#if NOT_IN (libc) || defined UP
 # define __lll_lock_asm_start LOCK_INSTR "cmpxchgl %4, %2\n\t"		      \
 			      "jz 24f\n\t"
 #else
@@ -316,7 +316,7 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count,
 		       : "memory", "cx", "cc", "r10", "r11");		      \
      result; })
 
-#if !IS_IN (libc) || defined UP
+#if NOT_IN (libc) || defined UP
 # define __lll_unlock_asm_start LOCK_INSTR "decl %0\n\t"		      \
 				"je 24f\n\t"
 #else
diff --git a/sysdeps/x86_64/strcmp.S b/sysdeps/x86_64/strcmp.S
index b022a04..8f619a0 100644
--- a/sysdeps/x86_64/strcmp.S
+++ b/sysdeps/x86_64/strcmp.S
@@ -32,7 +32,7 @@
 /* The simplified code below is not set up to handle strncmp() so far.
    Should this become necessary it has to be implemented.  For now
    just report the problem.  */
-# if !IS_IN (libc)
+# if NOT_IN (libc)
 #  error "strncmp not implemented so far"
 # endif
 
@@ -51,7 +51,7 @@
 # include "locale-defines.h"
 
 /* No support for strcasecmp outside libc so far since it is not needed.  */
-# if !IS_IN (libc)
+# if NOT_IN (libc)
 #  error "strcasecmp_l not implemented so far"
 # endif
 
@@ -60,7 +60,7 @@
 # include "locale-defines.h"
 
 /* No support for strncasecmp outside libc so far since it is not needed.  */
-# if !IS_IN (libc)
+# if NOT_IN (libc)
 #  error "strncasecmp_l not implemented so far"
 # endif
 
@@ -126,7 +126,7 @@ libc_hidden_def (__strncasecmp)
 #endif
 
 ENTRY (STRCMP)
-#if !IS_IN (libc)
+#if NOT_IN (libc)
 /* Simple version since we can't use SSE registers in ld.so.  */
 L(oop):	movb	(%rdi), %al
 	cmpb	(%rsi), %al
@@ -144,7 +144,7 @@ L(neq):	movl	$1, %eax
 	cmovbl	%ecx, %eax
 	ret
 END (STRCMP)
-#else	/* !IS_IN (libc) */
+#else	/* NOT_IN (libc) */
 # ifdef USE_AS_STRCASECMP_L
 	/* We have to fall back on the C implementation for locales
 	   with encodings not matching ASCII for single bytes.  */
@@ -2300,5 +2300,5 @@ LABEL(unaligned_table):
 	.int	LABEL(ashr_14) - LABEL(unaligned_table)
 	.int	LABEL(ashr_15) - LABEL(unaligned_table)
 	.int	LABEL(ashr_0) - LABEL(unaligned_table)
-#endif /* !IS_IN (libc) */
+#endif /* NOT_IN (libc) */
 libc_hidden_builtin_def (STRCMP)
-- 
1.9.3

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

* Re: [all-arch][PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (18 preceding siblings ...)
  2014-08-21 11:52 ` [PATCH 15/19] Remove last place for definition of IS_IN_* macros Siddhesh Poyarekar
@ 2014-08-22  4:57 ` Siddhesh Poyarekar
  2014-08-22 16:01   ` Joseph S. Myers
  2014-11-05 11:07 ` [PING] " Siddhesh Poyarekar
  20 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-22  4:57 UTC (permalink / raw)
  To: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1431 bytes --]

On Thu, Aug 21, 2014 at 04:27:24PM +0530, Siddhesh Poyarekar wrote:
> Finally, I did some ad hoc cross-builds for powerpc64 (power6), s390x,
> aarch64 and arm and the binaries did not seem to have any significant
> changes in any of the architectures except in s390x, where libc.so
> seems to have changed very slightly.  I am going to run some more
> exhaustive build tests over the rest of the week and I'll post results
> (and maybe additional patches if necessary) on this thread when I am
> done.

I have now done cross build tests for a few more architectures and
here are the results for them:

- s390x-linux-gnu:

Found a bug for which I posted patch 20/20.  I have a slight
improvement to the patch which I will post shortly.

- powerpc64-linux-gnu:
- microblaze-linux-gnu:
- ia64-linux-gnu:
- arm-linux-gnu:
- aarch64-linux-gnu:

All OK, no changes to generated code.

- m68k-linux-gnu:
- alpha-linux-gnu:

Patch 20/20 causes these to export unwinder symbols conditionalized in
elf/Versions using the EXPORT_UNWIND_FIND_FDE macro.  Upon looking
deeper, it looks like they ought to have exported the symbols after
all since both architectures set libc_cv_gcc_unwind_find_fde to yes in
their configure fragments.

I tried a few other architectures too, but they failed due to some
tooling issues; I haven't yet figured out what's wrong but it's
probably easier if maintainers test their respective architectures.

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 19/19] Define NOT_IN when building outside glibc.
  2014-08-21 11:17 ` [PATCH 19/19] Define NOT_IN when building outside glibc Siddhesh Poyarekar
@ 2014-08-22 13:51   ` Richard Henderson
  2014-08-22 14:24     ` Siddhesh Poyarekar
  0 siblings, 1 reply; 106+ messages in thread
From: Richard Henderson @ 2014-08-22 13:51 UTC (permalink / raw)
  To: Siddhesh Poyarekar, libc-alpha

On 08/21/2014 03:57 AM, Siddhesh Poyarekar wrote:
>        * nptl_db/structs.def [!_LIBC]: Define NOT_IN.
> ---
>  nptl_db/structs.def | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/nptl_db/structs.def b/nptl_db/structs.def
> index ea8b7ac..82e7157 100644
> --- a/nptl_db/structs.def
> +++ b/nptl_db/structs.def
> @@ -16,6 +16,10 @@
>     License along with the GNU C Library; if not, see
>     <http://www.gnu.org/licenses/>.  */
>  
> +#ifndef _LIBC
> +# define NOT_IN(lib) (0)
> +#endif

I'm not especially convinced by the readability improvement of NOT_IN, and I'm
particularly confused by a NOT_IN that defaults to false.


r~

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

* Re: [PATCH 19/19] Define NOT_IN when building outside glibc.
  2014-08-22 13:51   ` Richard Henderson
@ 2014-08-22 14:24     ` Siddhesh Poyarekar
  2014-08-22 19:50       ` Siddhesh Poyarekar
  0 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-22 14:24 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Siddhesh Poyarekar, GNU C Library

On 22 August 2014 19:20, Richard Henderson <rth@twiddle.net> wrote:
>> +#ifndef _LIBC
>> +# define NOT_IN(lib) (0)
>> +#endif
>
> I'm not especially convinced by the readability improvement of NOT_IN, and I'm
> particularly confused by a NOT_IN that defaults to false.

That's not the default definition; the default one is in
libc-symbols.h.  That's a fallback definition when building outside
libc, but I'm thinking of getting rid of it because it will break
namespace tests for the headers.

Siddhesh
-- 
http://siddhesh.in

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

* Re: [all-arch][PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT
  2014-08-22  4:57 ` [all-arch][PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
@ 2014-08-22 16:01   ` Joseph S. Myers
  2014-08-22 17:32     ` Siddhesh Poyarekar
  0 siblings, 1 reply; 106+ messages in thread
From: Joseph S. Myers @ 2014-08-22 16:01 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

On Fri, 22 Aug 2014, Siddhesh Poyarekar wrote:

> - m68k-linux-gnu:
> - alpha-linux-gnu:
> 
> Patch 20/20 causes these to export unwinder symbols conditionalized in
> elf/Versions using the EXPORT_UNWIND_FIND_FDE macro.  Upon looking
> deeper, it looks like they ought to have exported the symbols after
> all since both architectures set libc_cv_gcc_unwind_find_fde to yes in
> their configure fragments.

Do you mean some previous patch in the series broke those exports and 
patch 20/20 restored them?  The exports appear in libc.abilist so I 
presume are currently working as they should, or at least were working 
recently.  General principles of bisectability mean things should be 
designed to stay working after each patch rather than patch 20 fixing 
something broken by an earlier patch.

(I think this series is far too big and risky to go in during the freeze, 
as illustrated by these architecture-specific issues being found; it would 
much better go in after the release.  It's possible the *other* -Wundef 
warnings have simple enough fixes to go in during the freeze.)

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [all-arch][PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT
  2014-08-22 16:01   ` Joseph S. Myers
@ 2014-08-22 17:32     ` Siddhesh Poyarekar
  2014-08-22 18:01       ` Joseph S. Myers
  0 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-22 17:32 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1750 bytes --]

On Fri, Aug 22, 2014 at 04:01:21PM +0000, Joseph S. Myers wrote:
> Do you mean some previous patch in the series broke those exports and 
> patch 20/20 restored them?  The exports appear in libc.abilist so I 
> presume are currently working as they should, or at least were working 
> recently.  General principles of bisectability mean things should be 
> designed to stay working after each patch rather than patch 20 fixing 
> something broken by an earlier patch.

I don't think any patches in my series broke it, but I haven't done a
per-patch analysis for all architectures; I only did that for x86_64.
For everything else I did comparisons at master, 5/20 and 20/20.  In
any case, I'm redoing those bits to reduce the impact on other bits.

> (I think this series is far too big and risky to go in during the freeze, 
> as illustrated by these architecture-specific issues being found; it would 
> much better go in after the release.  It's possible the *other* -Wundef 
> warnings have simple enough fixes to go in during the freeze.)

The other warning fix (i.e. the _POSIX_* stuff) looks like it'll be
complicated as well.  The new warning I discovered on one of the other
architectures (i.e. ABI_libm_GLIBC_2_19 and similar) may also need a
design rethink if simply using ifdef is not enough.

Another way to look at these issues would be that it's quite easy to
find issues resulting from these changes, so a bit of quick iteration
ought to close it out for 2.20.  However, I think Roland's concern was
that these warnings shouldn't stay untouched because there wasn't
enough of a push to fix them.  Given that I have committed to them and
also made some progress, maybe that concern is now moot.

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [all-arch][PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT
  2014-08-22 17:32     ` Siddhesh Poyarekar
@ 2014-08-22 18:01       ` Joseph S. Myers
  2014-08-22 18:34         ` Siddhesh Poyarekar
  0 siblings, 1 reply; 106+ messages in thread
From: Joseph S. Myers @ 2014-08-22 18:01 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

On Fri, 22 Aug 2014, Siddhesh Poyarekar wrote:

> On Fri, Aug 22, 2014 at 04:01:21PM +0000, Joseph S. Myers wrote:
> > Do you mean some previous patch in the series broke those exports and 
> > patch 20/20 restored them?  The exports appear in libc.abilist so I 
> > presume are currently working as they should, or at least were working 
> > recently.  General principles of bisectability mean things should be 
> > designed to stay working after each patch rather than patch 20 fixing 
> > something broken by an earlier patch.
> 
> I don't think any patches in my series broke it, but I haven't done a
> per-patch analysis for all architectures; I only did that for x86_64.
> For everything else I did comparisons at master, 5/20 and 20/20.  In
> any case, I'm redoing those bits to reduce the impact on other bits.

Well, clearly this series should not change any symbol exports; if there 
are bugs in the exports at present, the ABI testsuite should be showing 
them up, and they should be fixed separately.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH 01/19] Add new macro IN_MODULE to identify module in which source is built
  2014-08-21 10:58 ` [PATCH 01/19] Add new macro IN_MODULE to identify module in which source is built Siddhesh Poyarekar
@ 2014-08-22 18:22   ` Roland McGrath
  2014-08-22 18:45     ` Siddhesh Poyarekar
  2014-08-27 17:19     ` [PATCH 01/19 v2] " Siddhesh Poyarekar
  0 siblings, 2 replies; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 18:22 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

I don't like the boilerplate for setting libof-*.  Why isn't this already
covered by extra-lib.mk?  If it needs something new, it should be done in
the style of extra-lib.mk, i.e. where no repetitive boilerplate is
duplicated in each Makefile.

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

* Re: [PATCH 02/19] Fix -Wundef warning in SHLIB_COMPAT
  2014-08-21 10:58 ` [PATCH 02/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
@ 2014-08-22 18:23   ` Roland McGrath
  0 siblings, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 18:23 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

That's of course fine once the IS_IN macro is there.  

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

* Re: [PATCH 05/19] Remove IN_LIB
  2014-08-21 10:58 ` [PATCH 05/19] Remove IN_LIB Siddhesh Poyarekar
@ 2014-08-22 18:26   ` Roland McGrath
  0 siblings, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 18:26 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

> +/* Returns true if the current module is a versioned library.  Versioned
> +   library names are culled from shlib-versions files are assigned a MODULE_*
> +   value lower than MODULE_OTHERS_BEGIN.  */
> +#define IS_IN_LIB (IN_MODULE < MODULE_OTHERS_BEGIN)

s/are culled/culled/

Otherwise OK.

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

* Re: [PATCH 06/19] Define IN_MODULE for translation units that define NOT_IN_libc
  2014-08-21 10:58 ` [PATCH 06/19] Define IN_MODULE for translation units that define NOT_IN_libc Siddhesh Poyarekar
@ 2014-08-22 18:28   ` Roland McGrath
  2014-08-22 18:54     ` Siddhesh Poyarekar
  2014-09-17 12:29   ` [PATCH v2 06/19] Define IN_MODULE for translation units that define NOT_IN_libc Siddhesh Poyarekar
  1 sibling, 1 reply; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 18:28 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

interp.c is in fact in libc.  I don't see why libof-interp should be set at
all.

You also don't explain why libof-sotruss-lib matters, though that at least
is correct in the abstract.

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

* Re: [PATCH 07/19] Remove IS_IN_libc
  2014-08-21 11:37 ` [PATCH 07/19] Remove IS_IN_libc Siddhesh Poyarekar
@ 2014-08-22 18:29   ` Roland McGrath
  0 siblings, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 18:29 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

> Replace it with IS_IN_MODULE (libc) and remove the one place that it
> is defined in.  The generated code remains unchanged on x86_64.

Remember to fix this text (s/IS_IN_MODULE/IS_IN/) if it's part of your
commit log message.

The change and ChangeLog are fine.

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

* Re: [PATCH 08/19] Remove IS_IN_ldconfig
  2014-08-21 10:58 ` [PATCH 08/19] Remove IS_IN_ldconfig Siddhesh Poyarekar
@ 2014-08-22 18:29   ` Roland McGrath
  0 siblings, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 18:29 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

OK

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

* Re: [PATCH 10/19] Remove IS_IN_libdl
  2014-08-21 10:58 ` [PATCH 10/19] Remove IS_IN_libdl Siddhesh Poyarekar
@ 2014-08-22 18:30   ` Roland McGrath
  0 siblings, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 18:30 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

OK

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

* Re: [PATCH 09/19] Remove IS_IN_nscd
  2014-08-21 10:58 ` [PATCH 09/19] Remove IS_IN_nscd Siddhesh Poyarekar
@ 2014-08-22 18:30   ` Roland McGrath
  0 siblings, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 18:30 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

> Replace with IS_IN_MODULE (nscd).  Generated code unchanged on x86_64.

Again, update this text if it goes into the commit log.

Everything else looks fine.

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

* Re: [PATCH 12/19] Remove IS_IN_libpthread
  2014-08-21 10:58 ` [PATCH 12/19] Remove IS_IN_libpthread Siddhesh Poyarekar
@ 2014-08-22 18:31   ` Roland McGrath
  0 siblings, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 18:31 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

OK

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

* Re: [PATCH 11/19] Remove IS_IN_librt
  2014-08-21 10:58 ` [PATCH 11/19] Remove IS_IN_librt Siddhesh Poyarekar
@ 2014-08-22 18:31   ` Roland McGrath
  0 siblings, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 18:31 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

OK

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

* Re: [all-arch][PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT
  2014-08-22 18:01       ` Joseph S. Myers
@ 2014-08-22 18:34         ` Siddhesh Poyarekar
  0 siblings, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-22 18:34 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 550 bytes --]

On Fri, Aug 22, 2014 at 06:01:06PM +0000, Joseph S. Myers wrote:
> Well, clearly this series should not change any symbol exports; if there 
> are bugs in the exports at present, the ABI testsuite should be showing 
> them up, and they should be fixed separately.

I just did the tests again and it does look like my Makeconfig changes
had broken this.  I've proposed a different way[1] to break the
dependency cycle between shlib-versions.v.i and libc-modules.h.

Siddhesh

[1] https://sourceware.org/ml/libc-alpha/2014-08/msg00386.html

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 03/19] Auto-generate libc-modules.h
  2014-08-21 10:58 ` [PATCH 03/19] Auto-generate libc-modules.h Siddhesh Poyarekar
@ 2014-08-22 18:42   ` Siddhesh Poyarekar
  2014-08-28  6:11   ` [PATCH 03/19 v2] " Siddhesh Poyarekar
  1 sibling, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-22 18:42 UTC (permalink / raw)
  To: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

On Thu, Aug 21, 2014 at 04:27:27PM +0530, Siddhesh Poyarekar wrote:
> +# Minimal CPPFLAGS for the initial compilations, i.e. syscall stubs, %.v.i,
> +# etc.
> +MIN-CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
> +	   $($(subdir)-CPPFLAGS) \
> +	   $(+includes) $(defines) $(sysdep-CPPFLAGS) \
> +	   $(CPPFLAGS-$(suffix $@)) \
> +	   $(foreach lib,$(libof-$(basename $(@F))) \
> +			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
> +	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))

This patch breaks ABI on s390x, alpha and m68k.  I've got an fix[1],
which I'll incorporate into this patch and post an update.

Siddhesh

[1] https://sourceware.org/ml/libc-alpha/2014-08/msg00386.html

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 01/19] Add new macro IN_MODULE to identify module in which source is built
  2014-08-22 18:22   ` Roland McGrath
@ 2014-08-22 18:45     ` Siddhesh Poyarekar
  2014-08-27 17:19     ` [PATCH 01/19 v2] " Siddhesh Poyarekar
  1 sibling, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-22 18:45 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 424 bytes --]

On Fri, Aug 22, 2014 at 11:22:47AM -0700, Roland McGrath wrote:
> I don't like the boilerplate for setting libof-*.  Why isn't this already
> covered by extra-lib.mk?  If it needs something new, it should be done in
> the style of extra-lib.mk, i.e. where no repetitive boilerplate is
> duplicated in each Makefile.

Right, extra-lib.mk should be good enough for a lot of the
repetitions.  I'll fix this patch up.

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 06/19] Define IN_MODULE for translation units that define NOT_IN_libc
  2014-08-22 18:28   ` Roland McGrath
@ 2014-08-22 18:54     ` Siddhesh Poyarekar
  2014-09-01 17:19       ` Siddhesh Poyarekar
  0 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-22 18:54 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 500 bytes --]

On Fri, Aug 22, 2014 at 11:28:24AM -0700, Roland McGrath wrote:
> interp.c is in fact in libc.  I don't see why libof-interp should be set at
> all.

I remember the build breaking when I made it libc.  I'll check again,
but I remember concluding that it couldn't be libc.

> You also don't explain why libof-sotruss-lib matters, though that at least
> is correct in the abstract.

It doesn't actually matter per-say, but I've added it with the
assumption that it might be needed in future.

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 13/19] Remove IS_IN_libm
  2014-08-21 10:58 ` [PATCH 13/19] Remove IS_IN_libm Siddhesh Poyarekar
@ 2014-08-22 19:33   ` Roland McGrath
  0 siblings, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 19:33 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

OK

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

* Re: [PATCH 14/19] Remove IS_IN_rtld
  2014-08-21 10:58 ` [PATCH 14/19] Remove IS_IN_rtld Siddhesh Poyarekar
@ 2014-08-22 19:34   ` Roland McGrath
  0 siblings, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 19:34 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

OK

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

* Re: [PATCH 15/19] Remove last place for definition of IS_IN_* macros
  2014-08-21 11:52 ` [PATCH 15/19] Remove last place for definition of IS_IN_* macros Siddhesh Poyarekar
@ 2014-08-22 19:34   ` Roland McGrath
  0 siblings, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 19:34 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

OK

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

* Re: [PATCH 16/19] Remove NOT_IN_libc
  2014-08-21 10:58 ` [PATCH 16/19] Remove NOT_IN_libc Siddhesh Poyarekar
@ 2014-08-22 19:36   ` Roland McGrath
  0 siblings, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 19:36 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

OK

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

* Re: [PATCH 17/19] Provide default definition for IS_IN when _LIBC is not defined
  2014-08-21 10:58 ` [PATCH 17/19] Provide default definition for IS_IN when _LIBC is not defined Siddhesh Poyarekar
@ 2014-08-22 19:38   ` Roland McGrath
  2014-08-22 19:47     ` Siddhesh Poyarekar
  2014-08-22 20:34     ` Joseph S. Myers
  2014-08-28  6:55   ` [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined Siddhesh Poyarekar
  1 sibling, 2 replies; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 19:38 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

Please explain this more.  There must be on appearances of IS_IN or
anything like that in actual installed headers.  So I guess you are
talking about include/ wrappers for headers that will be installed.
But still I don't understand under what conditions any of this code
is used where _LIBC is not defined.  Is it just in tests?

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

* Re: [PATCH 18/19] Define new macro NOT_IN
  2014-08-21 11:52 ` [PATCH 18/19] Define new macro NOT_IN Siddhesh Poyarekar
@ 2014-08-22 19:39   ` Roland McGrath
  2014-08-22 19:49     ` Siddhesh Poyarekar
  0 siblings, 1 reply; 106+ messages in thread
From: Roland McGrath @ 2014-08-22 19:39 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

I think this makes things worse, not better.  What's the motivation for it?

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

* Re: [PATCH 17/19] Provide default definition for IS_IN when _LIBC is not defined
  2014-08-22 19:38   ` Roland McGrath
@ 2014-08-22 19:47     ` Siddhesh Poyarekar
  2014-08-22 20:34     ` Joseph S. Myers
  1 sibling, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-22 19:47 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 656 bytes --]

On Fri, Aug 22, 2014 at 12:38:54PM -0700, Roland McGrath wrote:
> Please explain this more.  There must be on appearances of IS_IN or
> anything like that in actual installed headers.  So I guess you are
> talking about include/ wrappers for headers that will be installed.
> But still I don't understand under what conditions any of this code
> is used where _LIBC is not defined.  Is it just in tests?

This patch is wrong; I forgot to mention it here.  I only ought to
have made the change in the include wrappers and not the installed
bits since the latter would break conformance tests.  This is only
needed in tests.  I'll fix this up too.

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 18/19] Define new macro NOT_IN
  2014-08-22 19:39   ` Roland McGrath
@ 2014-08-22 19:49     ` Siddhesh Poyarekar
  0 siblings, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-22 19:49 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 320 bytes --]

On Fri, Aug 22, 2014 at 12:39:42PM -0700, Roland McGrath wrote:
> I think this makes things worse, not better.  What's the motivation
> for it?

It's just for readability of conditions that use !IS_IN.  I am not
very attached to this patch and since you're the second person to not
like it, I'll just drop it.

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 19/19] Define NOT_IN when building outside glibc.
  2014-08-22 14:24     ` Siddhesh Poyarekar
@ 2014-08-22 19:50       ` Siddhesh Poyarekar
  0 siblings, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-22 19:50 UTC (permalink / raw)
  To: Richard Henderson; +Cc: GNU C Library

[-- Attachment #1: Type: text/plain, Size: 693 bytes --]

On Fri, Aug 22, 2014 at 07:54:24PM +0530, Siddhesh Poyarekar wrote:
> On 22 August 2014 19:20, Richard Henderson <rth@twiddle.net> wrote:
> >> +#ifndef _LIBC
> >> +# define NOT_IN(lib) (0)
> >> +#endif
> >
> > I'm not especially convinced by the readability improvement of NOT_IN, and I'm
> > particularly confused by a NOT_IN that defaults to false.
> 
> That's not the default definition; the default one is in
> libc-symbols.h.  That's a fallback definition when building outside
> libc, but I'm thinking of getting rid of it because it will break
> namespace tests for the headers.

Oh, and it's confusing because it's wrong.  I should probably get some
sleep.

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 17/19] Provide default definition for IS_IN when _LIBC is not defined
  2014-08-22 19:38   ` Roland McGrath
  2014-08-22 19:47     ` Siddhesh Poyarekar
@ 2014-08-22 20:34     ` Joseph S. Myers
  1 sibling, 0 replies; 106+ messages in thread
From: Joseph S. Myers @ 2014-08-22 20:34 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Siddhesh Poyarekar, libc-alpha

On Fri, 22 Aug 2014, Roland McGrath wrote:

> Please explain this more.  There must be on appearances of IS_IN or
> anything like that in actual installed headers.  So I guess you are
> talking about include/ wrappers for headers that will be installed.
> But still I don't understand under what conditions any of this code
> is used where _LIBC is not defined.  Is it just in tests?

bits/stdio-lock.h, as changed by this patch,

(a) is installed;

(b) includes the non-installed header <lowlevellock.h> (at least);

(c) is not namespace-clean;

(d) only actually gets included by libio.h if _IO_MTSAFE_IO is defined, 
which is not the case for any valid use of installed libc, so this doesn't 
cause any user-visible bugs.

Of course that should still be cleaned up.  A clean state would, as far as 
possible, not have the installed libio.h containing any code (such as 
_IO_MTSAFE_IO conditionals) that's not relevant for users of installed 
libc; that would go in include/libio.h instead.  It would not have 
bits/stdio-lock.h installed, since it's not actually used in installed 
headers.  That header would have a name that doesn't involve bits/, 
following the rule that bits/ headers are installed headers (see bug 
14912).

And it's doubtful if _IO_MTSAFE_IO (or _LIBC_REENTRANT) conditionals are 
needed at all - maybe the code should just assume it's true (outside 
installed headers, with the conditionals in installed headers having been 
moved to include/).  (I'd think it would be better for any single-thread 
ports to work via macros that expand to do nothing, rather than having 
_IO_MTSAFE_IO or _LIBC_REENTRANT conditionals on calls to those macros.)

(Before removing such conditionals, make sure the macro in question is 
actually defined for the source file in question - _IO_MTSAFE_IO isn't 
defined globally, but by lots of separate makefile references to 
$(libio-mtsafe).)

libio also has lots of _LIBC conditionals that are probably relics of when 
it was used in libstdc++.  In general such conditionals are unnecessary in 
files that are neither installed nor shared with other projects.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* [PATCH 01/19 v2] Add new macro IN_MODULE to identify module in which source is built
  2014-08-22 18:22   ` Roland McGrath
  2014-08-22 18:45     ` Siddhesh Poyarekar
@ 2014-08-27 17:19     ` Siddhesh Poyarekar
  2014-09-17 12:38       ` [ping][PATCH " Siddhesh Poyarekar
  1 sibling, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-27 17:19 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 18998 bytes --]

Here's a second version of this patch with the useless boilerplate
code removed since extra-lib should have taken care of it.  I couldn't
replace the remaining instances of cppflags-iterator inclusions with
simple variable assignments because there were a couple of cases that
would make it hard to implement.

Verified that the generated code remains the same on x86_64.  I have
build tests for other architectures running (for all patches) but
they'll probably take till tomorrow to complete.

Siddhesh


From 50b828b55a58187382f515632bec00522a82f9ab Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Thu, 21 Aug 2014 10:19:31 +0530
Subject: [PATCH] Add new macro IN_MODULE to identify module in which source is
 built

The current scheme to identify which module a translation unit is
built in depends on defining multiple macros IS_IN_* and also defining
NOT_IN_libc if we're building a non-libc module.  In addition, there
is an IN_LIB macro that does effectively the same thing, but for
different modules (notably the systemtap probes).  This macro scheme
unifies both ideas to use just one macro IN_MODULE and assign it a
value depending on the module it is being built into.  If the module
is not defined, it defaults to MODULE_libc.

Patches that follow will remove uses of IS_IN_* variables with the
IS_IN() macro.  libc-symbols.h has been converted already to give an
example of how such a transition will look.

Verified that there are no relevant source changes.  One source change
that will crop up repeatedly is that of nscd_stat, since it uses the
build timestamp as a constant in its logic.

	* Makeconfig (in-module): Get value of libof set for the
	translation unit.
	(module-def): Set IN_MODULE based on value of libof-*.
	(CPPFLAGS): Add $(module-def) to CPPFLAGS.
	* Makerules: Don't suffix routine names for nonlib.
	* include/libc-modules.h: New file.
	* include/libc-symbols.h: Include libc-modules.h
	(IS_IN): New macro to replace IS_IN_* macros.
	* elf/Makefile: Set libof-* for each routine.
	* elf/rtld-Rules: Likewise.
	* extra-modules.mk: Likewise.
	* iconv/Makefile: Likewise.
	* iconvdata/Makefile: Likewise.
	* locale/Makefile: Likewise.
	* malloc/Makefile: Likewise.
	* nss/Makefile: Likewise.
	* sysdeps/gnu/Makefile: Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile: Likewise.
	* sysdeps/unix/sysv/linux/Makefile: Likewise.
	* sysdeps/s390/s390-64/Makefile: Likewise.
	* nscd/Makefile: Set libof-* for each routine.  Set CFLAGS and
	CPPFLAGS for nscd instead of nonlib.

---
 Makeconfig                       |  7 ++++++-
 Makerules                        |  2 +-
 elf/Makefile                     |  7 ++++++-
 elf/rtld-Rules                   |  5 +++++
 extra-modules.mk                 |  1 +
 iconv/Makefile                   | 11 ++++++-----
 iconvdata/Makefile               |  6 ++++++
 include/libc-modules.h           | 37 +++++++++++++++++++++++++++++++++++++
 include/libc-symbols.h           | 24 ++++++++++++++----------
 locale/Makefile                  |  8 ++++----
 mach/Machrules                   |  1 +
 malloc/Makefile                  |  5 +++++
 nscd/Makefile                    | 13 ++++++-------
 nss/Makefile                     |  3 ++-
 stdlib/Makefile                  |  1 +
 sysdeps/gnu/Makefile             |  2 ++
 sysdeps/s390/s390-64/Makefile    |  4 ++++
 sysdeps/unix/sysv/linux/Makefile |  1 +
 18 files changed, 108 insertions(+), 30 deletions(-)
 create mode 100644 include/libc-modules.h

diff --git a/Makeconfig b/Makeconfig
index cef0f06..5c6de39 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -813,6 +813,11 @@ endif	# $(+cflags) == ""
 # of many little headers in the include directory.
 libio-include = -I$(..)libio
 
+in-module = $(strip $(foreach lib,$(libof-$(basename $(@F))) $(libof-$(<F)) \
+				  $(libof-$(@F)),-DIN_MODULE=MODULE_$(lib)))
+
+module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
+
 # These are the variables that the implicit compilation rules use.
 # Note that we can't use -std=* in CPPFLAGS, because it overrides
 # the implicit -lang-asm and breaks cpp behavior for .S files--notably
@@ -821,7 +826,7 @@ CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
 	   $($(subdir)-CPPFLAGS) \
 	   $(+includes) $(defines) \
 	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
-	   $(CPPFLAGS-$(suffix $@)) \
+	   $(CPPFLAGS-$(suffix $@)) $(module-def) \
 	   $(foreach lib,$(libof-$(basename $(@F))) \
 			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
diff --git a/Makerules b/Makerules
index 6b30e8c..2736db7 100644
--- a/Makerules
+++ b/Makerules
@@ -1156,7 +1156,7 @@ xcheck: xtests
 
 all-nonlib = $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) $(others))
 ifneq (,$(all-nonlib))
-cpp-srcs-left = $(all-nonlib:=.c) $(all-nonlib:=.cc)
+cpp-srcs-left = $(all-nonlib)
 lib := nonlib
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 endif
diff --git a/elf/Makefile b/elf/Makefile
index 25012cc..f7d384d 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -430,7 +430,8 @@ $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
 
 SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
 CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
-		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
+		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1 -DNOT_IN_libc=1
+libof-ldconfig = ldconfig
 CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
 CFLAGS-cache.c = $(SYSCONF-FLAGS)
 CFLAGS-rtld.c = $(SYSCONF-FLAGS)
@@ -438,6 +439,10 @@ CFLAGS-rtld.c = $(SYSCONF-FLAGS)
 CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
 		     -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
 
+cpp-srcs-left := $(all-rtld-routines:=.os)
+lib := rtld
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
 generated += $(addsuffix .so,$(strip $(modules-names)))
 
diff --git a/elf/rtld-Rules b/elf/rtld-Rules
index 0a5d6af..4d78d90 100644
--- a/elf/rtld-Rules
+++ b/elf/rtld-Rules
@@ -138,6 +138,11 @@ ifdef rtld-depfiles
 -include $(rtld-depfiles)
 endif
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(subst .os,,$(rtld-modules))
+lib := rtld
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 # This here is the whole point of all the shenanigans.
 rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld
 
diff --git a/extra-modules.mk b/extra-modules.mk
index c7ed850..9c2e4d2 100644
--- a/extra-modules.mk
+++ b/extra-modules.mk
@@ -6,4 +6,5 @@
 module := $(firstword $(extra-modules-left))
 extra-modules-left := $(filter-out $(module),$(extra-modules-left))
 
+libof-$(notdir $(module)) := extramodules
 CPPFLAGS-$(module).c += -DNOT_IN_libc
diff --git a/iconv/Makefile b/iconv/Makefile
index 48d17d7..8031a88 100644
--- a/iconv/Makefile
+++ b/iconv/Makefile
@@ -52,11 +52,12 @@ CFLAGS-gconv_cache.c += -DGCONV_DIR='"$(gconvdir)"'
 CFLAGS-gconv_conf.c = -DGCONV_PATH='"$(gconvdir)"'
 CFLAGS-iconvconfig.c = -DGCONV_PATH='"$(gconvdir)"' -DGCONV_DIR='"$(gconvdir)"'
 
-CPPFLAGS-iconv_charmap = -DNOT_IN_libc
-CPPFLAGS-linereader = -DNOT_IN_libc
-CPPFLAGS-strtab = -DNOT_IN_libc
-CPPFLAGS-charmap = -DNOT_IN_libc
-CPPFLAGS-charmap-dir = -DNOT_IN_libc
+CPPFLAGS-iconvprogs = -DNOT_IN_libc
+
+# Set libof-* for each routine.
+cpp-srcs-left := $(iconv_prog-modules) $(iconvconfig-modules)
+lib := iconvprogs
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
 ifeq ($(run-built-tests),yes)
 xtests-special += $(objpfx)test-iconvconfig.out
diff --git a/iconvdata/Makefile b/iconvdata/Makefile
index 0a410a1..63ed612 100644
--- a/iconvdata/Makefile
+++ b/iconvdata/Makefile
@@ -211,6 +211,7 @@ $(objpfx)iconv-rules: Makefile
 	$(AWK) 'NR == 1 { \
 		  for (i = 1; i <= NF; i++) { \
 		    printf "%s-routines := %s\n", $$i, tolower($$i); \
+		    printf "libof-%s := iconvdata\n", tolower($$i); \
 		    printf "%s-map := gconv.map\n", $$i; \
 		  } \
 		}; \
@@ -273,6 +274,11 @@ endif
 
 include ../Rules
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(modules) $(generated-modules)
+lib := iconvdata
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 tst-loading-ENV = MALLOC_TRACE=$(objpfx)tst-loading.mtrace
 $(objpfx)mtrace-tst-loading.out: $(objpfx)tst-loading.out
 	$(common-objpfx)malloc/mtrace $(objpfx)tst-loading.mtrace > $@; \
diff --git a/include/libc-modules.h b/include/libc-modules.h
new file mode 100644
index 0000000..d12fb90
--- /dev/null
+++ b/include/libc-modules.h
@@ -0,0 +1,37 @@
+#define MODULE_libc		1
+#define MODULE_libpthread	2
+#define MODULE_rtld		3
+#define MODULE_libdl		4
+#define MODULE_libm		5
+#define MODULE_iconvprogs	6
+#define MODULE_iconvdata	7
+#define MODULE_lddlibc4		8
+#define MODULE_locale_programs	9
+#define MODULE_memusagestat	10
+#define MODULE_libutil		12
+#define MODULE_libBrokenLocale	13
+#define MODULE_libmemusage	15
+#define MODULE_libresolv	16
+#define MODULE_libnss_db	17
+#define MODULE_libnss_files	18
+#define	MODULE_libnss_dns	19
+#define MODULE_libnss_compat	20
+#define MODULE_libnss_hesiod	21
+#define MODULE_libnss_nis	22
+#define MODULE_libnss_nisplus	23
+#define MODULE_libanl		24
+#define MODULE_librt		25
+#define MODULE_libSegFault	26
+#define MODULE_libthread_db	27
+#define MODULE_libcidn		28
+#define MODULE_libcrypt		29
+#define MODULE_libnsl		30
+#define MODULE_libpcprofile	31
+#define MODULE_librpcsvc	32
+#define MODULE_nscd		33
+#define MODULE_ldconfig 	34
+#define MODULE_libnldbl 	35
+
+/* Catch-all for test modules and other binaries.  */
+#define MODULE_nonlib		98
+#define MODULE_extramodules	99
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index d4ab1f3..131d7eb 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -20,6 +20,10 @@
 #ifndef _LIBC_SYMBOLS_H
 #define _LIBC_SYMBOLS_H	1
 
+#include "libc-modules.h"
+
+#define IS_IN(lib) (IN_MODULE == MODULE_##lib)
+
 /* This file's macros are included implicitly in the compilation of every
    file in the C library by -imacros.
 
@@ -468,7 +472,7 @@ for linking")
    If the function should be internal to multiple objects, say ld.so and
    libc.so, the best way is to use:
 
-   #if !defined NOT_IN_libc || defined IS_IN_rtld
+   #if IS_IN (libc) || IS_IN (rtld)
    hidden_proto (foo)
    #endif
 
@@ -584,7 +588,7 @@ for linking")
 # define libc_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
 # define rtld_hidden_def(name) hidden_def (name)
@@ -604,7 +608,7 @@ for linking")
 # define rtld_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libm_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
 # define libm_hidden_def(name) hidden_def (name)
@@ -624,7 +628,7 @@ for linking")
 # define libm_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libresolv
+#if IS_IN (libresolv)
 # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libresolv_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -645,7 +649,7 @@ for linking")
 # define libresolv_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_librt
+#if IS_IN (librt)
 # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define librt_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -666,7 +670,7 @@ for linking")
 # define librt_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libdl
+#if IS_IN (libdl)
 # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libdl_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -687,7 +691,7 @@ for linking")
 # define libdl_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libnss_files
+#if IS_IN (libnss_files)
 # define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libnss_files_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -708,7 +712,7 @@ for linking")
 # define libnss_files_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libnsl
+#if IS_IN (libnsl)
 # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libnsl_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -729,7 +733,7 @@ for linking")
 # define libnsl_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libnss_nisplus
+#if IS_IN (libnss_nisplus)
 # define libnss_nisplus_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libnss_nisplus_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -758,7 +762,7 @@ for linking")
 # define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name)
 #endif
 
-#ifdef IS_IN_libutil
+#if IS_IN (libutil)
 # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libutil_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
diff --git a/locale/Makefile b/locale/Makefile
index e4c3878..5cd18e0 100644
--- a/locale/Makefile
+++ b/locale/Makefile
@@ -85,7 +85,7 @@ locale-CPPFLAGS = -DLOCALEDIR='"$(localedir)"' \
 		  -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \
 		  -Iprograms
 
-CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
+CPPFLAGS-locale_programs = -DLOCALE_PATH='$(localepath)' \
 			   -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
 			   -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
 			   -DLOCSRCDIR='"$(i18ndir)/locales"' \
@@ -96,7 +96,7 @@ CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-charmap-dir.c = -Wno-write-strings
 
 # This makes sure -DNOT_IN_libc et al are passed for all these modules.
-cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \
-				$(locale-modules) $(lib-modules))
-lib := locale-programs
+cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
+		 $(lib-modules)
+lib := locale_programs
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
diff --git a/mach/Machrules b/mach/Machrules
index 8b35cf6..632f5f4 100644
--- a/mach/Machrules
+++ b/mach/Machrules
@@ -226,6 +226,7 @@ extra-libs += $(interface-library)
 extra-libs-others += $(interface-library)
 
 ifeq (yes,$(build-shared))
+
 interface.so = $(interface-library:=.so)
 
 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
diff --git a/malloc/Makefile b/malloc/Makefile
index 9e93523..fbfada2 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -89,6 +89,11 @@ endif
 do-memusagestat: $(objpfx)memusagestat
 
 memusagestat-modules = memusagestat
+
+cpp-srcs-left := $(memusagestat-modules)
+lib := memusagestat
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 $(objpfx)memusagestat: $(memusagestat-modules:%=$(objpfx)%.o)
 	$(LINK.o) -o $@ $^ $(libgd-LDFLAGS) -lgd -lpng -lz -lm
 
diff --git a/nscd/Makefile b/nscd/Makefile
index 639d87b..7ab4e9d 100644
--- a/nscd/Makefile
+++ b/nscd/Makefile
@@ -79,23 +79,22 @@ CFLAGS-nscd_gethst_r.c = -fexceptions
 CFLAGS-nscd_getai.c = -fexceptions
 CFLAGS-nscd_initgroups.c = -fexceptions
 
-CPPFLAGS-nonlib += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2
+CPPFLAGS-nscd += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2 -DNOT_IN_libc=1
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
-CFLAGS-nonlib += $(pie-ccflag)
+CFLAGS-nscd += $(pie-ccflag)
 endif
 ifeq (yes,$(have-ssp))
-CFLAGS-nonlib += -fstack-protector
+CFLAGS-nscd += -fstack-protector
 endif
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
 LDFLAGS-nscd = -Wl,-z,now
 endif
 
-# This makes sure CPPFLAGS-nonlib and CFLAGS-nonlib are passed
-# for all these modules.
-cpp-srcs-left := $(nscd-modules:=.c)
-lib := nonlib
+# Set libof-nscd.
+cpp-srcs-left := $(nscd-modules)
+lib := nscd
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
 $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
diff --git a/nss/Makefile b/nss/Makefile
index 1fa7f1f..7114d74 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -105,7 +105,8 @@ $(objpfx)makedb: $(makedb-modules:%=$(objpfx)%.o)
 $(inst_vardbdir)/Makefile: db-Makefile $(+force)
 	$(do-install)
 
-CFLAGS-nss_test1.c = -DNOT_IN_libc=1
+libof-nss_test1 = extramodules
+CPPFLAGS-nss_test1 = -DNOT_IN_libc=1
 $(objpfx)/libnss_test1.so: $(objpfx)nss_test1.os $(link-libc-deps)
 	$(build-module)
 ifdef libnss_test1.so-version
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 9b2271b..da6e076 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -145,6 +145,7 @@ LDFLAGS-tst-putenv = $(no-as-needed)
 
 $(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os $(link-libc-deps)
 	$(build-module)
+libof-tst-putenvmod = extramodules
 CFLAGS-tst-putenvmod.c = -DNOT_IN_libc=1
 
 $(objpfx)bug-getcontext: $(libm)
diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
index c05708d..b5b2cf0 100644
--- a/sysdeps/gnu/Makefile
+++ b/sysdeps/gnu/Makefile
@@ -29,6 +29,8 @@ ifeq ($(subdir),stdio-common)
 
 errlist-c = $(firstword $(wildcard $(addsuffix /errlist.c,$(sysdirs) .)))
 
+libof-errlist-compat = extramodules
+
 ifeq ($(build-shared),yes)
 $(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \
 			   $(common-objpfx)Versions.v.i $(before-compile)
diff --git a/sysdeps/s390/s390-64/Makefile b/sysdeps/s390/s390-64/Makefile
index fe5030e..ce4f0c5 100644
--- a/sysdeps/s390/s390-64/Makefile
+++ b/sysdeps/s390/s390-64/Makefile
@@ -28,6 +28,10 @@ s390x-iconv-modules = ISO-8859-1_CP037_Z900 UTF8_UTF16_Z9 UTF16_UTF32_Z9 UTF8_UT
 extra-modules-left += $(s390x-iconv-modules)
 include extra-module.mk
 
+cpp-srcs-left := $(foreach mod,$(s390x-iconv-modules),$($(mod)-routines))
+lib := iconvdata
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 extra-objs      += $(addsuffix .so, $(s390x-iconv-modules))
 install-others  += $(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules))
 
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 9ad6d22..2d6d8bb 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -178,6 +178,7 @@ ifeq ($(subdir),elf)
 sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \
 			dl-fxstatat64
 
+libof-lddlibc4 = lddlibc4
 CPPFLAGS-lddlibc4 += -DNOT_IN_libc
 
 others += pldd
-- 
1.9.3


[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [PATCH 03/19 v2] Auto-generate libc-modules.h
  2014-08-21 10:58 ` [PATCH 03/19] Auto-generate libc-modules.h Siddhesh Poyarekar
  2014-08-22 18:42   ` Siddhesh Poyarekar
@ 2014-08-28  6:11   ` Siddhesh Poyarekar
  2014-09-17 12:43     ` [ping][PATCH " Siddhesh Poyarekar
  1 sibling, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-28  6:11 UTC (permalink / raw)
  To: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 10457 bytes --]

Here's an updated patch to autogenerate libc-modules.h.  I now include
libc-symbols.h everywhere like before, so all of the %.v.i files can
once again use the macros libc-symbols.h defines.  To break the
circular dependency with shlib-versions, I include libc-modules.h in
the commandline instead of in libc-symbols.h and I don't include it
for shlib-versions.v.i and Versions.v.i.

Verified that the generated code is unchanged on s390x, m68k and
x86_64.

Siddhesh

From be106027f05fda459860ac3d4f0d47091f879033 Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Thu, 21 Aug 2014 11:44:54 +0530
Subject: [PATCH] Auto-generate libc-modules.h

Remove libc-modules.h from the tree and auto-generate it from
soversions.i and a new file build.list.  Macros generated from
soversions.i have lower values starting from 1, while those from
build.list start from a special value MODULE_OTHER_BEGIN, which has a
high enough value (1000).  This allows us to conveniently
differentiate between the versioned libraries and other built modules,
which is needed in errno.h and netdb.h to decide whether to use an
internal symbol or an external one.

Verified that generated code remains unchanged on x86_64.

	* Makeconfig (skip-module-cppflags): Add Versions.v.i and
	shlib-versions.v.i.
	(module-cppflags): Include libc-modules.h for everything
	except targets in skip-module-cppflags.
	(CPPFLAGS): Use it.
	(before-compile): Add libc-modules.h.
	($(common-objpfx)libc-modules.h,
	$(common-objpfx)libc-modules.stmp): New targets.
	(common-generated): Add libc-modules.h and libc-modules.stmp.
	($(common-objpfx)Versions.v.i): Depend on libc-modules.h.
	* build.list: New file.
	* include/libc-symbols.h: Don't include libc-modules.h.
	* include/libc-modules.h: Remove file.
	* scripts/gen-libc-modules.awk: New script to generate
	libc-modules.h.
	* sysdeps/unix/Makefile ($(common-objpfx)sysd-syscalls):
	Depend on libc-modules.stmp.
---
 Makeconfig                   | 44 +++++++++++++++++++++++++++++++++++++++-----
 build.list                   | 15 +++++++++++++++
 include/libc-modules.h       | 37 -------------------------------------
 include/libc-symbols.h       |  2 --
 scripts/gen-libc-modules.awk | 40 ++++++++++++++++++++++++++++++++++++++++
 sysdeps/unix/Makefile        |  3 ++-
 6 files changed, 96 insertions(+), 45 deletions(-)
 create mode 100644 build.list
 delete mode 100644 include/libc-modules.h
 create mode 100644 scripts/gen-libc-modules.awk

diff --git a/Makeconfig b/Makeconfig
index 5c6de39..cae28bf 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -813,10 +813,22 @@ endif	# $(+cflags) == ""
 # of many little headers in the include directory.
 libio-include = -I$(..)libio
 
+# We don't include libc-modules.h when these targets are being built.  These
+# targets don't (and will likely never need to) use the IS_IN facility.  In
+# fact, shlib-versions should not use it because that will create a circular
+# dependency as libc-modules.h is generated from shlib-versions.
+skip-module-cppflags = shlib-versions.v.i Versions.v.i
+
 in-module = $(strip $(foreach lib,$(libof-$(basename $(@F))) $(libof-$(<F)) \
 				  $(libof-$(@F)),-DIN_MODULE=MODULE_$(lib)))
 
 module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
+module-cppflags-real = -include $(common-objpfx)libc-modules.h $(module-def)
+
+# We don't need libc-modules.h and the IN_MODULE definition for
+# shlib-version.v.i.
+module-cppflags = $(if $(filter $(@F),$(skip-module-cppflags)), \
+		       ,$(module-cppflags-real))
 
 # These are the variables that the implicit compilation rules use.
 # Note that we can't use -std=* in CPPFLAGS, because it overrides
@@ -824,9 +836,9 @@ module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
 # it causes cpp to stop predefining __ASSEMBLER__.
 CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
 	   $($(subdir)-CPPFLAGS) \
-	   $(+includes) $(defines) \
+	   $(+includes) $(defines) $(module-cppflags) \
 	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
-	   $(CPPFLAGS-$(suffix $@)) $(module-def) \
+	   $(CPPFLAGS-$(suffix $@)) \
 	   $(foreach lib,$(libof-$(basename $(@F))) \
 			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
@@ -993,9 +1005,12 @@ endif
 postclean-generated += soversions.mk soversions.i \
 		       shlib-versions.v shlib-versions.v.i
 
-# Generate the header containing the names of all shared libraries.
+# Generate a header containing the names of all shared libraries and another
+# one containing macros that comprise valid values for the IN_MODULE and
+# MODULE_NAME macros..
 # We use a stamp file to avoid unnecessary recompilations.
-before-compile += $(common-objpfx)gnu/lib-names.h
+before-compile += $(common-objpfx)gnu/lib-names.h \
+		  $(common-objpfx)libc-modules.h
 ifeq ($(soversions.mk-done),t)
 $(common-objpfx)gnu/lib-names.h: $(common-objpfx)gnu/lib-names.stmp; @:
 $(common-objpfx)gnu/lib-names.stmp: $(..)scripts/lib-names.awk \
@@ -1028,9 +1043,28 @@ $(common-objpfx)gnu/lib-names.stmp: $(..)scripts/lib-names.awk \
 	} >  ${@:stmp=T}
 	$(move-if-change) ${@:stmp=T} ${@:stmp=h}
 	touch $@
+
+# Generate a header with macro definitions for use with the IS_IN macro.
+# These are the possible values for the IN_MODULE macro defined when building
+# sources, to identify which module the translation unit is going to be built
+# into.  This needs to be one of the first headers to be generated since
+# everything uses it.  We work around a one-time circular dependency with
+# sysd-rules by touching an empty header file since the sysd-rules don't use
+# the IN_MODULE macros even though it is defined in the compile command.  This
+# is only necessary the first time, i.e. when there is no
+# include/libc-modules.h.
+$(common-objpfx)libc-modules.h: $(common-objpfx)libc-modules.stmp; @:
+$(common-objpfx)libc-modules.stmp: $(..)scripts/gen-libc-modules.awk \
+				   $(common-objpfx)soversions.i \
+				   $(..)build.list
+	$(AWK) -f $^ > ${@:stmp=T}
+	$(move-if-change) ${@:stmp=T} ${@:stmp=h}
+	touch $@
+
 endif
 
-common-generated += gnu/lib-names.h gnu/lib-names.stmp
+common-generated += gnu/lib-names.h gnu/lib-names.stmp libc-modules.h \
+		    libc-modules.stmp
 
 # The name under which the run-time dynamic linker is installed.
 # We are currently going for the convention that `/lib/ld.so.1'
diff --git a/build.list b/build.list
new file mode 100644
index 0000000..eab57c7
--- /dev/null
+++ b/build.list
@@ -0,0 +1,15 @@
+iconvprogs
+iconvdata
+ldconfig
+lddlibc4
+libmemusage
+libSegFault
+libpcprofile
+librpcsvc
+libutil
+locale_programs
+memusagestat
+nonlib
+nscd
+extramodules
+libnldbl
diff --git a/include/libc-modules.h b/include/libc-modules.h
deleted file mode 100644
index d12fb90..0000000
--- a/include/libc-modules.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#define MODULE_libc		1
-#define MODULE_libpthread	2
-#define MODULE_rtld		3
-#define MODULE_libdl		4
-#define MODULE_libm		5
-#define MODULE_iconvprogs	6
-#define MODULE_iconvdata	7
-#define MODULE_lddlibc4		8
-#define MODULE_locale_programs	9
-#define MODULE_memusagestat	10
-#define MODULE_libutil		12
-#define MODULE_libBrokenLocale	13
-#define MODULE_libmemusage	15
-#define MODULE_libresolv	16
-#define MODULE_libnss_db	17
-#define MODULE_libnss_files	18
-#define	MODULE_libnss_dns	19
-#define MODULE_libnss_compat	20
-#define MODULE_libnss_hesiod	21
-#define MODULE_libnss_nis	22
-#define MODULE_libnss_nisplus	23
-#define MODULE_libanl		24
-#define MODULE_librt		25
-#define MODULE_libSegFault	26
-#define MODULE_libthread_db	27
-#define MODULE_libcidn		28
-#define MODULE_libcrypt		29
-#define MODULE_libnsl		30
-#define MODULE_libpcprofile	31
-#define MODULE_librpcsvc	32
-#define MODULE_nscd		33
-#define MODULE_ldconfig 	34
-#define MODULE_libnldbl 	35
-
-/* Catch-all for test modules and other binaries.  */
-#define MODULE_nonlib		98
-#define MODULE_extramodules	99
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 131d7eb..9b8208b 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -20,8 +20,6 @@
 #ifndef _LIBC_SYMBOLS_H
 #define _LIBC_SYMBOLS_H	1
 
-#include "libc-modules.h"
-
 #define IS_IN(lib) (IN_MODULE == MODULE_##lib)
 
 /* This file's macros are included implicitly in the compilation of every
diff --git a/scripts/gen-libc-modules.awk b/scripts/gen-libc-modules.awk
new file mode 100644
index 0000000..d3382b6
--- /dev/null
+++ b/scripts/gen-libc-modules.awk
@@ -0,0 +1,40 @@
+# Generate a header file that defines the MODULE_* macros for each library and
+# module we build in glibc.  The library names are pulled in from soversions.i
+# and the additional modules are mentioned one-per-line in build.list.
+BEGIN {
+  PROCINFO["sorted_in"] = "@val_type_asc"
+  shlibs = 1
+  others = 1000
+  libs["OTHERS_BEGIN"] = others++
+}
+
+# Skip over comments.
+$1 == "#" {
+  next
+}
+
+# build.list is simply one module per line.
+match (FILENAME, ".*build.list") {
+  libs[$0] = others++
+}
+
+# We have only one special case in soversions.i parsing, which is to replace ld
+# with rtld since that's what we call it throughout the sources.
+match (FILENAME, ".*soversions.i") {
+  name = $2
+  if (name == "ld")
+    name = "rtld"
+
+  if (!(name in libs)) {
+    libs[name] = shlibs++
+  }
+}
+
+# Finally, print out the header file.
+END {
+  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n\n")
+  i = 1
+  for (l in libs) {
+    printf ("#define MODULE_%s %d\n", l, libs[l])
+  }
+}
diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile
index 0e535b6..573e90d 100644
--- a/sysdeps/unix/Makefile
+++ b/sysdeps/unix/Makefile
@@ -79,7 +79,8 @@ compile-syscall = $(COMPILE.S) -o $@ -x assembler-with-cpp - \
 
 ifndef avoid-generated
 $(common-objpfx)sysd-syscalls: $(..)sysdeps/unix/make-syscalls.sh \
-			       $(wildcard $(+sysdep_dirs:%=%/syscalls.list))
+			       $(wildcard $(+sysdep_dirs:%=%/syscalls.list)) \
+			       $(common-objpfx)libc-modules.stmp
 	for dir in $(+sysdep_dirs); do \
 	  test -f $$dir/syscalls.list && \
 	  { sysdirs='$(sysdirs)' \
-- 
1.9.3


[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined
  2014-08-21 10:58 ` [PATCH 17/19] Provide default definition for IS_IN when _LIBC is not defined Siddhesh Poyarekar
  2014-08-22 19:38   ` Roland McGrath
@ 2014-08-28  6:55   ` Siddhesh Poyarekar
  2014-08-28 16:58     ` Joseph S. Myers
  2014-11-07 23:33     ` [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined Roland McGrath
  1 sibling, 2 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-28  6:55 UTC (permalink / raw)
  To: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 3299 bytes --]

Hi,

Here's an updated patch that fixes conformtest failures due to IS_IN.
The conformtest tests ideally ought to include the headers to be
installed, but cannot do so currently and hence does its tests using
headers in include/.  Due to this it fails because it doesn't include
any of the libc headers and consequently does not have a definition
for IS_IN.  This patch guards instances in such headers with #ifdef
_LIBC.

There are a couple of installed headers that have this problem too -
stdio-lock.h and libc-lock.h.  Both headers however never get used in
normal applications since they're only included when _IO_MTSAFE_IO is
defined, which it isn't in the normal case.  I haven't tried to fix
these headers because it won't make a difference and ideally they
ought to be removed.  I intend to do that as a separate patch after
2.20 is released.

I have also verified that this does not result in any change in
generated code on x86_64.

Siddhesh

From 00592dd98e35bc9771d17114f9c1da62368f8488 Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Mon, 25 Aug 2014 15:58:46 +0530
Subject: [PATCH] Use IS_IN when _LIBC is defined

This change is only useful for the conformance tests since the headers
changed are not installed.  The conformance tests fail due to IS_IN
not being defined, so wrap it with a check to make sure that _LIBC is
defined.

	* include/bits/stdlib-float.h: Use IS_IN only if _LIBC is
	defined.
	* include/mqueue.h: Likewise.
	* include/stdlib.h: Likewise.
---
 include/bits/stdlib-float.h |  6 ++++--
 include/mqueue.h            |  4 +++-
 include/stdlib.h            | 10 ++++++----
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/include/bits/stdlib-float.h b/include/bits/stdlib-float.h
index 3466314..debb364 100644
--- a/include/bits/stdlib-float.h
+++ b/include/bits/stdlib-float.h
@@ -1,4 +1,6 @@
 /* No floating-point inline functions in rtld.  */
-#if !IS_IN (rtld)
-# include <stdlib/bits/stdlib-float.h>
+#ifdef _LIBC
+# if !IS_IN (rtld)
+#  include <stdlib/bits/stdlib-float.h>
+# endif
 #endif
diff --git a/include/mqueue.h b/include/mqueue.h
index aba788e..e40f3cb 100644
--- a/include/mqueue.h
+++ b/include/mqueue.h
@@ -1,7 +1,9 @@
 #include <rt/mqueue.h>
 
-#if IS_IN (librt)
+#ifdef _LIBC
+# if IS_IN (librt)
 hidden_proto (mq_timedsend)
 hidden_proto (mq_timedreceive)
 hidden_proto (mq_setattr)
+# endif
 #endif
diff --git a/include/stdlib.h b/include/stdlib.h
index 734f251..a884b51 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -226,11 +226,13 @@ extern int __qfcvt_r (long double __value, int __ndigit,
 		      int *__restrict __decpt, int *__restrict __sign,
 		      char *__restrict __buf, size_t __len);
 
-# if IS_IN (libc)
-#  undef MB_CUR_MAX
-#  define MB_CUR_MAX (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX))
+# if defined _LIBC
+#  if IS_IN (libc)
+#   undef MB_CUR_MAX
+#   define MB_CUR_MAX (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX))
 
-# define __cxa_atexit(func, arg, d) INTUSE(__cxa_atexit) (func, arg, d)
+#   define __cxa_atexit(func, arg, d) INTUSE(__cxa_atexit) (func, arg, d)
+#  endif
 # endif
 
 extern void *__default_morecore (ptrdiff_t) __THROW;
-- 
1.9.3


[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined
  2014-08-28  6:55   ` [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined Siddhesh Poyarekar
@ 2014-08-28 16:58     ` Joseph S. Myers
  2014-09-01 16:59       ` [PATCH 17/19 v3] " Siddhesh Poyarekar
  2014-11-07 23:33     ` [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined Roland McGrath
  1 sibling, 1 reply; 106+ messages in thread
From: Joseph S. Myers @ 2014-08-28 16:58 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

On Thu, 28 Aug 2014, Siddhesh Poyarekar wrote:

> diff --git a/include/bits/stdlib-float.h b/include/bits/stdlib-float.h
> index 3466314..debb364 100644
> --- a/include/bits/stdlib-float.h
> +++ b/include/bits/stdlib-float.h
> @@ -1,4 +1,6 @@
>  /* No floating-point inline functions in rtld.  */
> -#if !IS_IN (rtld)
> -# include <stdlib/bits/stdlib-float.h>
> +#ifdef _LIBC
> +# if !IS_IN (rtld)
> +#  include <stdlib/bits/stdlib-float.h>
> +# endif
>  #endif

That seems wrong - it would mean that <stdlib/bits/stdlib-float.h> doesn't 
get included at all unless _LIBC.  But <stdlib/bits/stdlib-float.h> should 
be included for the conformance tests, because it would be included for a 
normal user build (by virtue of being installed as <bits/stdlib-float.h>).

So you could include this header for _ISOMAC (for example), in addition to 
a #else / #if !IS_IN (rtld) case.

> diff --git a/include/mqueue.h b/include/mqueue.h
> index aba788e..e40f3cb 100644
> --- a/include/mqueue.h
> +++ b/include/mqueue.h
> @@ -1,7 +1,9 @@
>  #include <rt/mqueue.h>
>  
> -#if IS_IN (librt)
> +#ifdef _LIBC
> +# if IS_IN (librt)
>  hidden_proto (mq_timedsend)
>  hidden_proto (mq_timedreceive)
>  hidden_proto (mq_setattr)
> +# endif
>  #endif

Normally, #ifndef _ISOMAC would be the conditional around such extra 
internal-only contents (and then #if IS_IN (librt) could go inside the 
!_ISOMAC case).

> diff --git a/include/stdlib.h b/include/stdlib.h
> index 734f251..a884b51 100644
> --- a/include/stdlib.h
> +++ b/include/stdlib.h
> @@ -226,11 +226,13 @@ extern int __qfcvt_r (long double __value, int __ndigit,
>  		      int *__restrict __decpt, int *__restrict __sign,
>  		      char *__restrict __buf, size_t __len);
>  
> -# if IS_IN (libc)
> -#  undef MB_CUR_MAX
> -#  define MB_CUR_MAX (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX))
> +# if defined _LIBC
> +#  if IS_IN (libc)
> +#   undef MB_CUR_MAX
> +#   define MB_CUR_MAX (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX))
>  
> -# define __cxa_atexit(func, arg, d) INTUSE(__cxa_atexit) (func, arg, d)
> +#   define __cxa_atexit(func, arg, d) INTUSE(__cxa_atexit) (func, arg, d)
> +#  endif
>  # endif

Why do you need this?  Aren't you already inside a !defined _ISOMAC case?

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* [PATCH 17/19 v3] Use IS_IN only when _LIBC is defined
  2014-08-28 16:58     ` Joseph S. Myers
@ 2014-09-01 16:59       ` Siddhesh Poyarekar
  2014-09-01 22:18         ` Siddhesh Poyarekar
  2014-09-17 12:55         ` [ping][PATCH 17/17 v3] Use IS_IN internally only Siddhesh Poyarekar
  0 siblings, 2 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-01 16:59 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1355 bytes --]

On Thu, Aug 28, 2014 at 04:58:26PM +0000, Joseph S. Myers wrote:
> Normally, #ifndef _ISOMAC would be the conditional around such extra 
> internal-only contents (and then #if IS_IN (librt) could go inside the 
> !_ISOMAC case).

Thanks, I wasn't clear about the _ISOMAC macro usage.  Updated patch,
no change in generated code and the conformtests are fixed.

Siddhesh
    
	* include/bits/stdlib-float.h: Use IS_IN only if _LIBC is
	defined.
	* include/mqueue.h: Likewise.
	* include/stdlib.h: Likewise.

diff --git a/include/bits/stdlib-float.h b/include/bits/stdlib-float.h
index 3466314..54ab571 100644
--- a/include/bits/stdlib-float.h
+++ b/include/bits/stdlib-float.h
@@ -1,4 +1,8 @@
-/* No floating-point inline functions in rtld.  */
-#if !IS_IN (rtld)
+/* No floating-point inline functions in rtld and for the conform tests.  */
+#ifdef _ISOMAC
 # include <stdlib/bits/stdlib-float.h>
+#else
+# if !IS_IN (rtld)
+#  include <stdlib/bits/stdlib-float.h>
+# endif
 #endif
diff --git a/include/mqueue.h b/include/mqueue.h
index aba788e..eb47b9b 100644
--- a/include/mqueue.h
+++ b/include/mqueue.h
@@ -1,7 +1,9 @@
 #include <rt/mqueue.h>
 
-#if IS_IN (librt)
+#ifndef _ISOMAC
+# if IS_IN (librt)
 hidden_proto (mq_timedsend)
 hidden_proto (mq_timedreceive)
 hidden_proto (mq_setattr)
+# endif
 #endif

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 06/19] Define IN_MODULE for translation units that define NOT_IN_libc
  2014-08-22 18:54     ` Siddhesh Poyarekar
@ 2014-09-01 17:19       ` Siddhesh Poyarekar
  2014-09-05 18:54         ` Roland McGrath
  0 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-01 17:19 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

On Sat, Aug 23, 2014 at 12:24:45AM +0530, Siddhesh Poyarekar wrote:
> On Fri, Aug 22, 2014 at 11:28:24AM -0700, Roland McGrath wrote:
> > interp.c is in fact in libc.  I don't see why libof-interp should be set at
> > all.
> 
> I remember the build breaking when I made it libc.  I'll check again,
> but I remember concluding that it couldn't be libc.

I just checked again.  The compilation always includes libc-symbols.h,
which adds symbol hacks for memcpy, memset and memmove, that become
internal references when IS_IN(libc).

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 17/19 v3] Use IS_IN only when _LIBC is defined
  2014-09-01 16:59       ` [PATCH 17/19 v3] " Siddhesh Poyarekar
@ 2014-09-01 22:18         ` Siddhesh Poyarekar
  2014-09-17 12:55         ` [ping][PATCH 17/17 v3] Use IS_IN internally only Siddhesh Poyarekar
  1 sibling, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-01 22:18 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

On Mon, Sep 01, 2014 at 10:29:30PM +0530, Siddhesh Poyarekar wrote:
> On Thu, Aug 28, 2014 at 04:58:26PM +0000, Joseph S. Myers wrote:
> > Normally, #ifndef _ISOMAC would be the conditional around such extra 
> > internal-only contents (and then #if IS_IN (librt) could go inside the 
> > !_ISOMAC case).
> 
> Thanks, I wasn't clear about the _ISOMAC macro usage.  Updated patch,
> no change in generated code and the conformtests are fixed.
> 
> Siddhesh
>     
> 	* include/bits/stdlib-float.h: Use IS_IN only if _LIBC is
> 	defined.
> 	* include/mqueue.h: Likewise.
> 	* include/stdlib.h: Likewise.

The ChangeLog is obviously wrong, it should be:

	* include/bits/stdlib-float.h [_ISOMAC || !IS_IN (rtld)]:
	Include bits/stdlib-float.h.
	* include/mqueue.h: Use internal code only when _ISOMAC is not
	defined.

> 
> diff --git a/include/bits/stdlib-float.h b/include/bits/stdlib-float.h
> index 3466314..54ab571 100644
> --- a/include/bits/stdlib-float.h
> +++ b/include/bits/stdlib-float.h
> @@ -1,4 +1,8 @@
> -/* No floating-point inline functions in rtld.  */
> -#if !IS_IN (rtld)
> +/* No floating-point inline functions in rtld and for the conform tests.  */
> +#ifdef _ISOMAC
>  # include <stdlib/bits/stdlib-float.h>
> +#else
> +# if !IS_IN (rtld)
> +#  include <stdlib/bits/stdlib-float.h>
> +# endif
>  #endif
> diff --git a/include/mqueue.h b/include/mqueue.h
> index aba788e..eb47b9b 100644
> --- a/include/mqueue.h
> +++ b/include/mqueue.h
> @@ -1,7 +1,9 @@
>  #include <rt/mqueue.h>
>  
> -#if IS_IN (librt)
> +#ifndef _ISOMAC
> +# if IS_IN (librt)
>  hidden_proto (mq_timedsend)
>  hidden_proto (mq_timedreceive)
>  hidden_proto (mq_setattr)
> +# endif
>  #endif



[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 06/19] Define IN_MODULE for translation units that define NOT_IN_libc
  2014-09-01 17:19       ` Siddhesh Poyarekar
@ 2014-09-05 18:54         ` Roland McGrath
  2014-09-05 22:50           ` Siddhesh Poyarekar
  0 siblings, 1 reply; 106+ messages in thread
From: Roland McGrath @ 2014-09-05 18:54 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

> On Sat, Aug 23, 2014 at 12:24:45AM +0530, Siddhesh Poyarekar wrote:
> > On Fri, Aug 22, 2014 at 11:28:24AM -0700, Roland McGrath wrote:
> > > interp.c is in fact in libc.  I don't see why libof-interp should be set at
> > > all.
> > 
> > I remember the build breaking when I made it libc.  I'll check again,
> > but I remember concluding that it couldn't be libc.
> 
> I just checked again.  The compilation always includes libc-symbols.h,
> which adds symbol hacks for memcpy, memset and memmove, that become
> internal references when IS_IN(libc).

I can't tell if you're saying this is an actual problem.  I don't see why
symbol-hacks.h would be a problem for interp.c.

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

* Re: [PATCH 06/19] Define IN_MODULE for translation units that define NOT_IN_libc
  2014-09-05 18:54         ` Roland McGrath
@ 2014-09-05 22:50           ` Siddhesh Poyarekar
  2014-09-05 22:54             ` Roland McGrath
  0 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-05 22:50 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Siddhesh Poyarekar, GNU C Library

On 6 September 2014 00:24, Roland McGrath <roland@hack.frob.com> wrote:
> I can't tell if you're saying this is an actual problem.  I don't see why
> symbol-hacks.h would be a problem for interp.c.

It is an actual problem.  If interp.c is built with IS_IN(libc) (or
without NOT_IN_libc in the older scheme), symbol-hacks.h injects this
code:

asm ("memmove = __GI_memmove");
asm ("memset = __GI_memset");
asm ("memcpy = __GI_memcpy");

This results in interp.os having undefined references to the __GI_mem*
functions above:

0000000000000000         *UND*  0000000000000000 __GI_memmove
0000000000000000         *UND*  0000000000000000 __GI_memset
0000000000000000         *UND*  0000000000000000 __GI_memcpy

Those symbols are not exported outside libc.so, thus resulting in a
linker error in every DSO we build, except libc.so.

Maybe the assembler should not be adding these references to the
symbol table since they're only useful if memset, memmove or memcpy
are called, but either way we'll need to work around it in libc.

Siddhesh
-- 
http://siddhesh.in

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

* Re: [PATCH 06/19] Define IN_MODULE for translation units that define NOT_IN_libc
  2014-09-05 22:50           ` Siddhesh Poyarekar
@ 2014-09-05 22:54             ` Roland McGrath
  2014-09-15  6:06               ` [PATCH] Include .interp section only for libc.so Siddhesh Poyarekar
                                 ` (2 more replies)
  0 siblings, 3 replies; 106+ messages in thread
From: Roland McGrath @ 2014-09-05 22:54 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: Siddhesh Poyarekar, GNU C Library

> Those symbols are not exported outside libc.so, thus resulting in a
> linker error in every DSO we build, except libc.so.

Oh, I see.  I'd forgotten we were using interp.c for any other libraries.
I think nowadays we actually should not be, because none of the others has
an entry point set that actually works (alas, dlfcn/eval.c is long defunct).
So let's just fix that first.

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

* [PATCH] Include .interp section only for libc.so
  2014-09-05 22:54             ` Roland McGrath
@ 2014-09-15  6:06               ` Siddhesh Poyarekar
  2014-09-15  8:19               ` Siddhesh Poyarekar
  2014-09-15  8:21               ` [PATCH] Remove CFLAGS for interp.c Siddhesh Poyarekar
  2 siblings, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-15  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: Roland McGrath, Siddhesh Poyarekar

Barring libc.so and libdl.so, none of the libraries have any entry
points, so it is pointless to add a .interp section for them.  The
libdl.so entry point (in dlfcn/eval.c) is also defunct, so remove that
file as well.

Build tested for x86_64, ppc64 and s390x.  I have not moved
CFLAGS-interp.c to CPPFLAGS-interp.c isnce I'll be removing it
completely in a follow-up patch.

Siddhesh

	* Makerules (lib%.so): Don't include $(+interp) in
	prerequisites.
	* elf/Makefile (CFLAGS-interp.c): Don't define NOT_IN_libc.
	* dlfcn/eval.c: Remove file.
---
 Makerules    |   2 +-
 dlfcn/eval.c | 200 -----------------------------------------------------------
 elf/Makefile |   3 +-
 3 files changed, 2 insertions(+), 203 deletions(-)
 delete mode 100644 dlfcn/eval.c

diff --git a/Makerules b/Makerules
index 6b30e8c..695c9ab 100644
--- a/Makerules
+++ b/Makerules
@@ -436,7 +436,7 @@ link-libc-deps = $(common-objpfx)libc.so $(common-objpfx)linkobj/libc.so \
 # $(LDLIBS-%.so) may contain -l switches to generate run-time dependencies
 # on other shared objects.  The linking with libc and ld.so is intended
 # to be as similar as possible to a default link with an installed libc.
-lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(+interp) $(link-libc-deps)
+lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(link-libc-deps)
 	$(build-shlib) $(link-libc-args)
 
 define build-shlib-helper
diff --git a/dlfcn/eval.c b/dlfcn/eval.c
deleted file mode 100644
index 9cc307a..0000000
--- a/dlfcn/eval.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/* You don't really want to know what this hack is for.
-   Copyright (C) 1996-2014 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <assert.h>
-#include <ctype.h>
-#include <dlfcn.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-static void *funcall (char **stringp) __attribute_noinline__;
-static void *eval (char **stringp);
-
-
-long int weak_function
-__strtol_internal (const char *nptr, char **endptr, int base, int group)
-{
-  unsigned long int result = 0;
-  long int sign = 1;
-
-  while (*nptr == ' ' || *nptr == '\t')
-    ++nptr;
-
-  if (*nptr == '-')
-    {
-      sign = -1;
-      ++nptr;
-    }
-  else if (*nptr == '+')
-    ++nptr;
-
-  if (*nptr < '0' || *nptr > '9')
-    {
-      if (endptr != NULL)
-	*endptr = (char *) nptr;
-      return 0L;
-    }
-
-  assert (base == 0);
-  base = 10;
-  if (*nptr == '0')
-    {
-      if (nptr[1] == 'x' || nptr[1] == 'X')
-	{
-	  base = 16;
-	  nptr += 2;
-	}
-      else
-	base = 8;
-    }
-
-  while (*nptr >= '0' && *nptr <= '9')
-    {
-      unsigned long int digval = *nptr - '0';
-      if (result > LONG_MAX / 10
-	  || (sign > 0 ? result == LONG_MAX / 10 && digval > LONG_MAX % 10
-	      : (result == ((unsigned long int) LONG_MAX + 1) / 10
-		 && digval > ((unsigned long int) LONG_MAX + 1) % 10)))
-	{
-	  errno = ERANGE;
-	  return sign > 0 ? LONG_MAX : LONG_MIN;
-	}
-      result *= base;
-      result += digval;
-      ++nptr;
-    }
-
-  return (long int) result * sign;
-}
-
-
-static void *
-funcall (char **stringp)
-{
-  void *args[strlen (*stringp)], **ap = args;
-  void *argcookie = &args[1];
-
-  do
-    {
-      /* Evaluate the next token.  */
-      *ap++ = eval (stringp);
-
-      /* Whitespace is irrelevant.  */
-      while (isspace (**stringp))
-	++*stringp;
-
-      /* Terminate at closing paren or end of line.  */
-    } while (**stringp != '\0' && **stringp != ')');
-  if (**stringp != '\0')
-    /* Swallow closing paren.  */
-    ++*stringp;
-
-  if (args[0] == NULL)
-    {
-      static const char unknown[] = "Unknown function\n";
-      write (1, unknown, sizeof unknown - 1);
-      return NULL;
-    }
-
-  /* Do it to it.  */
-  __builtin_return (__builtin_apply (args[0],
-				     &argcookie,
-				     (char *) ap - (char *) &args[1]));
-}
-
-static void *
-eval (char **stringp)
-{
-  void *value;
-  char *p = *stringp, c;
-
-  /* Whitespace is irrelevant.  */
-  while (isspace (*p))
-    ++p;
-
-  switch (*p)
-    {
-    case '"':
-      /* String constant.  */
-      value = ++p;
-      do
-	if (*p == '\\')
-	  {
-	    switch (*strcpy (p, p + 1))
-	      {
-	      case 't':
-		*p = '\t';
-		break;
-	      case 'n':
-		*p = '\n';
-		break;
-	      }
-	    ++p;
-	  }
-      while (*p != '\0' && *p++ != '"');
-      if (p[-1] == '"')
-	p[-1] = '\0';
-      break;
-
-    case '(':
-      *stringp = ++p;
-      return funcall (stringp);
-
-    default:
-      /* Try to parse it as a number.  */
-      value = (void *) __strtol_internal (p, stringp, 0, 0);
-      if (*stringp != p)
-	return value;
-
-      /* Anything else is a symbol that produces its address.  */
-      value = p;
-      do
-	++p;
-      while (*p != '\0' && !isspace (*p) && (!ispunct (*p) || *p == '_'));
-      c = *p;
-      *p = '\0';
-      value = dlsym (NULL, value);
-      *p = c;
-      break;
-    }
-
-  *stringp = p;
-  return value;
-}
-
-
-extern void _start (void) __attribute__ ((noreturn));
-void
-__attribute__ ((noreturn))
-_start (void)
-{
-  char *buf = NULL;
-  size_t bufsz = 0;
-
-  while (__getdelim (&buf, &bufsz, '\n', stdin) > 0)
-    {
-      char *p = buf;
-      eval (&p);
-    }
-
-  exit (0);
-}
diff --git a/elf/Makefile b/elf/Makefile
index 25012cc..e3bd692 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -354,8 +354,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
 	mv -f $@.new $@
 
 # interp.c exists just to get this string into the libraries.
-CFLAGS-interp.c = -D'RUNTIME_LINKER="$(rtlddir)/$(rtld-installed-name)"' \
-		  -DNOT_IN_libc=1
+CFLAGS-interp.c = -D'RUNTIME_LINKER="$(rtlddir)/$(rtld-installed-name)"'
 $(objpfx)interp.os: $(common-objpfx)config.make
 
 ifneq (ld.so,$(rtld-installed-name))
-- 
1.9.3

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

* [PATCH] Include .interp section only for libc.so
  2014-09-05 22:54             ` Roland McGrath
  2014-09-15  6:06               ` [PATCH] Include .interp section only for libc.so Siddhesh Poyarekar
@ 2014-09-15  8:19               ` Siddhesh Poyarekar
  2014-09-16 15:50                 ` Roland McGrath
  2015-06-02 18:47                 ` Dmitry V. Levin
  2014-09-15  8:21               ` [PATCH] Remove CFLAGS for interp.c Siddhesh Poyarekar
  2 siblings, 2 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-15  8:19 UTC (permalink / raw)
  To: libc-alpha; +Cc: Roland McGrath, Siddhesh Poyarekar

Barring libc.so and libdl.so, none of the libraries have any entry
points, so it is pointless to add a .interp section for them.  The
libdl.so entry point (in dlfcn/eval.c) is also defunct, so remove that
file as well.

Build tested for x86_64, ppc64 and s390x.  I have not moved
CFLAGS-interp.c to CPPFLAGS-interp.c isnce I'll be removing it
completely in a follow-up patch.

Siddhesh

	* Makerules (lib%.so): Don't include $(+interp) in
	prerequisites.
	* elf/Makefile (CFLAGS-interp.c): Don't define NOT_IN_libc.
	* dlfcn/eval.c: Remove file.
---
 Makerules    |   2 +-
 dlfcn/eval.c | 200 -----------------------------------------------------------
 elf/Makefile |   3 +-
 3 files changed, 2 insertions(+), 203 deletions(-)
 delete mode 100644 dlfcn/eval.c

diff --git a/Makerules b/Makerules
index 6b30e8c..695c9ab 100644
--- a/Makerules
+++ b/Makerules
@@ -436,7 +436,7 @@ link-libc-deps = $(common-objpfx)libc.so $(common-objpfx)linkobj/libc.so \
 # $(LDLIBS-%.so) may contain -l switches to generate run-time dependencies
 # on other shared objects.  The linking with libc and ld.so is intended
 # to be as similar as possible to a default link with an installed libc.
-lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(+interp) $(link-libc-deps)
+lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(link-libc-deps)
 	$(build-shlib) $(link-libc-args)
 
 define build-shlib-helper
diff --git a/dlfcn/eval.c b/dlfcn/eval.c
deleted file mode 100644
index 9cc307a..0000000
--- a/dlfcn/eval.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/* You don't really want to know what this hack is for.
-   Copyright (C) 1996-2014 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <assert.h>
-#include <ctype.h>
-#include <dlfcn.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-static void *funcall (char **stringp) __attribute_noinline__;
-static void *eval (char **stringp);
-
-
-long int weak_function
-__strtol_internal (const char *nptr, char **endptr, int base, int group)
-{
-  unsigned long int result = 0;
-  long int sign = 1;
-
-  while (*nptr == ' ' || *nptr == '\t')
-    ++nptr;
-
-  if (*nptr == '-')
-    {
-      sign = -1;
-      ++nptr;
-    }
-  else if (*nptr == '+')
-    ++nptr;
-
-  if (*nptr < '0' || *nptr > '9')
-    {
-      if (endptr != NULL)
-	*endptr = (char *) nptr;
-      return 0L;
-    }
-
-  assert (base == 0);
-  base = 10;
-  if (*nptr == '0')
-    {
-      if (nptr[1] == 'x' || nptr[1] == 'X')
-	{
-	  base = 16;
-	  nptr += 2;
-	}
-      else
-	base = 8;
-    }
-
-  while (*nptr >= '0' && *nptr <= '9')
-    {
-      unsigned long int digval = *nptr - '0';
-      if (result > LONG_MAX / 10
-	  || (sign > 0 ? result == LONG_MAX / 10 && digval > LONG_MAX % 10
-	      : (result == ((unsigned long int) LONG_MAX + 1) / 10
-		 && digval > ((unsigned long int) LONG_MAX + 1) % 10)))
-	{
-	  errno = ERANGE;
-	  return sign > 0 ? LONG_MAX : LONG_MIN;
-	}
-      result *= base;
-      result += digval;
-      ++nptr;
-    }
-
-  return (long int) result * sign;
-}
-
-
-static void *
-funcall (char **stringp)
-{
-  void *args[strlen (*stringp)], **ap = args;
-  void *argcookie = &args[1];
-
-  do
-    {
-      /* Evaluate the next token.  */
-      *ap++ = eval (stringp);
-
-      /* Whitespace is irrelevant.  */
-      while (isspace (**stringp))
-	++*stringp;
-
-      /* Terminate at closing paren or end of line.  */
-    } while (**stringp != '\0' && **stringp != ')');
-  if (**stringp != '\0')
-    /* Swallow closing paren.  */
-    ++*stringp;
-
-  if (args[0] == NULL)
-    {
-      static const char unknown[] = "Unknown function\n";
-      write (1, unknown, sizeof unknown - 1);
-      return NULL;
-    }
-
-  /* Do it to it.  */
-  __builtin_return (__builtin_apply (args[0],
-				     &argcookie,
-				     (char *) ap - (char *) &args[1]));
-}
-
-static void *
-eval (char **stringp)
-{
-  void *value;
-  char *p = *stringp, c;
-
-  /* Whitespace is irrelevant.  */
-  while (isspace (*p))
-    ++p;
-
-  switch (*p)
-    {
-    case '"':
-      /* String constant.  */
-      value = ++p;
-      do
-	if (*p == '\\')
-	  {
-	    switch (*strcpy (p, p + 1))
-	      {
-	      case 't':
-		*p = '\t';
-		break;
-	      case 'n':
-		*p = '\n';
-		break;
-	      }
-	    ++p;
-	  }
-      while (*p != '\0' && *p++ != '"');
-      if (p[-1] == '"')
-	p[-1] = '\0';
-      break;
-
-    case '(':
-      *stringp = ++p;
-      return funcall (stringp);
-
-    default:
-      /* Try to parse it as a number.  */
-      value = (void *) __strtol_internal (p, stringp, 0, 0);
-      if (*stringp != p)
-	return value;
-
-      /* Anything else is a symbol that produces its address.  */
-      value = p;
-      do
-	++p;
-      while (*p != '\0' && !isspace (*p) && (!ispunct (*p) || *p == '_'));
-      c = *p;
-      *p = '\0';
-      value = dlsym (NULL, value);
-      *p = c;
-      break;
-    }
-
-  *stringp = p;
-  return value;
-}
-
-
-extern void _start (void) __attribute__ ((noreturn));
-void
-__attribute__ ((noreturn))
-_start (void)
-{
-  char *buf = NULL;
-  size_t bufsz = 0;
-
-  while (__getdelim (&buf, &bufsz, '\n', stdin) > 0)
-    {
-      char *p = buf;
-      eval (&p);
-    }
-
-  exit (0);
-}
diff --git a/elf/Makefile b/elf/Makefile
index 25012cc..e3bd692 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -354,8 +354,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
 	mv -f $@.new $@
 
 # interp.c exists just to get this string into the libraries.
-CFLAGS-interp.c = -D'RUNTIME_LINKER="$(rtlddir)/$(rtld-installed-name)"' \
-		  -DNOT_IN_libc=1
+CFLAGS-interp.c = -D'RUNTIME_LINKER="$(rtlddir)/$(rtld-installed-name)"'
 $(objpfx)interp.os: $(common-objpfx)config.make
 
 ifneq (ld.so,$(rtld-installed-name))
-- 
1.9.3

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

* [PATCH] Remove CFLAGS for interp.c
  2014-09-05 22:54             ` Roland McGrath
  2014-09-15  6:06               ` [PATCH] Include .interp section only for libc.so Siddhesh Poyarekar
  2014-09-15  8:19               ` Siddhesh Poyarekar
@ 2014-09-15  8:21               ` Siddhesh Poyarekar
  2014-09-16 15:52                 ` Roland McGrath
  2015-03-02 14:57                 ` Andreas Schwab
  2 siblings, 2 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-15  8:21 UTC (permalink / raw)
  To: libc-alpha; +Cc: Roland McGrath, Siddhesh Poyarekar

Replace it with including an auto-generated linker-runtime.h.
Build-tested on x86_64 and found that there was no change in the
generated code.

	* elf/Makefile (CFLAGS-interp.c): Remove.
	($(elf-objpfx)runtime-linker.h): Generate header with linker
	path string.
	* elf/interp.c: Include generated runtime-linker.h
---
 elf/Makefile | 13 ++++++++++---
 elf/interp.c |  2 ++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/elf/Makefile b/elf/Makefile
index e3bd692..bf4fda1 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -353,9 +353,16 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
 	  | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
 	mv -f $@.new $@
 
-# interp.c exists just to get this string into the libraries.
-CFLAGS-interp.c = -D'RUNTIME_LINKER="$(rtlddir)/$(rtld-installed-name)"'
-$(objpfx)interp.os: $(common-objpfx)config.make
+# interp.c exists just to get the runtime linker path into libc.so.
+$(objpfx)interp.os: $(elf-objpfx)runtime-linker.h
+
+$(elf-objpfx)runtime-linker.h: $(elf-objpfx)runtime-linker.st; @:
+$(elf-objpfx)runtime-linker.st: $(common-objpfx)config.make
+	$(name-target-directory)
+	echo "#define RUNTIME_LINKER \"$(rtlddir)/$(rtld-installed-name)\"" \
+		> ${@:st=T}
+	$(move-if-change) ${@:st=T} ${@:st=h}
+	touch $@
 
 ifneq (ld.so,$(rtld-installed-name))
 # Make sure ld.so.1 exists in the build directory so we can link
diff --git a/elf/interp.c b/elf/interp.c
index 49c92f5..a2492bf 100644
--- a/elf/interp.c
+++ b/elf/interp.c
@@ -16,5 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <elf/runtime-linker.h>
+
 const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp")))
   = RUNTIME_LINKER;
-- 
1.9.3

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

* Re: [PATCH] Include .interp section only for libc.so
  2014-09-15  8:19               ` Siddhesh Poyarekar
@ 2014-09-16 15:50                 ` Roland McGrath
  2015-06-02 18:47                 ` Dmitry V. Levin
  1 sibling, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-09-16 15:50 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

> 	* Makerules (lib%.so): Don't include $(+interp) in
> 	prerequisites.
> 	* elf/Makefile (CFLAGS-interp.c): Don't define NOT_IN_libc.

OK.

> 	* dlfcn/eval.c: Remove file.

Sniff.  Sigh.  OK.

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

* Re: [PATCH] Remove CFLAGS for interp.c
  2014-09-15  8:21               ` [PATCH] Remove CFLAGS for interp.c Siddhesh Poyarekar
@ 2014-09-16 15:52                 ` Roland McGrath
  2015-03-02 14:57                 ` Andreas Schwab
  1 sibling, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-09-16 15:52 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

> +	echo "#define RUNTIME_LINKER \"$(rtlddir)/$(rtld-installed-name)\"" \

Since there is nothing at sh level that should be expanded inside the
string, I'd use single quotes (and thus no need for \ on the inner ").

Otherwise good.

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

* [PATCH v2 06/19] Define IN_MODULE for translation units that define NOT_IN_libc
  2014-08-21 10:58 ` [PATCH 06/19] Define IN_MODULE for translation units that define NOT_IN_libc Siddhesh Poyarekar
  2014-08-22 18:28   ` Roland McGrath
@ 2014-09-17 12:29   ` Siddhesh Poyarekar
  2014-09-24  9:07     ` [ping][PATCH " Siddhesh Poyarekar
  2014-11-07 23:23     ` [PATCH " Roland McGrath
  1 sibling, 2 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-17 12:29 UTC (permalink / raw)
  To: libc-alpha; +Cc: Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

Hi,

I have now rebased this patch against the current master.  interp.c
does not need the CPPFLAGS anymore, so sotruss-lib is the only code to
be built as extramodules to eventually replace the NOT_IN_libc macro.

Build tested on x86_64 to ensure that the generated code is unchanged.

Siddhesh

    	* elf/Makefile (libof-sotruss-lib): Set as extramodules.

diff --git a/elf/Makefile b/elf/Makefile
index 677635b..7a5a9aa 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -96,6 +96,7 @@ extra-objs += sotruss-lib.os sotruss-lib.so
 install-others += $(inst_auditdir)/sotruss-lib.so
 install-bin-script += sotruss
 generated += sotruss
+libof-sotruss-lib = extramodules
 CPPFLAGS-sotruss-lib = -DNOT_IN_libc
 $(objpfx)sotruss-lib.so: $(objpfx)sotruss-lib.os
 	$(build-module-asneeded)

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [ping][PATCH 01/19 v2] Add new macro IN_MODULE to identify module in which source is built
  2014-08-27 17:19     ` [PATCH 01/19 v2] " Siddhesh Poyarekar
@ 2014-09-17 12:38       ` Siddhesh Poyarekar
  2014-09-24  9:06         ` [ping2][PATCH " Siddhesh Poyarekar
  2014-10-01  8:16         ` [ping3][PATCH " Siddhesh Poyarekar
  0 siblings, 2 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-17 12:38 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 19249 bytes --]

Resending patch after rebasing on top of latest master.  There are no
changes to the patch.  Verified once again that the generated code is
unchanged on x86_64.

Siddhesh

On Wed, Aug 27, 2014 at 10:49:16PM +0530, Siddhesh Poyarekar wrote:
> Here's a second version of this patch with the useless boilerplate
> code removed since extra-lib should have taken care of it.  I couldn't
> replace the remaining instances of cppflags-iterator inclusions with
> simple variable assignments because there were a couple of cases that
> would make it hard to implement.
> 
> Verified that the generated code remains the same on x86_64.  I have
> build tests for other architectures running (for all patches) but
> they'll probably take till tomorrow to complete.



From 92c41887b588cb3a3bed8538d2f6b903c1db3715 Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Thu, 21 Aug 2014 10:19:31 +0530
Subject: [PATCH] Add new macro IN_MODULE to identify module in which source is
 built

The current scheme to identify which module a translation unit is
built in depends on defining multiple macros IS_IN_* and also defining
NOT_IN_libc if we're building a non-libc module.  In addition, there
is an IN_LIB macro that does effectively the same thing, but for
different modules (notably the systemtap probes).  This macro scheme
unifies both ideas to use just one macro IN_MODULE and assign it a
value depending on the module it is being built into.  If the module
is not defined, it defaults to MODULE_libc.

Patches that follow will remove uses of IS_IN_* variables with the
IS_IN() macro.  libc-symbols.h has been converted already to give an
example of how such a transition will look.

Verified that there are no relevant source changes.  One source change
that will crop up repeatedly is that of nscd_stat, since it uses the
build timestamp as a constant in its logic.

	* Makeconfig (in-module): Get value of libof set for the
	translation unit.
	(module-def): Set IN_MODULE based on value of libof-*.
	(CPPFLAGS): Add $(module-def) to CPPFLAGS.
	* Makerules: Don't suffix routine names for nonlib.
	* include/libc-modules.h: New file.
	* include/libc-symbols.h: Include libc-modules.h
	(IS_IN): New macro to replace IS_IN_* macros.
	* elf/Makefile: Set libof-* for each routine.
	* elf/rtld-Rules: Likewise.
	* extra-modules.mk: Likewise.
	* iconv/Makefile: Likewise.
	* iconvdata/Makefile: Likewise.
	* locale/Makefile: Likewise.
	* malloc/Makefile: Likewise.
	* nss/Makefile: Likewise.
	* sysdeps/gnu/Makefile: Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile: Likewise.
	* sysdeps/unix/sysv/linux/Makefile: Likewise.
	* sysdeps/s390/s390-64/Makefile: Likewise.
	* nscd/Makefile: Set libof-* for each routine.  Set CFLAGS and
	CPPFLAGS for nscd instead of nonlib.
---
 Makeconfig                       |  7 ++++++-
 Makerules                        |  2 +-
 elf/Makefile                     |  7 ++++++-
 elf/rtld-Rules                   |  5 +++++
 extra-modules.mk                 |  1 +
 iconv/Makefile                   | 11 ++++++-----
 iconvdata/Makefile               |  6 ++++++
 include/libc-modules.h           | 37 +++++++++++++++++++++++++++++++++++++
 include/libc-symbols.h           | 24 ++++++++++++++----------
 locale/Makefile                  |  8 ++++----
 mach/Machrules                   |  1 +
 malloc/Makefile                  |  5 +++++
 nscd/Makefile                    | 13 ++++++-------
 nss/Makefile                     |  3 ++-
 stdlib/Makefile                  |  1 +
 sysdeps/gnu/Makefile             |  2 ++
 sysdeps/s390/s390-64/Makefile    |  4 ++++
 sysdeps/unix/sysv/linux/Makefile |  1 +
 18 files changed, 108 insertions(+), 30 deletions(-)
 create mode 100644 include/libc-modules.h

diff --git a/Makeconfig b/Makeconfig
index fad2971..5c85b81 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -813,6 +813,11 @@ endif	# $(+cflags) == ""
 # of many little headers in the include directory.
 libio-include = -I$(..)libio
 
+in-module = $(strip $(foreach lib,$(libof-$(basename $(@F))) $(libof-$(<F)) \
+				  $(libof-$(@F)),-DIN_MODULE=MODULE_$(lib)))
+
+module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
+
 # These are the variables that the implicit compilation rules use.
 # Note that we can't use -std=* in CPPFLAGS, because it overrides
 # the implicit -lang-asm and breaks cpp behavior for .S files--notably
@@ -821,7 +826,7 @@ CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
 	   $($(subdir)-CPPFLAGS) \
 	   $(+includes) $(defines) \
 	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
-	   $(CPPFLAGS-$(suffix $@)) \
+	   $(CPPFLAGS-$(suffix $@)) $(module-def) \
 	   $(foreach lib,$(libof-$(basename $(@F))) \
 			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
diff --git a/Makerules b/Makerules
index 12d01ee..4594d3b 100644
--- a/Makerules
+++ b/Makerules
@@ -1156,7 +1156,7 @@ xcheck: xtests
 
 all-nonlib = $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) $(others))
 ifneq (,$(all-nonlib))
-cpp-srcs-left = $(all-nonlib:=.c) $(all-nonlib:=.cc)
+cpp-srcs-left = $(all-nonlib)
 lib := nonlib
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 endif
diff --git a/elf/Makefile b/elf/Makefile
index 94074f3..6263a47 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -436,7 +436,8 @@ $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
 
 SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
 CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
-		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
+		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1 -DNOT_IN_libc=1
+libof-ldconfig = ldconfig
 CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
 CFLAGS-cache.c = $(SYSCONF-FLAGS)
 CFLAGS-rtld.c = $(SYSCONF-FLAGS)
@@ -444,6 +445,10 @@ CFLAGS-rtld.c = $(SYSCONF-FLAGS)
 CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
 		     -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
 
+cpp-srcs-left := $(all-rtld-routines:=.os)
+lib := rtld
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
 generated += $(addsuffix .so,$(strip $(modules-names)))
 
diff --git a/elf/rtld-Rules b/elf/rtld-Rules
index 0a5d6af..4d78d90 100644
--- a/elf/rtld-Rules
+++ b/elf/rtld-Rules
@@ -138,6 +138,11 @@ ifdef rtld-depfiles
 -include $(rtld-depfiles)
 endif
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(subst .os,,$(rtld-modules))
+lib := rtld
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 # This here is the whole point of all the shenanigans.
 rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld
 
diff --git a/extra-modules.mk b/extra-modules.mk
index c7ed850..9c2e4d2 100644
--- a/extra-modules.mk
+++ b/extra-modules.mk
@@ -6,4 +6,5 @@
 module := $(firstword $(extra-modules-left))
 extra-modules-left := $(filter-out $(module),$(extra-modules-left))
 
+libof-$(notdir $(module)) := extramodules
 CPPFLAGS-$(module).c += -DNOT_IN_libc
diff --git a/iconv/Makefile b/iconv/Makefile
index 48d17d7..8031a88 100644
--- a/iconv/Makefile
+++ b/iconv/Makefile
@@ -52,11 +52,12 @@ CFLAGS-gconv_cache.c += -DGCONV_DIR='"$(gconvdir)"'
 CFLAGS-gconv_conf.c = -DGCONV_PATH='"$(gconvdir)"'
 CFLAGS-iconvconfig.c = -DGCONV_PATH='"$(gconvdir)"' -DGCONV_DIR='"$(gconvdir)"'
 
-CPPFLAGS-iconv_charmap = -DNOT_IN_libc
-CPPFLAGS-linereader = -DNOT_IN_libc
-CPPFLAGS-strtab = -DNOT_IN_libc
-CPPFLAGS-charmap = -DNOT_IN_libc
-CPPFLAGS-charmap-dir = -DNOT_IN_libc
+CPPFLAGS-iconvprogs = -DNOT_IN_libc
+
+# Set libof-* for each routine.
+cpp-srcs-left := $(iconv_prog-modules) $(iconvconfig-modules)
+lib := iconvprogs
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
 ifeq ($(run-built-tests),yes)
 xtests-special += $(objpfx)test-iconvconfig.out
diff --git a/iconvdata/Makefile b/iconvdata/Makefile
index b6327d6..e0252ee 100644
--- a/iconvdata/Makefile
+++ b/iconvdata/Makefile
@@ -211,6 +211,7 @@ $(objpfx)iconv-rules: Makefile
 	$(AWK) 'NR == 1 { \
 		  for (i = 1; i <= NF; i++) { \
 		    printf "%s-routines := %s\n", $$i, tolower($$i); \
+		    printf "libof-%s := iconvdata\n", tolower($$i); \
 		    printf "%s-map := gconv.map\n", $$i; \
 		  } \
 		}; \
@@ -273,6 +274,11 @@ endif
 
 include ../Rules
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(modules) $(generated-modules)
+lib := iconvdata
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 tst-loading-ENV = MALLOC_TRACE=$(objpfx)tst-loading.mtrace
 $(objpfx)mtrace-tst-loading.out: $(objpfx)tst-loading.out
 	$(common-objpfx)malloc/mtrace $(objpfx)tst-loading.mtrace > $@; \
diff --git a/include/libc-modules.h b/include/libc-modules.h
new file mode 100644
index 0000000..d12fb90
--- /dev/null
+++ b/include/libc-modules.h
@@ -0,0 +1,37 @@
+#define MODULE_libc		1
+#define MODULE_libpthread	2
+#define MODULE_rtld		3
+#define MODULE_libdl		4
+#define MODULE_libm		5
+#define MODULE_iconvprogs	6
+#define MODULE_iconvdata	7
+#define MODULE_lddlibc4		8
+#define MODULE_locale_programs	9
+#define MODULE_memusagestat	10
+#define MODULE_libutil		12
+#define MODULE_libBrokenLocale	13
+#define MODULE_libmemusage	15
+#define MODULE_libresolv	16
+#define MODULE_libnss_db	17
+#define MODULE_libnss_files	18
+#define	MODULE_libnss_dns	19
+#define MODULE_libnss_compat	20
+#define MODULE_libnss_hesiod	21
+#define MODULE_libnss_nis	22
+#define MODULE_libnss_nisplus	23
+#define MODULE_libanl		24
+#define MODULE_librt		25
+#define MODULE_libSegFault	26
+#define MODULE_libthread_db	27
+#define MODULE_libcidn		28
+#define MODULE_libcrypt		29
+#define MODULE_libnsl		30
+#define MODULE_libpcprofile	31
+#define MODULE_librpcsvc	32
+#define MODULE_nscd		33
+#define MODULE_ldconfig 	34
+#define MODULE_libnldbl 	35
+
+/* Catch-all for test modules and other binaries.  */
+#define MODULE_nonlib		98
+#define MODULE_extramodules	99
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index d4ab1f3..131d7eb 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -20,6 +20,10 @@
 #ifndef _LIBC_SYMBOLS_H
 #define _LIBC_SYMBOLS_H	1
 
+#include "libc-modules.h"
+
+#define IS_IN(lib) (IN_MODULE == MODULE_##lib)
+
 /* This file's macros are included implicitly in the compilation of every
    file in the C library by -imacros.
 
@@ -468,7 +472,7 @@ for linking")
    If the function should be internal to multiple objects, say ld.so and
    libc.so, the best way is to use:
 
-   #if !defined NOT_IN_libc || defined IS_IN_rtld
+   #if IS_IN (libc) || IS_IN (rtld)
    hidden_proto (foo)
    #endif
 
@@ -584,7 +588,7 @@ for linking")
 # define libc_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
 # define rtld_hidden_def(name) hidden_def (name)
@@ -604,7 +608,7 @@ for linking")
 # define rtld_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libm_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
 # define libm_hidden_def(name) hidden_def (name)
@@ -624,7 +628,7 @@ for linking")
 # define libm_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libresolv
+#if IS_IN (libresolv)
 # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libresolv_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -645,7 +649,7 @@ for linking")
 # define libresolv_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_librt
+#if IS_IN (librt)
 # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define librt_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -666,7 +670,7 @@ for linking")
 # define librt_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libdl
+#if IS_IN (libdl)
 # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libdl_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -687,7 +691,7 @@ for linking")
 # define libdl_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libnss_files
+#if IS_IN (libnss_files)
 # define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libnss_files_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -708,7 +712,7 @@ for linking")
 # define libnss_files_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libnsl
+#if IS_IN (libnsl)
 # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libnsl_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -729,7 +733,7 @@ for linking")
 # define libnsl_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libnss_nisplus
+#if IS_IN (libnss_nisplus)
 # define libnss_nisplus_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libnss_nisplus_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -758,7 +762,7 @@ for linking")
 # define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name)
 #endif
 
-#ifdef IS_IN_libutil
+#if IS_IN (libutil)
 # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libutil_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
diff --git a/locale/Makefile b/locale/Makefile
index e4c3878..5cd18e0 100644
--- a/locale/Makefile
+++ b/locale/Makefile
@@ -85,7 +85,7 @@ locale-CPPFLAGS = -DLOCALEDIR='"$(localedir)"' \
 		  -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \
 		  -Iprograms
 
-CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
+CPPFLAGS-locale_programs = -DLOCALE_PATH='$(localepath)' \
 			   -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
 			   -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
 			   -DLOCSRCDIR='"$(i18ndir)/locales"' \
@@ -96,7 +96,7 @@ CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-charmap-dir.c = -Wno-write-strings
 
 # This makes sure -DNOT_IN_libc et al are passed for all these modules.
-cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \
-				$(locale-modules) $(lib-modules))
-lib := locale-programs
+cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
+		 $(lib-modules)
+lib := locale_programs
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
diff --git a/mach/Machrules b/mach/Machrules
index 8b35cf6..632f5f4 100644
--- a/mach/Machrules
+++ b/mach/Machrules
@@ -226,6 +226,7 @@ extra-libs += $(interface-library)
 extra-libs-others += $(interface-library)
 
 ifeq (yes,$(build-shared))
+
 interface.so = $(interface-library:=.so)
 
 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
diff --git a/malloc/Makefile b/malloc/Makefile
index 9e93523..fbfada2 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -89,6 +89,11 @@ endif
 do-memusagestat: $(objpfx)memusagestat
 
 memusagestat-modules = memusagestat
+
+cpp-srcs-left := $(memusagestat-modules)
+lib := memusagestat
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 $(objpfx)memusagestat: $(memusagestat-modules:%=$(objpfx)%.o)
 	$(LINK.o) -o $@ $^ $(libgd-LDFLAGS) -lgd -lpng -lz -lm
 
diff --git a/nscd/Makefile b/nscd/Makefile
index 639d87b..7ab4e9d 100644
--- a/nscd/Makefile
+++ b/nscd/Makefile
@@ -79,23 +79,22 @@ CFLAGS-nscd_gethst_r.c = -fexceptions
 CFLAGS-nscd_getai.c = -fexceptions
 CFLAGS-nscd_initgroups.c = -fexceptions
 
-CPPFLAGS-nonlib += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2
+CPPFLAGS-nscd += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2 -DNOT_IN_libc=1
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
-CFLAGS-nonlib += $(pie-ccflag)
+CFLAGS-nscd += $(pie-ccflag)
 endif
 ifeq (yes,$(have-ssp))
-CFLAGS-nonlib += -fstack-protector
+CFLAGS-nscd += -fstack-protector
 endif
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
 LDFLAGS-nscd = -Wl,-z,now
 endif
 
-# This makes sure CPPFLAGS-nonlib and CFLAGS-nonlib are passed
-# for all these modules.
-cpp-srcs-left := $(nscd-modules:=.c)
-lib := nonlib
+# Set libof-nscd.
+cpp-srcs-left := $(nscd-modules)
+lib := nscd
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
 $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
diff --git a/nss/Makefile b/nss/Makefile
index 1fa7f1f..7114d74 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -105,7 +105,8 @@ $(objpfx)makedb: $(makedb-modules:%=$(objpfx)%.o)
 $(inst_vardbdir)/Makefile: db-Makefile $(+force)
 	$(do-install)
 
-CFLAGS-nss_test1.c = -DNOT_IN_libc=1
+libof-nss_test1 = extramodules
+CPPFLAGS-nss_test1 = -DNOT_IN_libc=1
 $(objpfx)/libnss_test1.so: $(objpfx)nss_test1.os $(link-libc-deps)
 	$(build-module)
 ifdef libnss_test1.so-version
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 9b2271b..da6e076 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -145,6 +145,7 @@ LDFLAGS-tst-putenv = $(no-as-needed)
 
 $(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os $(link-libc-deps)
 	$(build-module)
+libof-tst-putenvmod = extramodules
 CFLAGS-tst-putenvmod.c = -DNOT_IN_libc=1
 
 $(objpfx)bug-getcontext: $(libm)
diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
index c05708d..b5b2cf0 100644
--- a/sysdeps/gnu/Makefile
+++ b/sysdeps/gnu/Makefile
@@ -29,6 +29,8 @@ ifeq ($(subdir),stdio-common)
 
 errlist-c = $(firstword $(wildcard $(addsuffix /errlist.c,$(sysdirs) .)))
 
+libof-errlist-compat = extramodules
+
 ifeq ($(build-shared),yes)
 $(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \
 			   $(common-objpfx)Versions.v.i $(before-compile)
diff --git a/sysdeps/s390/s390-64/Makefile b/sysdeps/s390/s390-64/Makefile
index fe5030e..ce4f0c5 100644
--- a/sysdeps/s390/s390-64/Makefile
+++ b/sysdeps/s390/s390-64/Makefile
@@ -28,6 +28,10 @@ s390x-iconv-modules = ISO-8859-1_CP037_Z900 UTF8_UTF16_Z9 UTF16_UTF32_Z9 UTF8_UT
 extra-modules-left += $(s390x-iconv-modules)
 include extra-module.mk
 
+cpp-srcs-left := $(foreach mod,$(s390x-iconv-modules),$($(mod)-routines))
+lib := iconvdata
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 extra-objs      += $(addsuffix .so, $(s390x-iconv-modules))
 install-others  += $(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules))
 
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 9ad6d22..2d6d8bb 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -178,6 +178,7 @@ ifeq ($(subdir),elf)
 sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \
 			dl-fxstatat64
 
+libof-lddlibc4 = lddlibc4
 CPPFLAGS-lddlibc4 += -DNOT_IN_libc
 
 others += pldd
-- 
1.9.3

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [ping][PATCH 03/19 v2] Auto-generate libc-modules.h
  2014-08-28  6:11   ` [PATCH 03/19 v2] " Siddhesh Poyarekar
@ 2014-09-17 12:43     ` Siddhesh Poyarekar
  2014-09-24  9:06       ` [ping2][PATCH " Siddhesh Poyarekar
  0 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-17 12:43 UTC (permalink / raw)
  To: libc-alpha; +Cc: Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 10441 bytes --]

Rebased on top of current master.  No changes to the patch.

Siddhesh

On Thu, Aug 28, 2014 at 11:41:28AM +0530, Siddhesh Poyarekar wrote:
> Here's an updated patch to autogenerate libc-modules.h.  I now include
> libc-symbols.h everywhere like before, so all of the %.v.i files can
> once again use the macros libc-symbols.h defines.  To break the
> circular dependency with shlib-versions, I include libc-modules.h in
> the commandline instead of in libc-symbols.h and I don't include it
> for shlib-versions.v.i and Versions.v.i.

From 1aefedff6666344d5368b82ca0f53f6dec9e7056 Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Thu, 21 Aug 2014 11:44:54 +0530
Subject: [PATCH] Auto-generate libc-modules.h

Remove libc-modules.h from the tree and auto-generate it from
soversions.i and a new file build.list.  Macros generated from
soversions.i have lower values starting from 1, while those from
build.list start from a special value MODULE_OTHER_BEGIN, which has a
high enough value (1000).  This allows us to conveniently
differentiate between the versioned libraries and other built modules,
which is needed in errno.h and netdb.h to decide whether to use an
internal symbol or an external one.

Verified that generated code remains unchanged on x86_64.

	* Makeconfig (module-cppflags): Include libc-modules.h for
	everything except shlib-versions.v.i.
	(CPPFLAGS): Use it.
	(before-compile): Add libc-modules.h.
	($(common-objpfx)libc-modules.h,
	$(common-objpfx)libc-modules.stmp): New targets.
	(common-generated): Add libc-modules.h and libc-modules.stmp.
	($(common-objpfx)Versions.v.i): Depend on libc-modules.h.
	* build.list: New file.
	* include/libc-symbols.h: Don't include libc-modules.h.
	* include/libc-modules.h: Remove file.
	* scripts/gen-libc-modules.awk: New script to generate
	libc-modules.h.
	* sysdeps/unix/Makefile ($(common-objpfx)sysd-syscalls):
	Depend on libc-modules.stmp.
---
 Makeconfig                   | 44 +++++++++++++++++++++++++++++++++++++++-----
 build.list                   | 15 +++++++++++++++
 include/libc-modules.h       | 37 -------------------------------------
 include/libc-symbols.h       |  2 --
 scripts/gen-libc-modules.awk | 40 ++++++++++++++++++++++++++++++++++++++++
 sysdeps/unix/Makefile        |  3 ++-
 6 files changed, 96 insertions(+), 45 deletions(-)
 create mode 100644 build.list
 delete mode 100644 include/libc-modules.h
 create mode 100644 scripts/gen-libc-modules.awk

diff --git a/Makeconfig b/Makeconfig
index 5c85b81..9ce7287 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -813,10 +813,22 @@ endif	# $(+cflags) == ""
 # of many little headers in the include directory.
 libio-include = -I$(..)libio
 
+# We don't include libc-modules.h when these targets are being built.  These
+# targets don't (and will likely never need to) use the IS_IN facility.  In
+# fact, shlib-versions should not use it because that will create a circular
+# dependency as libc-modules.h is generated from shlib-versions.
+skip-module-cppflags = shlib-versions.v.i Versions.v.i
+
 in-module = $(strip $(foreach lib,$(libof-$(basename $(@F))) $(libof-$(<F)) \
 				  $(libof-$(@F)),-DIN_MODULE=MODULE_$(lib)))
 
 module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
+module-cppflags-real = -include $(common-objpfx)libc-modules.h $(module-def)
+
+# We don't need libc-modules.h and the IN_MODULE definition for
+# shlib-version.v.i.
+module-cppflags = $(if $(filter $(@F),$(skip-module-cppflags)), \
+		       ,$(module-cppflags-real))
 
 # These are the variables that the implicit compilation rules use.
 # Note that we can't use -std=* in CPPFLAGS, because it overrides
@@ -824,9 +836,9 @@ module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
 # it causes cpp to stop predefining __ASSEMBLER__.
 CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
 	   $($(subdir)-CPPFLAGS) \
-	   $(+includes) $(defines) \
+	   $(+includes) $(defines) $(module-cppflags) \
 	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
-	   $(CPPFLAGS-$(suffix $@)) $(module-def) \
+	   $(CPPFLAGS-$(suffix $@)) \
 	   $(foreach lib,$(libof-$(basename $(@F))) \
 			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
@@ -986,9 +998,12 @@ endif
 postclean-generated += soversions.mk soversions.i \
 		       shlib-versions.v shlib-versions.v.i
 
-# Generate the header containing the names of all shared libraries.
+# Generate a header containing the names of all shared libraries and another
+# one containing macros that comprise valid values for the IN_MODULE and
+# MODULE_NAME macros..
 # We use a stamp file to avoid unnecessary recompilations.
-before-compile += $(common-objpfx)gnu/lib-names.h
+before-compile += $(common-objpfx)gnu/lib-names.h \
+		  $(common-objpfx)libc-modules.h
 ifeq ($(soversions.mk-done),t)
 $(common-objpfx)gnu/lib-names.h: $(common-objpfx)gnu/lib-names.stmp; @:
 $(common-objpfx)gnu/lib-names.stmp: $(..)scripts/lib-names.awk \
@@ -1021,9 +1036,28 @@ $(common-objpfx)gnu/lib-names.stmp: $(..)scripts/lib-names.awk \
 	} >  ${@:stmp=T}
 	$(move-if-change) ${@:stmp=T} ${@:stmp=h}
 	touch $@
+
+# Generate a header with macro definitions for use with the IS_IN macro.
+# These are the possible values for the IN_MODULE macro defined when building
+# sources, to identify which module the translation unit is going to be built
+# into.  This needs to be one of the first headers to be generated since
+# everything uses it.  We work around a one-time circular dependency with
+# sysd-rules by touching an empty header file since the sysd-rules don't use
+# the IN_MODULE macros even though it is defined in the compile command.  This
+# is only necessary the first time, i.e. when there is no
+# include/libc-modules.h.
+$(common-objpfx)libc-modules.h: $(common-objpfx)libc-modules.stmp; @:
+$(common-objpfx)libc-modules.stmp: $(..)scripts/gen-libc-modules.awk \
+				   $(common-objpfx)soversions.i \
+				   $(..)build.list
+	$(AWK) -f $^ > ${@:stmp=T}
+	$(move-if-change) ${@:stmp=T} ${@:stmp=h}
+	touch $@
+
 endif
 
-common-generated += gnu/lib-names.h gnu/lib-names.stmp
+common-generated += gnu/lib-names.h gnu/lib-names.stmp libc-modules.h \
+		    libc-modules.stmp
 
 # The name under which the run-time dynamic linker is installed.
 # We are currently going for the convention that `/lib/ld.so.1'
diff --git a/build.list b/build.list
new file mode 100644
index 0000000..eab57c7
--- /dev/null
+++ b/build.list
@@ -0,0 +1,15 @@
+iconvprogs
+iconvdata
+ldconfig
+lddlibc4
+libmemusage
+libSegFault
+libpcprofile
+librpcsvc
+libutil
+locale_programs
+memusagestat
+nonlib
+nscd
+extramodules
+libnldbl
diff --git a/include/libc-modules.h b/include/libc-modules.h
deleted file mode 100644
index d12fb90..0000000
--- a/include/libc-modules.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#define MODULE_libc		1
-#define MODULE_libpthread	2
-#define MODULE_rtld		3
-#define MODULE_libdl		4
-#define MODULE_libm		5
-#define MODULE_iconvprogs	6
-#define MODULE_iconvdata	7
-#define MODULE_lddlibc4		8
-#define MODULE_locale_programs	9
-#define MODULE_memusagestat	10
-#define MODULE_libutil		12
-#define MODULE_libBrokenLocale	13
-#define MODULE_libmemusage	15
-#define MODULE_libresolv	16
-#define MODULE_libnss_db	17
-#define MODULE_libnss_files	18
-#define	MODULE_libnss_dns	19
-#define MODULE_libnss_compat	20
-#define MODULE_libnss_hesiod	21
-#define MODULE_libnss_nis	22
-#define MODULE_libnss_nisplus	23
-#define MODULE_libanl		24
-#define MODULE_librt		25
-#define MODULE_libSegFault	26
-#define MODULE_libthread_db	27
-#define MODULE_libcidn		28
-#define MODULE_libcrypt		29
-#define MODULE_libnsl		30
-#define MODULE_libpcprofile	31
-#define MODULE_librpcsvc	32
-#define MODULE_nscd		33
-#define MODULE_ldconfig 	34
-#define MODULE_libnldbl 	35
-
-/* Catch-all for test modules and other binaries.  */
-#define MODULE_nonlib		98
-#define MODULE_extramodules	99
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 131d7eb..9b8208b 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -20,8 +20,6 @@
 #ifndef _LIBC_SYMBOLS_H
 #define _LIBC_SYMBOLS_H	1
 
-#include "libc-modules.h"
-
 #define IS_IN(lib) (IN_MODULE == MODULE_##lib)
 
 /* This file's macros are included implicitly in the compilation of every
diff --git a/scripts/gen-libc-modules.awk b/scripts/gen-libc-modules.awk
new file mode 100644
index 0000000..d3382b6
--- /dev/null
+++ b/scripts/gen-libc-modules.awk
@@ -0,0 +1,40 @@
+# Generate a header file that defines the MODULE_* macros for each library and
+# module we build in glibc.  The library names are pulled in from soversions.i
+# and the additional modules are mentioned one-per-line in build.list.
+BEGIN {
+  PROCINFO["sorted_in"] = "@val_type_asc"
+  shlibs = 1
+  others = 1000
+  libs["OTHERS_BEGIN"] = others++
+}
+
+# Skip over comments.
+$1 == "#" {
+  next
+}
+
+# build.list is simply one module per line.
+match (FILENAME, ".*build.list") {
+  libs[$0] = others++
+}
+
+# We have only one special case in soversions.i parsing, which is to replace ld
+# with rtld since that's what we call it throughout the sources.
+match (FILENAME, ".*soversions.i") {
+  name = $2
+  if (name == "ld")
+    name = "rtld"
+
+  if (!(name in libs)) {
+    libs[name] = shlibs++
+  }
+}
+
+# Finally, print out the header file.
+END {
+  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n\n")
+  i = 1
+  for (l in libs) {
+    printf ("#define MODULE_%s %d\n", l, libs[l])
+  }
+}
diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile
index 0e535b6..573e90d 100644
--- a/sysdeps/unix/Makefile
+++ b/sysdeps/unix/Makefile
@@ -79,7 +79,8 @@ compile-syscall = $(COMPILE.S) -o $@ -x assembler-with-cpp - \
 
 ifndef avoid-generated
 $(common-objpfx)sysd-syscalls: $(..)sysdeps/unix/make-syscalls.sh \
-			       $(wildcard $(+sysdep_dirs:%=%/syscalls.list))
+			       $(wildcard $(+sysdep_dirs:%=%/syscalls.list)) \
+			       $(common-objpfx)libc-modules.stmp
 	for dir in $(+sysdep_dirs); do \
 	  test -f $$dir/syscalls.list && \
 	  { sysdirs='$(sysdirs)' \
-- 
1.9.3


[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [ping][PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB
  2014-08-21 10:58 ` [PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB Siddhesh Poyarekar
@ 2014-09-17 12:47   ` Siddhesh Poyarekar
  2014-09-24  9:07     ` [ping2][PATCH " Siddhesh Poyarekar
                       ` (2 more replies)
  0 siblings, 3 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-17 12:47 UTC (permalink / raw)
  To: libc-alpha; +Cc: Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 2533 bytes --]

Rebased on top of latest master.  No changes to the patch.

Siddhesh

From b3ae47d0b34aa5d0366cf27cb944aa008e069186 Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Thu, 21 Aug 2014 11:55:35 +0530
Subject: [PATCH] Use MODULE_NAME in stap-probe instead of IN_LIB

Verified that the generated code is unchanged on x86_64.

	* scripts/gen-libc-modules.awk (END): Generate defines for
	MODULE_NAME.
	* include/stap-probe.h (LIBC_PROBE_1): Use MODULE_NAME instead
	of IN_LIB.
	(STAP_PROBE_ASM): Likewise.
---
 include/stap-probe.h         | 6 +++---
 scripts/gen-libc-modules.awk | 9 ++++++++-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/include/stap-probe.h b/include/stap-probe.h
index 688646c..150fc1e 100644
--- a/include/stap-probe.h
+++ b/include/stap-probe.h
@@ -30,7 +30,7 @@
 
    Systemtap's header defines the macros STAP_PROBE (provider, name) and
    STAP_PROBEn (provider, name, arg1, ..., argn).  For "provider" we paste
-   in the IN_LIB name (libc, libpthread, etc.) automagically.
+   in MODULE_NAME (libc, libpthread, etc.) automagically.
 
    The format of the arg parameters is discussed here:
 
@@ -53,7 +53,7 @@
 # endif
 
 # define LIBC_PROBE(name, n, ...)	\
-  LIBC_PROBE_1 (IN_LIB, name, n, ## __VA_ARGS__)
+  LIBC_PROBE_1 (MODULE_NAME, name, n, ## __VA_ARGS__)
 
 # define LIBC_PROBE_1(lib, name, n, ...) \
   STAP_PROBE##n (lib, name, ## __VA_ARGS__)
@@ -61,7 +61,7 @@
 # define STAP_PROBE0		STAP_PROBE
 
 # define LIBC_PROBE_ASM(name, template) \
-  STAP_PROBE_ASM (IN_LIB, name, template)
+  STAP_PROBE_ASM (MODULE_NAME, name, template)
 
 # define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS
 
diff --git a/scripts/gen-libc-modules.awk b/scripts/gen-libc-modules.awk
index d3382b6..1ae4af3 100644
--- a/scripts/gen-libc-modules.awk
+++ b/scripts/gen-libc-modules.awk
@@ -32,9 +32,16 @@ match (FILENAME, ".*soversions.i") {
 
 # Finally, print out the header file.
 END {
-  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n\n")
+  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n")
   i = 1
+  print ("\n/* Allowed values for IN_MODULE.  */")
   for (l in libs) {
     printf ("#define MODULE_%s %d\n", l, libs[l])
   }
+  print ("\n/* Module names, used in stap-probe.h */")
+  for (l in libs) {
+    printf ("#if IN_MODULE == MODULE_%s\n", l)
+    printf ("# define MODULE_NAME %s\n", l)
+    printf ("#endif\n")
+  }
 }
-- 
1.9.3


[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [ping][PATCH 17/17 v3] Use IS_IN internally only
  2014-09-01 16:59       ` [PATCH 17/19 v3] " Siddhesh Poyarekar
  2014-09-01 22:18         ` Siddhesh Poyarekar
@ 2014-09-17 12:55         ` Siddhesh Poyarekar
  2014-09-24  9:08           ` [ping2][PATCH " Siddhesh Poyarekar
  1 sibling, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-17 12:55 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1664 bytes --]

Rebased patch against latest master.  The patch has not changed.

Siddhesh

From f45abf4b96388f82ba2cb7cba8548aa71a8e607d Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Mon, 1 Sep 2014 22:55:04 +0530
Subject: [PATCH] Use IS_IN internally only

This change is only useful for the conformance tests since the headers
changed are not installed.  The conformance tests fail due to IS_IN
not being defined, so wrap it with a check to make sure that _ISOMAC
is defined.

	* include/bits/stdlib-float.h [_ISOMAC || !IS_IN (rtld)]:
	Include bits/stdlib-float.h.
	* include/mqueue.h: Use internal code only when _ISOMAC is not
	defined.
---
 include/bits/stdlib-float.h | 8 ++++++--
 include/mqueue.h            | 4 +++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/bits/stdlib-float.h b/include/bits/stdlib-float.h
index 3466314..54ab571 100644
--- a/include/bits/stdlib-float.h
+++ b/include/bits/stdlib-float.h
@@ -1,4 +1,8 @@
-/* No floating-point inline functions in rtld.  */
-#if !IS_IN (rtld)
+/* No floating-point inline functions in rtld and for the conform tests.  */
+#ifdef _ISOMAC
 # include <stdlib/bits/stdlib-float.h>
+#else
+# if !IS_IN (rtld)
+#  include <stdlib/bits/stdlib-float.h>
+# endif
 #endif
diff --git a/include/mqueue.h b/include/mqueue.h
index aba788e..eb47b9b 100644
--- a/include/mqueue.h
+++ b/include/mqueue.h
@@ -1,7 +1,9 @@
 #include <rt/mqueue.h>
 
-#if IS_IN (librt)
+#ifndef _ISOMAC
+# if IS_IN (librt)
 hidden_proto (mq_timedsend)
 hidden_proto (mq_timedreceive)
 hidden_proto (mq_setattr)
+# endif
 #endif
-- 
1.9.3


[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [ping2][PATCH 01/19 v2] Add new macro IN_MODULE to identify module in which source is built
  2014-09-17 12:38       ` [ping][PATCH " Siddhesh Poyarekar
@ 2014-09-24  9:06         ` Siddhesh Poyarekar
  2014-10-01  8:16         ` [ping3][PATCH " Siddhesh Poyarekar
  1 sibling, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-24  9:06 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 20377 bytes --]

Ping!

On Wed, Sep 17, 2014 at 06:08:35PM +0530, Siddhesh Poyarekar wrote:
> Resending patch after rebasing on top of latest master.  There are no
> changes to the patch.  Verified once again that the generated code is
> unchanged on x86_64.
> 
> Siddhesh
> 
> On Wed, Aug 27, 2014 at 10:49:16PM +0530, Siddhesh Poyarekar wrote:
> > Here's a second version of this patch with the useless boilerplate
> > code removed since extra-lib should have taken care of it.  I couldn't
> > replace the remaining instances of cppflags-iterator inclusions with
> > simple variable assignments because there were a couple of cases that
> > would make it hard to implement.
> > 
> > Verified that the generated code remains the same on x86_64.  I have
> > build tests for other architectures running (for all patches) but
> > they'll probably take till tomorrow to complete.
> 
> 
> 
> From 92c41887b588cb3a3bed8538d2f6b903c1db3715 Mon Sep 17 00:00:00 2001
> From: Siddhesh Poyarekar <siddhesh@redhat.com>
> Date: Thu, 21 Aug 2014 10:19:31 +0530
> Subject: [PATCH] Add new macro IN_MODULE to identify module in which source is
>  built
> 
> The current scheme to identify which module a translation unit is
> built in depends on defining multiple macros IS_IN_* and also defining
> NOT_IN_libc if we're building a non-libc module.  In addition, there
> is an IN_LIB macro that does effectively the same thing, but for
> different modules (notably the systemtap probes).  This macro scheme
> unifies both ideas to use just one macro IN_MODULE and assign it a
> value depending on the module it is being built into.  If the module
> is not defined, it defaults to MODULE_libc.
> 
> Patches that follow will remove uses of IS_IN_* variables with the
> IS_IN() macro.  libc-symbols.h has been converted already to give an
> example of how such a transition will look.
> 
> Verified that there are no relevant source changes.  One source change
> that will crop up repeatedly is that of nscd_stat, since it uses the
> build timestamp as a constant in its logic.
> 
> 	* Makeconfig (in-module): Get value of libof set for the
> 	translation unit.
> 	(module-def): Set IN_MODULE based on value of libof-*.
> 	(CPPFLAGS): Add $(module-def) to CPPFLAGS.
> 	* Makerules: Don't suffix routine names for nonlib.
> 	* include/libc-modules.h: New file.
> 	* include/libc-symbols.h: Include libc-modules.h
> 	(IS_IN): New macro to replace IS_IN_* macros.
> 	* elf/Makefile: Set libof-* for each routine.
> 	* elf/rtld-Rules: Likewise.
> 	* extra-modules.mk: Likewise.
> 	* iconv/Makefile: Likewise.
> 	* iconvdata/Makefile: Likewise.
> 	* locale/Makefile: Likewise.
> 	* malloc/Makefile: Likewise.
> 	* nss/Makefile: Likewise.
> 	* sysdeps/gnu/Makefile: Likewise.
> 	* sysdeps/ieee754/ldbl-opt/Makefile: Likewise.
> 	* sysdeps/unix/sysv/linux/Makefile: Likewise.
> 	* sysdeps/s390/s390-64/Makefile: Likewise.
> 	* nscd/Makefile: Set libof-* for each routine.  Set CFLAGS and
> 	CPPFLAGS for nscd instead of nonlib.
> ---
>  Makeconfig                       |  7 ++++++-
>  Makerules                        |  2 +-
>  elf/Makefile                     |  7 ++++++-
>  elf/rtld-Rules                   |  5 +++++
>  extra-modules.mk                 |  1 +
>  iconv/Makefile                   | 11 ++++++-----
>  iconvdata/Makefile               |  6 ++++++
>  include/libc-modules.h           | 37 +++++++++++++++++++++++++++++++++++++
>  include/libc-symbols.h           | 24 ++++++++++++++----------
>  locale/Makefile                  |  8 ++++----
>  mach/Machrules                   |  1 +
>  malloc/Makefile                  |  5 +++++
>  nscd/Makefile                    | 13 ++++++-------
>  nss/Makefile                     |  3 ++-
>  stdlib/Makefile                  |  1 +
>  sysdeps/gnu/Makefile             |  2 ++
>  sysdeps/s390/s390-64/Makefile    |  4 ++++
>  sysdeps/unix/sysv/linux/Makefile |  1 +
>  18 files changed, 108 insertions(+), 30 deletions(-)
>  create mode 100644 include/libc-modules.h
> 
> diff --git a/Makeconfig b/Makeconfig
> index fad2971..5c85b81 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -813,6 +813,11 @@ endif	# $(+cflags) == ""
>  # of many little headers in the include directory.
>  libio-include = -I$(..)libio
>  
> +in-module = $(strip $(foreach lib,$(libof-$(basename $(@F))) $(libof-$(<F)) \
> +				  $(libof-$(@F)),-DIN_MODULE=MODULE_$(lib)))
> +
> +module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
> +
>  # These are the variables that the implicit compilation rules use.
>  # Note that we can't use -std=* in CPPFLAGS, because it overrides
>  # the implicit -lang-asm and breaks cpp behavior for .S files--notably
> @@ -821,7 +826,7 @@ CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
>  	   $($(subdir)-CPPFLAGS) \
>  	   $(+includes) $(defines) \
>  	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
> -	   $(CPPFLAGS-$(suffix $@)) \
> +	   $(CPPFLAGS-$(suffix $@)) $(module-def) \
>  	   $(foreach lib,$(libof-$(basename $(@F))) \
>  			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
>  	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
> diff --git a/Makerules b/Makerules
> index 12d01ee..4594d3b 100644
> --- a/Makerules
> +++ b/Makerules
> @@ -1156,7 +1156,7 @@ xcheck: xtests
>  
>  all-nonlib = $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) $(others))
>  ifneq (,$(all-nonlib))
> -cpp-srcs-left = $(all-nonlib:=.c) $(all-nonlib:=.cc)
> +cpp-srcs-left = $(all-nonlib)
>  lib := nonlib
>  include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
>  endif
> diff --git a/elf/Makefile b/elf/Makefile
> index 94074f3..6263a47 100644
> --- a/elf/Makefile
> +++ b/elf/Makefile
> @@ -436,7 +436,8 @@ $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
>  
>  SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
>  CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
> -		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
> +		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1 -DNOT_IN_libc=1
> +libof-ldconfig = ldconfig
>  CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
>  CFLAGS-cache.c = $(SYSCONF-FLAGS)
>  CFLAGS-rtld.c = $(SYSCONF-FLAGS)
> @@ -444,6 +445,10 @@ CFLAGS-rtld.c = $(SYSCONF-FLAGS)
>  CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
>  		     -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
>  
> +cpp-srcs-left := $(all-rtld-routines:=.os)
> +lib := rtld
> +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> +
>  test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
>  generated += $(addsuffix .so,$(strip $(modules-names)))
>  
> diff --git a/elf/rtld-Rules b/elf/rtld-Rules
> index 0a5d6af..4d78d90 100644
> --- a/elf/rtld-Rules
> +++ b/elf/rtld-Rules
> @@ -138,6 +138,11 @@ ifdef rtld-depfiles
>  -include $(rtld-depfiles)
>  endif
>  
> +# Set libof-* for each routine.
> +cpp-srcs-left := $(subst .os,,$(rtld-modules))
> +lib := rtld
> +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> +
>  # This here is the whole point of all the shenanigans.
>  rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld
>  
> diff --git a/extra-modules.mk b/extra-modules.mk
> index c7ed850..9c2e4d2 100644
> --- a/extra-modules.mk
> +++ b/extra-modules.mk
> @@ -6,4 +6,5 @@
>  module := $(firstword $(extra-modules-left))
>  extra-modules-left := $(filter-out $(module),$(extra-modules-left))
>  
> +libof-$(notdir $(module)) := extramodules
>  CPPFLAGS-$(module).c += -DNOT_IN_libc
> diff --git a/iconv/Makefile b/iconv/Makefile
> index 48d17d7..8031a88 100644
> --- a/iconv/Makefile
> +++ b/iconv/Makefile
> @@ -52,11 +52,12 @@ CFLAGS-gconv_cache.c += -DGCONV_DIR='"$(gconvdir)"'
>  CFLAGS-gconv_conf.c = -DGCONV_PATH='"$(gconvdir)"'
>  CFLAGS-iconvconfig.c = -DGCONV_PATH='"$(gconvdir)"' -DGCONV_DIR='"$(gconvdir)"'
>  
> -CPPFLAGS-iconv_charmap = -DNOT_IN_libc
> -CPPFLAGS-linereader = -DNOT_IN_libc
> -CPPFLAGS-strtab = -DNOT_IN_libc
> -CPPFLAGS-charmap = -DNOT_IN_libc
> -CPPFLAGS-charmap-dir = -DNOT_IN_libc
> +CPPFLAGS-iconvprogs = -DNOT_IN_libc
> +
> +# Set libof-* for each routine.
> +cpp-srcs-left := $(iconv_prog-modules) $(iconvconfig-modules)
> +lib := iconvprogs
> +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
>  
>  ifeq ($(run-built-tests),yes)
>  xtests-special += $(objpfx)test-iconvconfig.out
> diff --git a/iconvdata/Makefile b/iconvdata/Makefile
> index b6327d6..e0252ee 100644
> --- a/iconvdata/Makefile
> +++ b/iconvdata/Makefile
> @@ -211,6 +211,7 @@ $(objpfx)iconv-rules: Makefile
>  	$(AWK) 'NR == 1 { \
>  		  for (i = 1; i <= NF; i++) { \
>  		    printf "%s-routines := %s\n", $$i, tolower($$i); \
> +		    printf "libof-%s := iconvdata\n", tolower($$i); \
>  		    printf "%s-map := gconv.map\n", $$i; \
>  		  } \
>  		}; \
> @@ -273,6 +274,11 @@ endif
>  
>  include ../Rules
>  
> +# Set libof-* for each routine.
> +cpp-srcs-left := $(modules) $(generated-modules)
> +lib := iconvdata
> +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> +
>  tst-loading-ENV = MALLOC_TRACE=$(objpfx)tst-loading.mtrace
>  $(objpfx)mtrace-tst-loading.out: $(objpfx)tst-loading.out
>  	$(common-objpfx)malloc/mtrace $(objpfx)tst-loading.mtrace > $@; \
> diff --git a/include/libc-modules.h b/include/libc-modules.h
> new file mode 100644
> index 0000000..d12fb90
> --- /dev/null
> +++ b/include/libc-modules.h
> @@ -0,0 +1,37 @@
> +#define MODULE_libc		1
> +#define MODULE_libpthread	2
> +#define MODULE_rtld		3
> +#define MODULE_libdl		4
> +#define MODULE_libm		5
> +#define MODULE_iconvprogs	6
> +#define MODULE_iconvdata	7
> +#define MODULE_lddlibc4		8
> +#define MODULE_locale_programs	9
> +#define MODULE_memusagestat	10
> +#define MODULE_libutil		12
> +#define MODULE_libBrokenLocale	13
> +#define MODULE_libmemusage	15
> +#define MODULE_libresolv	16
> +#define MODULE_libnss_db	17
> +#define MODULE_libnss_files	18
> +#define	MODULE_libnss_dns	19
> +#define MODULE_libnss_compat	20
> +#define MODULE_libnss_hesiod	21
> +#define MODULE_libnss_nis	22
> +#define MODULE_libnss_nisplus	23
> +#define MODULE_libanl		24
> +#define MODULE_librt		25
> +#define MODULE_libSegFault	26
> +#define MODULE_libthread_db	27
> +#define MODULE_libcidn		28
> +#define MODULE_libcrypt		29
> +#define MODULE_libnsl		30
> +#define MODULE_libpcprofile	31
> +#define MODULE_librpcsvc	32
> +#define MODULE_nscd		33
> +#define MODULE_ldconfig 	34
> +#define MODULE_libnldbl 	35
> +
> +/* Catch-all for test modules and other binaries.  */
> +#define MODULE_nonlib		98
> +#define MODULE_extramodules	99
> diff --git a/include/libc-symbols.h b/include/libc-symbols.h
> index d4ab1f3..131d7eb 100644
> --- a/include/libc-symbols.h
> +++ b/include/libc-symbols.h
> @@ -20,6 +20,10 @@
>  #ifndef _LIBC_SYMBOLS_H
>  #define _LIBC_SYMBOLS_H	1
>  
> +#include "libc-modules.h"
> +
> +#define IS_IN(lib) (IN_MODULE == MODULE_##lib)
> +
>  /* This file's macros are included implicitly in the compilation of every
>     file in the C library by -imacros.
>  
> @@ -468,7 +472,7 @@ for linking")
>     If the function should be internal to multiple objects, say ld.so and
>     libc.so, the best way is to use:
>  
> -   #if !defined NOT_IN_libc || defined IS_IN_rtld
> +   #if IS_IN (libc) || IS_IN (rtld)
>     hidden_proto (foo)
>     #endif
>  
> @@ -584,7 +588,7 @@ for linking")
>  # define libc_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_rtld
> +#if IS_IN (rtld)
>  # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
>  # define rtld_hidden_def(name) hidden_def (name)
> @@ -604,7 +608,7 @@ for linking")
>  # define rtld_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_libm
> +#if IS_IN (libm)
>  # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define libm_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
>  # define libm_hidden_def(name) hidden_def (name)
> @@ -624,7 +628,7 @@ for linking")
>  # define libm_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_libresolv
> +#if IS_IN (libresolv)
>  # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define libresolv_hidden_tls_proto(name, attrs...) \
>    hidden_tls_proto (name, ##attrs)
> @@ -645,7 +649,7 @@ for linking")
>  # define libresolv_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_librt
> +#if IS_IN (librt)
>  # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define librt_hidden_tls_proto(name, attrs...) \
>    hidden_tls_proto (name, ##attrs)
> @@ -666,7 +670,7 @@ for linking")
>  # define librt_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_libdl
> +#if IS_IN (libdl)
>  # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define libdl_hidden_tls_proto(name, attrs...) \
>    hidden_tls_proto (name, ##attrs)
> @@ -687,7 +691,7 @@ for linking")
>  # define libdl_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_libnss_files
> +#if IS_IN (libnss_files)
>  # define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define libnss_files_hidden_tls_proto(name, attrs...) \
>    hidden_tls_proto (name, ##attrs)
> @@ -708,7 +712,7 @@ for linking")
>  # define libnss_files_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_libnsl
> +#if IS_IN (libnsl)
>  # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define libnsl_hidden_tls_proto(name, attrs...) \
>    hidden_tls_proto (name, ##attrs)
> @@ -729,7 +733,7 @@ for linking")
>  # define libnsl_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_libnss_nisplus
> +#if IS_IN (libnss_nisplus)
>  # define libnss_nisplus_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define libnss_nisplus_hidden_tls_proto(name, attrs...) \
>    hidden_tls_proto (name, ##attrs)
> @@ -758,7 +762,7 @@ for linking")
>  # define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name)
>  #endif
>  
> -#ifdef IS_IN_libutil
> +#if IS_IN (libutil)
>  # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define libutil_hidden_tls_proto(name, attrs...) \
>    hidden_tls_proto (name, ##attrs)
> diff --git a/locale/Makefile b/locale/Makefile
> index e4c3878..5cd18e0 100644
> --- a/locale/Makefile
> +++ b/locale/Makefile
> @@ -85,7 +85,7 @@ locale-CPPFLAGS = -DLOCALEDIR='"$(localedir)"' \
>  		  -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \
>  		  -Iprograms
>  
> -CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
> +CPPFLAGS-locale_programs = -DLOCALE_PATH='$(localepath)' \
>  			   -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
>  			   -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
>  			   -DLOCSRCDIR='"$(i18ndir)/locales"' \
> @@ -96,7 +96,7 @@ CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
>  CFLAGS-charmap-dir.c = -Wno-write-strings
>  
>  # This makes sure -DNOT_IN_libc et al are passed for all these modules.
> -cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \
> -				$(locale-modules) $(lib-modules))
> -lib := locale-programs
> +cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
> +		 $(lib-modules)
> +lib := locale_programs
>  include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> diff --git a/mach/Machrules b/mach/Machrules
> index 8b35cf6..632f5f4 100644
> --- a/mach/Machrules
> +++ b/mach/Machrules
> @@ -226,6 +226,7 @@ extra-libs += $(interface-library)
>  extra-libs-others += $(interface-library)
>  
>  ifeq (yes,$(build-shared))
> +
>  interface.so = $(interface-library:=.so)
>  
>  # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
> diff --git a/malloc/Makefile b/malloc/Makefile
> index 9e93523..fbfada2 100644
> --- a/malloc/Makefile
> +++ b/malloc/Makefile
> @@ -89,6 +89,11 @@ endif
>  do-memusagestat: $(objpfx)memusagestat
>  
>  memusagestat-modules = memusagestat
> +
> +cpp-srcs-left := $(memusagestat-modules)
> +lib := memusagestat
> +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> +
>  $(objpfx)memusagestat: $(memusagestat-modules:%=$(objpfx)%.o)
>  	$(LINK.o) -o $@ $^ $(libgd-LDFLAGS) -lgd -lpng -lz -lm
>  
> diff --git a/nscd/Makefile b/nscd/Makefile
> index 639d87b..7ab4e9d 100644
> --- a/nscd/Makefile
> +++ b/nscd/Makefile
> @@ -79,23 +79,22 @@ CFLAGS-nscd_gethst_r.c = -fexceptions
>  CFLAGS-nscd_getai.c = -fexceptions
>  CFLAGS-nscd_initgroups.c = -fexceptions
>  
> -CPPFLAGS-nonlib += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2
> +CPPFLAGS-nscd += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2 -DNOT_IN_libc=1
>  
>  ifeq (yesyes,$(have-fpie)$(build-shared))
> -CFLAGS-nonlib += $(pie-ccflag)
> +CFLAGS-nscd += $(pie-ccflag)
>  endif
>  ifeq (yes,$(have-ssp))
> -CFLAGS-nonlib += -fstack-protector
> +CFLAGS-nscd += -fstack-protector
>  endif
>  
>  ifeq (yesyes,$(have-fpie)$(build-shared))
>  LDFLAGS-nscd = -Wl,-z,now
>  endif
>  
> -# This makes sure CPPFLAGS-nonlib and CFLAGS-nonlib are passed
> -# for all these modules.
> -cpp-srcs-left := $(nscd-modules:=.c)
> -lib := nonlib
> +# Set libof-nscd.
> +cpp-srcs-left := $(nscd-modules)
> +lib := nscd
>  include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
>  
>  $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
> diff --git a/nss/Makefile b/nss/Makefile
> index 1fa7f1f..7114d74 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -105,7 +105,8 @@ $(objpfx)makedb: $(makedb-modules:%=$(objpfx)%.o)
>  $(inst_vardbdir)/Makefile: db-Makefile $(+force)
>  	$(do-install)
>  
> -CFLAGS-nss_test1.c = -DNOT_IN_libc=1
> +libof-nss_test1 = extramodules
> +CPPFLAGS-nss_test1 = -DNOT_IN_libc=1
>  $(objpfx)/libnss_test1.so: $(objpfx)nss_test1.os $(link-libc-deps)
>  	$(build-module)
>  ifdef libnss_test1.so-version
> diff --git a/stdlib/Makefile b/stdlib/Makefile
> index 9b2271b..da6e076 100644
> --- a/stdlib/Makefile
> +++ b/stdlib/Makefile
> @@ -145,6 +145,7 @@ LDFLAGS-tst-putenv = $(no-as-needed)
>  
>  $(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os $(link-libc-deps)
>  	$(build-module)
> +libof-tst-putenvmod = extramodules
>  CFLAGS-tst-putenvmod.c = -DNOT_IN_libc=1
>  
>  $(objpfx)bug-getcontext: $(libm)
> diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
> index c05708d..b5b2cf0 100644
> --- a/sysdeps/gnu/Makefile
> +++ b/sysdeps/gnu/Makefile
> @@ -29,6 +29,8 @@ ifeq ($(subdir),stdio-common)
>  
>  errlist-c = $(firstword $(wildcard $(addsuffix /errlist.c,$(sysdirs) .)))
>  
> +libof-errlist-compat = extramodules
> +
>  ifeq ($(build-shared),yes)
>  $(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \
>  			   $(common-objpfx)Versions.v.i $(before-compile)
> diff --git a/sysdeps/s390/s390-64/Makefile b/sysdeps/s390/s390-64/Makefile
> index fe5030e..ce4f0c5 100644
> --- a/sysdeps/s390/s390-64/Makefile
> +++ b/sysdeps/s390/s390-64/Makefile
> @@ -28,6 +28,10 @@ s390x-iconv-modules = ISO-8859-1_CP037_Z900 UTF8_UTF16_Z9 UTF16_UTF32_Z9 UTF8_UT
>  extra-modules-left += $(s390x-iconv-modules)
>  include extra-module.mk
>  
> +cpp-srcs-left := $(foreach mod,$(s390x-iconv-modules),$($(mod)-routines))
> +lib := iconvdata
> +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> +
>  extra-objs      += $(addsuffix .so, $(s390x-iconv-modules))
>  install-others  += $(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules))
>  
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index 9ad6d22..2d6d8bb 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -178,6 +178,7 @@ ifeq ($(subdir),elf)
>  sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \
>  			dl-fxstatat64
>  
> +libof-lddlibc4 = lddlibc4
>  CPPFLAGS-lddlibc4 += -DNOT_IN_libc
>  
>  others += pldd
> -- 
> 1.9.3



[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [ping2][PATCH 03/19 v2] Auto-generate libc-modules.h
  2014-09-17 12:43     ` [ping][PATCH " Siddhesh Poyarekar
@ 2014-09-24  9:06       ` Siddhesh Poyarekar
  2014-10-01  8:18         ` [ping3][PATCH " Siddhesh Poyarekar
  0 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-24  9:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 11081 bytes --]

Ping!

On Wed, Sep 17, 2014 at 06:13:29PM +0530, Siddhesh Poyarekar wrote:
> Rebased on top of current master.  No changes to the patch.
> 
> Siddhesh
> 
> On Thu, Aug 28, 2014 at 11:41:28AM +0530, Siddhesh Poyarekar wrote:
> > Here's an updated patch to autogenerate libc-modules.h.  I now include
> > libc-symbols.h everywhere like before, so all of the %.v.i files can
> > once again use the macros libc-symbols.h defines.  To break the
> > circular dependency with shlib-versions, I include libc-modules.h in
> > the commandline instead of in libc-symbols.h and I don't include it
> > for shlib-versions.v.i and Versions.v.i.
> 
> From 1aefedff6666344d5368b82ca0f53f6dec9e7056 Mon Sep 17 00:00:00 2001
> From: Siddhesh Poyarekar <siddhesh@redhat.com>
> Date: Thu, 21 Aug 2014 11:44:54 +0530
> Subject: [PATCH] Auto-generate libc-modules.h
> 
> Remove libc-modules.h from the tree and auto-generate it from
> soversions.i and a new file build.list.  Macros generated from
> soversions.i have lower values starting from 1, while those from
> build.list start from a special value MODULE_OTHER_BEGIN, which has a
> high enough value (1000).  This allows us to conveniently
> differentiate between the versioned libraries and other built modules,
> which is needed in errno.h and netdb.h to decide whether to use an
> internal symbol or an external one.
> 
> Verified that generated code remains unchanged on x86_64.
> 
> 	* Makeconfig (module-cppflags): Include libc-modules.h for
> 	everything except shlib-versions.v.i.
> 	(CPPFLAGS): Use it.
> 	(before-compile): Add libc-modules.h.
> 	($(common-objpfx)libc-modules.h,
> 	$(common-objpfx)libc-modules.stmp): New targets.
> 	(common-generated): Add libc-modules.h and libc-modules.stmp.
> 	($(common-objpfx)Versions.v.i): Depend on libc-modules.h.
> 	* build.list: New file.
> 	* include/libc-symbols.h: Don't include libc-modules.h.
> 	* include/libc-modules.h: Remove file.
> 	* scripts/gen-libc-modules.awk: New script to generate
> 	libc-modules.h.
> 	* sysdeps/unix/Makefile ($(common-objpfx)sysd-syscalls):
> 	Depend on libc-modules.stmp.
> ---
>  Makeconfig                   | 44 +++++++++++++++++++++++++++++++++++++++-----
>  build.list                   | 15 +++++++++++++++
>  include/libc-modules.h       | 37 -------------------------------------
>  include/libc-symbols.h       |  2 --
>  scripts/gen-libc-modules.awk | 40 ++++++++++++++++++++++++++++++++++++++++
>  sysdeps/unix/Makefile        |  3 ++-
>  6 files changed, 96 insertions(+), 45 deletions(-)
>  create mode 100644 build.list
>  delete mode 100644 include/libc-modules.h
>  create mode 100644 scripts/gen-libc-modules.awk
> 
> diff --git a/Makeconfig b/Makeconfig
> index 5c85b81..9ce7287 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -813,10 +813,22 @@ endif	# $(+cflags) == ""
>  # of many little headers in the include directory.
>  libio-include = -I$(..)libio
>  
> +# We don't include libc-modules.h when these targets are being built.  These
> +# targets don't (and will likely never need to) use the IS_IN facility.  In
> +# fact, shlib-versions should not use it because that will create a circular
> +# dependency as libc-modules.h is generated from shlib-versions.
> +skip-module-cppflags = shlib-versions.v.i Versions.v.i
> +
>  in-module = $(strip $(foreach lib,$(libof-$(basename $(@F))) $(libof-$(<F)) \
>  				  $(libof-$(@F)),-DIN_MODULE=MODULE_$(lib)))
>  
>  module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
> +module-cppflags-real = -include $(common-objpfx)libc-modules.h $(module-def)
> +
> +# We don't need libc-modules.h and the IN_MODULE definition for
> +# shlib-version.v.i.
> +module-cppflags = $(if $(filter $(@F),$(skip-module-cppflags)), \
> +		       ,$(module-cppflags-real))
>  
>  # These are the variables that the implicit compilation rules use.
>  # Note that we can't use -std=* in CPPFLAGS, because it overrides
> @@ -824,9 +836,9 @@ module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
>  # it causes cpp to stop predefining __ASSEMBLER__.
>  CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
>  	   $($(subdir)-CPPFLAGS) \
> -	   $(+includes) $(defines) \
> +	   $(+includes) $(defines) $(module-cppflags) \
>  	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
> -	   $(CPPFLAGS-$(suffix $@)) $(module-def) \
> +	   $(CPPFLAGS-$(suffix $@)) \
>  	   $(foreach lib,$(libof-$(basename $(@F))) \
>  			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
>  	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
> @@ -986,9 +998,12 @@ endif
>  postclean-generated += soversions.mk soversions.i \
>  		       shlib-versions.v shlib-versions.v.i
>  
> -# Generate the header containing the names of all shared libraries.
> +# Generate a header containing the names of all shared libraries and another
> +# one containing macros that comprise valid values for the IN_MODULE and
> +# MODULE_NAME macros..
>  # We use a stamp file to avoid unnecessary recompilations.
> -before-compile += $(common-objpfx)gnu/lib-names.h
> +before-compile += $(common-objpfx)gnu/lib-names.h \
> +		  $(common-objpfx)libc-modules.h
>  ifeq ($(soversions.mk-done),t)
>  $(common-objpfx)gnu/lib-names.h: $(common-objpfx)gnu/lib-names.stmp; @:
>  $(common-objpfx)gnu/lib-names.stmp: $(..)scripts/lib-names.awk \
> @@ -1021,9 +1036,28 @@ $(common-objpfx)gnu/lib-names.stmp: $(..)scripts/lib-names.awk \
>  	} >  ${@:stmp=T}
>  	$(move-if-change) ${@:stmp=T} ${@:stmp=h}
>  	touch $@
> +
> +# Generate a header with macro definitions for use with the IS_IN macro.
> +# These are the possible values for the IN_MODULE macro defined when building
> +# sources, to identify which module the translation unit is going to be built
> +# into.  This needs to be one of the first headers to be generated since
> +# everything uses it.  We work around a one-time circular dependency with
> +# sysd-rules by touching an empty header file since the sysd-rules don't use
> +# the IN_MODULE macros even though it is defined in the compile command.  This
> +# is only necessary the first time, i.e. when there is no
> +# include/libc-modules.h.
> +$(common-objpfx)libc-modules.h: $(common-objpfx)libc-modules.stmp; @:
> +$(common-objpfx)libc-modules.stmp: $(..)scripts/gen-libc-modules.awk \
> +				   $(common-objpfx)soversions.i \
> +				   $(..)build.list
> +	$(AWK) -f $^ > ${@:stmp=T}
> +	$(move-if-change) ${@:stmp=T} ${@:stmp=h}
> +	touch $@
> +
>  endif
>  
> -common-generated += gnu/lib-names.h gnu/lib-names.stmp
> +common-generated += gnu/lib-names.h gnu/lib-names.stmp libc-modules.h \
> +		    libc-modules.stmp
>  
>  # The name under which the run-time dynamic linker is installed.
>  # We are currently going for the convention that `/lib/ld.so.1'
> diff --git a/build.list b/build.list
> new file mode 100644
> index 0000000..eab57c7
> --- /dev/null
> +++ b/build.list
> @@ -0,0 +1,15 @@
> +iconvprogs
> +iconvdata
> +ldconfig
> +lddlibc4
> +libmemusage
> +libSegFault
> +libpcprofile
> +librpcsvc
> +libutil
> +locale_programs
> +memusagestat
> +nonlib
> +nscd
> +extramodules
> +libnldbl
> diff --git a/include/libc-modules.h b/include/libc-modules.h
> deleted file mode 100644
> index d12fb90..0000000
> --- a/include/libc-modules.h
> +++ /dev/null
> @@ -1,37 +0,0 @@
> -#define MODULE_libc		1
> -#define MODULE_libpthread	2
> -#define MODULE_rtld		3
> -#define MODULE_libdl		4
> -#define MODULE_libm		5
> -#define MODULE_iconvprogs	6
> -#define MODULE_iconvdata	7
> -#define MODULE_lddlibc4		8
> -#define MODULE_locale_programs	9
> -#define MODULE_memusagestat	10
> -#define MODULE_libutil		12
> -#define MODULE_libBrokenLocale	13
> -#define MODULE_libmemusage	15
> -#define MODULE_libresolv	16
> -#define MODULE_libnss_db	17
> -#define MODULE_libnss_files	18
> -#define	MODULE_libnss_dns	19
> -#define MODULE_libnss_compat	20
> -#define MODULE_libnss_hesiod	21
> -#define MODULE_libnss_nis	22
> -#define MODULE_libnss_nisplus	23
> -#define MODULE_libanl		24
> -#define MODULE_librt		25
> -#define MODULE_libSegFault	26
> -#define MODULE_libthread_db	27
> -#define MODULE_libcidn		28
> -#define MODULE_libcrypt		29
> -#define MODULE_libnsl		30
> -#define MODULE_libpcprofile	31
> -#define MODULE_librpcsvc	32
> -#define MODULE_nscd		33
> -#define MODULE_ldconfig 	34
> -#define MODULE_libnldbl 	35
> -
> -/* Catch-all for test modules and other binaries.  */
> -#define MODULE_nonlib		98
> -#define MODULE_extramodules	99
> diff --git a/include/libc-symbols.h b/include/libc-symbols.h
> index 131d7eb..9b8208b 100644
> --- a/include/libc-symbols.h
> +++ b/include/libc-symbols.h
> @@ -20,8 +20,6 @@
>  #ifndef _LIBC_SYMBOLS_H
>  #define _LIBC_SYMBOLS_H	1
>  
> -#include "libc-modules.h"
> -
>  #define IS_IN(lib) (IN_MODULE == MODULE_##lib)
>  
>  /* This file's macros are included implicitly in the compilation of every
> diff --git a/scripts/gen-libc-modules.awk b/scripts/gen-libc-modules.awk
> new file mode 100644
> index 0000000..d3382b6
> --- /dev/null
> +++ b/scripts/gen-libc-modules.awk
> @@ -0,0 +1,40 @@
> +# Generate a header file that defines the MODULE_* macros for each library and
> +# module we build in glibc.  The library names are pulled in from soversions.i
> +# and the additional modules are mentioned one-per-line in build.list.
> +BEGIN {
> +  PROCINFO["sorted_in"] = "@val_type_asc"
> +  shlibs = 1
> +  others = 1000
> +  libs["OTHERS_BEGIN"] = others++
> +}
> +
> +# Skip over comments.
> +$1 == "#" {
> +  next
> +}
> +
> +# build.list is simply one module per line.
> +match (FILENAME, ".*build.list") {
> +  libs[$0] = others++
> +}
> +
> +# We have only one special case in soversions.i parsing, which is to replace ld
> +# with rtld since that's what we call it throughout the sources.
> +match (FILENAME, ".*soversions.i") {
> +  name = $2
> +  if (name == "ld")
> +    name = "rtld"
> +
> +  if (!(name in libs)) {
> +    libs[name] = shlibs++
> +  }
> +}
> +
> +# Finally, print out the header file.
> +END {
> +  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n\n")
> +  i = 1
> +  for (l in libs) {
> +    printf ("#define MODULE_%s %d\n", l, libs[l])
> +  }
> +}
> diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile
> index 0e535b6..573e90d 100644
> --- a/sysdeps/unix/Makefile
> +++ b/sysdeps/unix/Makefile
> @@ -79,7 +79,8 @@ compile-syscall = $(COMPILE.S) -o $@ -x assembler-with-cpp - \
>  
>  ifndef avoid-generated
>  $(common-objpfx)sysd-syscalls: $(..)sysdeps/unix/make-syscalls.sh \
> -			       $(wildcard $(+sysdep_dirs:%=%/syscalls.list))
> +			       $(wildcard $(+sysdep_dirs:%=%/syscalls.list)) \
> +			       $(common-objpfx)libc-modules.stmp
>  	for dir in $(+sysdep_dirs); do \
>  	  test -f $$dir/syscalls.list && \
>  	  { sysdirs='$(sysdirs)' \
> -- 
> 1.9.3
> 



[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [ping2][PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB
  2014-09-17 12:47   ` [ping][PATCH " Siddhesh Poyarekar
@ 2014-09-24  9:07     ` Siddhesh Poyarekar
  2014-10-01  8:19     ` [ping3][PATCH " Siddhesh Poyarekar
  2014-11-07 23:32     ` [ping][PATCH " Roland McGrath
  2 siblings, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-24  9:07 UTC (permalink / raw)
  To: libc-alpha; +Cc: Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 2769 bytes --]

Ping!

On Wed, Sep 17, 2014 at 06:17:16PM +0530, Siddhesh Poyarekar wrote:
> Rebased on top of latest master.  No changes to the patch.
> 
> Siddhesh
> 
> From b3ae47d0b34aa5d0366cf27cb944aa008e069186 Mon Sep 17 00:00:00 2001
> From: Siddhesh Poyarekar <siddhesh@redhat.com>
> Date: Thu, 21 Aug 2014 11:55:35 +0530
> Subject: [PATCH] Use MODULE_NAME in stap-probe instead of IN_LIB
> 
> Verified that the generated code is unchanged on x86_64.
> 
> 	* scripts/gen-libc-modules.awk (END): Generate defines for
> 	MODULE_NAME.
> 	* include/stap-probe.h (LIBC_PROBE_1): Use MODULE_NAME instead
> 	of IN_LIB.
> 	(STAP_PROBE_ASM): Likewise.
> ---
>  include/stap-probe.h         | 6 +++---
>  scripts/gen-libc-modules.awk | 9 ++++++++-
>  2 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/include/stap-probe.h b/include/stap-probe.h
> index 688646c..150fc1e 100644
> --- a/include/stap-probe.h
> +++ b/include/stap-probe.h
> @@ -30,7 +30,7 @@
>  
>     Systemtap's header defines the macros STAP_PROBE (provider, name) and
>     STAP_PROBEn (provider, name, arg1, ..., argn).  For "provider" we paste
> -   in the IN_LIB name (libc, libpthread, etc.) automagically.
> +   in MODULE_NAME (libc, libpthread, etc.) automagically.
>  
>     The format of the arg parameters is discussed here:
>  
> @@ -53,7 +53,7 @@
>  # endif
>  
>  # define LIBC_PROBE(name, n, ...)	\
> -  LIBC_PROBE_1 (IN_LIB, name, n, ## __VA_ARGS__)
> +  LIBC_PROBE_1 (MODULE_NAME, name, n, ## __VA_ARGS__)
>  
>  # define LIBC_PROBE_1(lib, name, n, ...) \
>    STAP_PROBE##n (lib, name, ## __VA_ARGS__)
> @@ -61,7 +61,7 @@
>  # define STAP_PROBE0		STAP_PROBE
>  
>  # define LIBC_PROBE_ASM(name, template) \
> -  STAP_PROBE_ASM (IN_LIB, name, template)
> +  STAP_PROBE_ASM (MODULE_NAME, name, template)
>  
>  # define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS
>  
> diff --git a/scripts/gen-libc-modules.awk b/scripts/gen-libc-modules.awk
> index d3382b6..1ae4af3 100644
> --- a/scripts/gen-libc-modules.awk
> +++ b/scripts/gen-libc-modules.awk
> @@ -32,9 +32,16 @@ match (FILENAME, ".*soversions.i") {
>  
>  # Finally, print out the header file.
>  END {
> -  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n\n")
> +  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n")
>    i = 1
> +  print ("\n/* Allowed values for IN_MODULE.  */")
>    for (l in libs) {
>      printf ("#define MODULE_%s %d\n", l, libs[l])
>    }
> +  print ("\n/* Module names, used in stap-probe.h */")
> +  for (l in libs) {
> +    printf ("#if IN_MODULE == MODULE_%s\n", l)
> +    printf ("# define MODULE_NAME %s\n", l)
> +    printf ("#endif\n")
> +  }
>  }
> -- 
> 1.9.3
> 



[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [ping][PATCH v2 06/19] Define IN_MODULE for translation units that define NOT_IN_libc
  2014-09-17 12:29   ` [PATCH v2 06/19] Define IN_MODULE for translation units that define NOT_IN_libc Siddhesh Poyarekar
@ 2014-09-24  9:07     ` Siddhesh Poyarekar
  2014-10-01  8:23       ` [ping2][PATCH " Siddhesh Poyarekar
  2014-11-07 23:23     ` [PATCH " Roland McGrath
  1 sibling, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-24  9:07 UTC (permalink / raw)
  To: libc-alpha; +Cc: Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 938 bytes --]

Ping!

On Wed, Sep 17, 2014 at 05:59:40PM +0530, Siddhesh Poyarekar wrote:
> Hi,
> 
> I have now rebased this patch against the current master.  interp.c
> does not need the CPPFLAGS anymore, so sotruss-lib is the only code to
> be built as extramodules to eventually replace the NOT_IN_libc macro.
> 
> Build tested on x86_64 to ensure that the generated code is unchanged.
> 
> Siddhesh
> 
>     	* elf/Makefile (libof-sotruss-lib): Set as extramodules.
> 
> diff --git a/elf/Makefile b/elf/Makefile
> index 677635b..7a5a9aa 100644
> --- a/elf/Makefile
> +++ b/elf/Makefile
> @@ -96,6 +96,7 @@ extra-objs += sotruss-lib.os sotruss-lib.so
>  install-others += $(inst_auditdir)/sotruss-lib.so
>  install-bin-script += sotruss
>  generated += sotruss
> +libof-sotruss-lib = extramodules
>  CPPFLAGS-sotruss-lib = -DNOT_IN_libc
>  $(objpfx)sotruss-lib.so: $(objpfx)sotruss-lib.os
>  	$(build-module-asneeded)



[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [ping2][PATCH 17/17 v3] Use IS_IN internally only
  2014-09-17 12:55         ` [ping][PATCH 17/17 v3] Use IS_IN internally only Siddhesh Poyarekar
@ 2014-09-24  9:08           ` Siddhesh Poyarekar
  2014-09-24  9:16             ` Joseph S. Myers
  0 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-09-24  9:08 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1858 bytes --]

Ping!

On Wed, Sep 17, 2014 at 06:25:43PM +0530, Siddhesh Poyarekar wrote:
> Rebased patch against latest master.  The patch has not changed.
> 
> Siddhesh
> 
> From f45abf4b96388f82ba2cb7cba8548aa71a8e607d Mon Sep 17 00:00:00 2001
> From: Siddhesh Poyarekar <siddhesh@redhat.com>
> Date: Mon, 1 Sep 2014 22:55:04 +0530
> Subject: [PATCH] Use IS_IN internally only
> 
> This change is only useful for the conformance tests since the headers
> changed are not installed.  The conformance tests fail due to IS_IN
> not being defined, so wrap it with a check to make sure that _ISOMAC
> is defined.
> 
> 	* include/bits/stdlib-float.h [_ISOMAC || !IS_IN (rtld)]:
> 	Include bits/stdlib-float.h.
> 	* include/mqueue.h: Use internal code only when _ISOMAC is not
> 	defined.
> ---
>  include/bits/stdlib-float.h | 8 ++++++--
>  include/mqueue.h            | 4 +++-
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/include/bits/stdlib-float.h b/include/bits/stdlib-float.h
> index 3466314..54ab571 100644
> --- a/include/bits/stdlib-float.h
> +++ b/include/bits/stdlib-float.h
> @@ -1,4 +1,8 @@
> -/* No floating-point inline functions in rtld.  */
> -#if !IS_IN (rtld)
> +/* No floating-point inline functions in rtld and for the conform tests.  */
> +#ifdef _ISOMAC
>  # include <stdlib/bits/stdlib-float.h>
> +#else
> +# if !IS_IN (rtld)
> +#  include <stdlib/bits/stdlib-float.h>
> +# endif
>  #endif
> diff --git a/include/mqueue.h b/include/mqueue.h
> index aba788e..eb47b9b 100644
> --- a/include/mqueue.h
> +++ b/include/mqueue.h
> @@ -1,7 +1,9 @@
>  #include <rt/mqueue.h>
>  
> -#if IS_IN (librt)
> +#ifndef _ISOMAC
> +# if IS_IN (librt)
>  hidden_proto (mq_timedsend)
>  hidden_proto (mq_timedreceive)
>  hidden_proto (mq_setattr)
> +# endif
>  #endif
> -- 
> 1.9.3
> 



[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [ping2][PATCH 17/17 v3] Use IS_IN internally only
  2014-09-24  9:08           ` [ping2][PATCH " Siddhesh Poyarekar
@ 2014-09-24  9:16             ` Joseph S. Myers
  0 siblings, 0 replies; 106+ messages in thread
From: Joseph S. Myers @ 2014-09-24  9:16 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

This patch is OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* [ping3][PATCH 01/19 v2] Add new macro IN_MODULE to identify module in which source is built
  2014-09-17 12:38       ` [ping][PATCH " Siddhesh Poyarekar
  2014-09-24  9:06         ` [ping2][PATCH " Siddhesh Poyarekar
@ 2014-10-01  8:16         ` Siddhesh Poyarekar
  2014-10-14 16:20           ` [ping4][PATCH " Siddhesh Poyarekar
  2014-11-07 23:22           ` [ping3][PATCH " Roland McGrath
  1 sibling, 2 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-10-01  8:16 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 17360 bytes --]

Rebased on current master, the only change is an unnecessary
whitespace addition I had missed earlier.  Ping!

Siddhesh

commit 3be0b793dc7e72fde3e2c728ca42541bd0a29c9c
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Thu Aug 21 10:19:31 2014 +0530

    Add new macro IN_MODULE to identify module in which source is built
    
    The current scheme to identify which module a translation unit is
    built in depends on defining multiple macros IS_IN_* and also defining
    NOT_IN_libc if we're building a non-libc module.  In addition, there
    is an IN_LIB macro that does effectively the same thing, but for
    different modules (notably the systemtap probes).  This macro scheme
    unifies both ideas to use just one macro IN_MODULE and assign it a
    value depending on the module it is being built into.  If the module
    is not defined, it defaults to MODULE_libc.
    
    Patches that follow will remove uses of IS_IN_* variables with the
    IS_IN() macro.  libc-symbols.h has been converted already to give an
    example of how such a transition will look.
    
    Verified that there are no relevant source changes.  One source change
    that will crop up repeatedly is that of nscd_stat, since it uses the
    build timestamp as a constant in its logic.
    
    	* Makeconfig (in-module): Get value of libof set for the
    	translation unit.
    	(module-def): Set IN_MODULE based on value of libof-*.
    	(CPPFLAGS): Add $(module-def) to CPPFLAGS.
    	* Makerules: Don't suffix routine names for nonlib.
    	* include/libc-modules.h: New file.
    	* include/libc-symbols.h: Include libc-modules.h
    	(IS_IN): New macro to replace IS_IN_* macros.
    	* elf/Makefile: Set libof-* for each routine.
    	* elf/rtld-Rules: Likewise.
    	* extra-modules.mk: Likewise.
    	* iconv/Makefile: Likewise.
    	* iconvdata/Makefile: Likewise.
    	* locale/Makefile: Likewise.
    	* malloc/Makefile: Likewise.
    	* nss/Makefile: Likewise.
    	* sysdeps/gnu/Makefile: Likewise.
    	* sysdeps/ieee754/ldbl-opt/Makefile: Likewise.
    	* sysdeps/unix/sysv/linux/Makefile: Likewise.
    	* sysdeps/s390/s390-64/Makefile: Likewise.
    	* nscd/Makefile: Set libof-* for each routine.  Set CFLAGS and
    	CPPFLAGS for nscd instead of nonlib.

diff --git a/Makeconfig b/Makeconfig
index 24a3b82..671eceb 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -813,6 +813,11 @@ endif	# $(+cflags) == ""
 # of many little headers in the include directory.
 libio-include = -I$(..)libio
 
+in-module = $(strip $(foreach lib,$(libof-$(basename $(@F))) $(libof-$(<F)) \
+				  $(libof-$(@F)),-DIN_MODULE=MODULE_$(lib)))
+
+module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
+
 # These are the variables that the implicit compilation rules use.
 # Note that we can't use -std=* in CPPFLAGS, because it overrides
 # the implicit -lang-asm and breaks cpp behavior for .S files--notably
@@ -821,7 +826,7 @@ CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
 	   $($(subdir)-CPPFLAGS) \
 	   $(+includes) $(defines) \
 	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
-	   $(CPPFLAGS-$(suffix $@)) \
+	   $(CPPFLAGS-$(suffix $@)) $(module-def) \
 	   $(foreach lib,$(libof-$(basename $(@F))) \
 			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
diff --git a/Makerules b/Makerules
index 3951bb1..3f4b55b 100644
--- a/Makerules
+++ b/Makerules
@@ -1156,7 +1156,7 @@ xcheck: xtests
 
 all-nonlib = $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) $(others))
 ifneq (,$(all-nonlib))
-cpp-srcs-left = $(all-nonlib:=.c) $(all-nonlib:=.cc)
+cpp-srcs-left = $(all-nonlib)
 lib := nonlib
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 endif
diff --git a/elf/Makefile b/elf/Makefile
index 94074f3..6263a47 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -436,7 +436,8 @@ $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
 
 SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
 CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
-		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
+		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1 -DNOT_IN_libc=1
+libof-ldconfig = ldconfig
 CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
 CFLAGS-cache.c = $(SYSCONF-FLAGS)
 CFLAGS-rtld.c = $(SYSCONF-FLAGS)
@@ -444,6 +445,10 @@ CFLAGS-rtld.c = $(SYSCONF-FLAGS)
 CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
 		     -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
 
+cpp-srcs-left := $(all-rtld-routines:=.os)
+lib := rtld
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
 generated += $(addsuffix .so,$(strip $(modules-names)))
 
diff --git a/elf/rtld-Rules b/elf/rtld-Rules
index 0a5d6af..4d78d90 100644
--- a/elf/rtld-Rules
+++ b/elf/rtld-Rules
@@ -138,6 +138,11 @@ ifdef rtld-depfiles
 -include $(rtld-depfiles)
 endif
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(subst .os,,$(rtld-modules))
+lib := rtld
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 # This here is the whole point of all the shenanigans.
 rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld
 
diff --git a/extra-modules.mk b/extra-modules.mk
index c7ed850..9c2e4d2 100644
--- a/extra-modules.mk
+++ b/extra-modules.mk
@@ -6,4 +6,5 @@
 module := $(firstword $(extra-modules-left))
 extra-modules-left := $(filter-out $(module),$(extra-modules-left))
 
+libof-$(notdir $(module)) := extramodules
 CPPFLAGS-$(module).c += -DNOT_IN_libc
diff --git a/iconv/Makefile b/iconv/Makefile
index 48d17d7..8031a88 100644
--- a/iconv/Makefile
+++ b/iconv/Makefile
@@ -52,11 +52,12 @@ CFLAGS-gconv_cache.c += -DGCONV_DIR='"$(gconvdir)"'
 CFLAGS-gconv_conf.c = -DGCONV_PATH='"$(gconvdir)"'
 CFLAGS-iconvconfig.c = -DGCONV_PATH='"$(gconvdir)"' -DGCONV_DIR='"$(gconvdir)"'
 
-CPPFLAGS-iconv_charmap = -DNOT_IN_libc
-CPPFLAGS-linereader = -DNOT_IN_libc
-CPPFLAGS-strtab = -DNOT_IN_libc
-CPPFLAGS-charmap = -DNOT_IN_libc
-CPPFLAGS-charmap-dir = -DNOT_IN_libc
+CPPFLAGS-iconvprogs = -DNOT_IN_libc
+
+# Set libof-* for each routine.
+cpp-srcs-left := $(iconv_prog-modules) $(iconvconfig-modules)
+lib := iconvprogs
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
 ifeq ($(run-built-tests),yes)
 xtests-special += $(objpfx)test-iconvconfig.out
diff --git a/iconvdata/Makefile b/iconvdata/Makefile
index b6327d6..e0252ee 100644
--- a/iconvdata/Makefile
+++ b/iconvdata/Makefile
@@ -211,6 +211,7 @@ $(objpfx)iconv-rules: Makefile
 	$(AWK) 'NR == 1 { \
 		  for (i = 1; i <= NF; i++) { \
 		    printf "%s-routines := %s\n", $$i, tolower($$i); \
+		    printf "libof-%s := iconvdata\n", tolower($$i); \
 		    printf "%s-map := gconv.map\n", $$i; \
 		  } \
 		}; \
@@ -273,6 +274,11 @@ endif
 
 include ../Rules
 
+# Set libof-* for each routine.
+cpp-srcs-left := $(modules) $(generated-modules)
+lib := iconvdata
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 tst-loading-ENV = MALLOC_TRACE=$(objpfx)tst-loading.mtrace
 $(objpfx)mtrace-tst-loading.out: $(objpfx)tst-loading.out
 	$(common-objpfx)malloc/mtrace $(objpfx)tst-loading.mtrace > $@; \
diff --git a/include/libc-modules.h b/include/libc-modules.h
new file mode 100644
index 0000000..d12fb90
--- /dev/null
+++ b/include/libc-modules.h
@@ -0,0 +1,37 @@
+#define MODULE_libc		1
+#define MODULE_libpthread	2
+#define MODULE_rtld		3
+#define MODULE_libdl		4
+#define MODULE_libm		5
+#define MODULE_iconvprogs	6
+#define MODULE_iconvdata	7
+#define MODULE_lddlibc4		8
+#define MODULE_locale_programs	9
+#define MODULE_memusagestat	10
+#define MODULE_libutil		12
+#define MODULE_libBrokenLocale	13
+#define MODULE_libmemusage	15
+#define MODULE_libresolv	16
+#define MODULE_libnss_db	17
+#define MODULE_libnss_files	18
+#define	MODULE_libnss_dns	19
+#define MODULE_libnss_compat	20
+#define MODULE_libnss_hesiod	21
+#define MODULE_libnss_nis	22
+#define MODULE_libnss_nisplus	23
+#define MODULE_libanl		24
+#define MODULE_librt		25
+#define MODULE_libSegFault	26
+#define MODULE_libthread_db	27
+#define MODULE_libcidn		28
+#define MODULE_libcrypt		29
+#define MODULE_libnsl		30
+#define MODULE_libpcprofile	31
+#define MODULE_librpcsvc	32
+#define MODULE_nscd		33
+#define MODULE_ldconfig 	34
+#define MODULE_libnldbl 	35
+
+/* Catch-all for test modules and other binaries.  */
+#define MODULE_nonlib		98
+#define MODULE_extramodules	99
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index d4ab1f3..131d7eb 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -20,6 +20,10 @@
 #ifndef _LIBC_SYMBOLS_H
 #define _LIBC_SYMBOLS_H	1
 
+#include "libc-modules.h"
+
+#define IS_IN(lib) (IN_MODULE == MODULE_##lib)
+
 /* This file's macros are included implicitly in the compilation of every
    file in the C library by -imacros.
 
@@ -468,7 +472,7 @@ for linking")
    If the function should be internal to multiple objects, say ld.so and
    libc.so, the best way is to use:
 
-   #if !defined NOT_IN_libc || defined IS_IN_rtld
+   #if IS_IN (libc) || IS_IN (rtld)
    hidden_proto (foo)
    #endif
 
@@ -584,7 +588,7 @@ for linking")
 # define libc_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_rtld
+#if IS_IN (rtld)
 # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
 # define rtld_hidden_def(name) hidden_def (name)
@@ -604,7 +608,7 @@ for linking")
 # define rtld_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libm
+#if IS_IN (libm)
 # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libm_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
 # define libm_hidden_def(name) hidden_def (name)
@@ -624,7 +628,7 @@ for linking")
 # define libm_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libresolv
+#if IS_IN (libresolv)
 # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libresolv_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -645,7 +649,7 @@ for linking")
 # define libresolv_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_librt
+#if IS_IN (librt)
 # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define librt_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -666,7 +670,7 @@ for linking")
 # define librt_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libdl
+#if IS_IN (libdl)
 # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libdl_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -687,7 +691,7 @@ for linking")
 # define libdl_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libnss_files
+#if IS_IN (libnss_files)
 # define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libnss_files_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -708,7 +712,7 @@ for linking")
 # define libnss_files_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libnsl
+#if IS_IN (libnsl)
 # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libnsl_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -729,7 +733,7 @@ for linking")
 # define libnsl_hidden_data_ver(local, name)
 #endif
 
-#ifdef IS_IN_libnss_nisplus
+#if IS_IN (libnss_nisplus)
 # define libnss_nisplus_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libnss_nisplus_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
@@ -758,7 +762,7 @@ for linking")
 # define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name)
 #endif
 
-#ifdef IS_IN_libutil
+#if IS_IN (libutil)
 # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define libutil_hidden_tls_proto(name, attrs...) \
   hidden_tls_proto (name, ##attrs)
diff --git a/locale/Makefile b/locale/Makefile
index e4c3878..5cd18e0 100644
--- a/locale/Makefile
+++ b/locale/Makefile
@@ -85,7 +85,7 @@ locale-CPPFLAGS = -DLOCALEDIR='"$(localedir)"' \
 		  -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \
 		  -Iprograms
 
-CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
+CPPFLAGS-locale_programs = -DLOCALE_PATH='$(localepath)' \
 			   -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
 			   -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
 			   -DLOCSRCDIR='"$(i18ndir)/locales"' \
@@ -96,7 +96,7 @@ CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-charmap-dir.c = -Wno-write-strings
 
 # This makes sure -DNOT_IN_libc et al are passed for all these modules.
-cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \
-				$(locale-modules) $(lib-modules))
-lib := locale-programs
+cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
+		 $(lib-modules)
+lib := locale_programs
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
diff --git a/malloc/Makefile b/malloc/Makefile
index 9e93523..fbfada2 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -89,6 +89,11 @@ endif
 do-memusagestat: $(objpfx)memusagestat
 
 memusagestat-modules = memusagestat
+
+cpp-srcs-left := $(memusagestat-modules)
+lib := memusagestat
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 $(objpfx)memusagestat: $(memusagestat-modules:%=$(objpfx)%.o)
 	$(LINK.o) -o $@ $^ $(libgd-LDFLAGS) -lgd -lpng -lz -lm
 
diff --git a/nscd/Makefile b/nscd/Makefile
index 639d87b..7ab4e9d 100644
--- a/nscd/Makefile
+++ b/nscd/Makefile
@@ -79,23 +79,22 @@ CFLAGS-nscd_gethst_r.c = -fexceptions
 CFLAGS-nscd_getai.c = -fexceptions
 CFLAGS-nscd_initgroups.c = -fexceptions
 
-CPPFLAGS-nonlib += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2
+CPPFLAGS-nscd += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2 -DNOT_IN_libc=1
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
-CFLAGS-nonlib += $(pie-ccflag)
+CFLAGS-nscd += $(pie-ccflag)
 endif
 ifeq (yes,$(have-ssp))
-CFLAGS-nonlib += -fstack-protector
+CFLAGS-nscd += -fstack-protector
 endif
 
 ifeq (yesyes,$(have-fpie)$(build-shared))
 LDFLAGS-nscd = -Wl,-z,now
 endif
 
-# This makes sure CPPFLAGS-nonlib and CFLAGS-nonlib are passed
-# for all these modules.
-cpp-srcs-left := $(nscd-modules:=.c)
-lib := nonlib
+# Set libof-nscd.
+cpp-srcs-left := $(nscd-modules)
+lib := nscd
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
 $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
diff --git a/nss/Makefile b/nss/Makefile
index 1fa7f1f..7114d74 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -105,7 +105,8 @@ $(objpfx)makedb: $(makedb-modules:%=$(objpfx)%.o)
 $(inst_vardbdir)/Makefile: db-Makefile $(+force)
 	$(do-install)
 
-CFLAGS-nss_test1.c = -DNOT_IN_libc=1
+libof-nss_test1 = extramodules
+CPPFLAGS-nss_test1 = -DNOT_IN_libc=1
 $(objpfx)/libnss_test1.so: $(objpfx)nss_test1.os $(link-libc-deps)
 	$(build-module)
 ifdef libnss_test1.so-version
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 9b2271b..da6e076 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -145,6 +145,7 @@ LDFLAGS-tst-putenv = $(no-as-needed)
 
 $(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os $(link-libc-deps)
 	$(build-module)
+libof-tst-putenvmod = extramodules
 CFLAGS-tst-putenvmod.c = -DNOT_IN_libc=1
 
 $(objpfx)bug-getcontext: $(libm)
diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
index c05708d..b5b2cf0 100644
--- a/sysdeps/gnu/Makefile
+++ b/sysdeps/gnu/Makefile
@@ -29,6 +29,8 @@ ifeq ($(subdir),stdio-common)
 
 errlist-c = $(firstword $(wildcard $(addsuffix /errlist.c,$(sysdirs) .)))
 
+libof-errlist-compat = extramodules
+
 ifeq ($(build-shared),yes)
 $(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \
 			   $(common-objpfx)Versions.v.i $(before-compile)
diff --git a/sysdeps/s390/s390-64/Makefile b/sysdeps/s390/s390-64/Makefile
index fe5030e..ce4f0c5 100644
--- a/sysdeps/s390/s390-64/Makefile
+++ b/sysdeps/s390/s390-64/Makefile
@@ -28,6 +28,10 @@ s390x-iconv-modules = ISO-8859-1_CP037_Z900 UTF8_UTF16_Z9 UTF16_UTF32_Z9 UTF8_UT
 extra-modules-left += $(s390x-iconv-modules)
 include extra-module.mk
 
+cpp-srcs-left := $(foreach mod,$(s390x-iconv-modules),$($(mod)-routines))
+lib := iconvdata
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 extra-objs      += $(addsuffix .so, $(s390x-iconv-modules))
 install-others  += $(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules))
 
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 9ad6d22..2d6d8bb 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -178,6 +178,7 @@ ifeq ($(subdir),elf)
 sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \
 			dl-fxstatat64
 
+libof-lddlibc4 = lddlibc4
 CPPFLAGS-lddlibc4 += -DNOT_IN_libc
 
 others += pldd

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [ping3][PATCH 03/19 v2] Auto-generate libc-modules.h
  2014-09-24  9:06       ` [ping2][PATCH " Siddhesh Poyarekar
@ 2014-10-01  8:18         ` Siddhesh Poyarekar
  2014-10-14 16:21           ` [ping4][PATCH " Siddhesh Poyarekar
  2014-11-07 23:29           ` [ping3][PATCH " Roland McGrath
  0 siblings, 2 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-10-01  8:18 UTC (permalink / raw)
  To: libc-alpha; +Cc: Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 8365 bytes --]

Rebased against current master and verified that the generated code is
still unchanged.

Siddhesh

commit 33724079bde7aca8149fa9c2831578041cf7da03
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Thu Aug 21 11:44:54 2014 +0530

    Auto-generate libc-modules.h
    
    Remove libc-modules.h from the tree and auto-generate it from
    soversions.i and a new file build.list.  Macros generated from
    soversions.i have lower values starting from 1, while those from
    build.list start from a special value MODULE_OTHER_BEGIN, which has a
    high enough value (1000).  This allows us to conveniently
    differentiate between the versioned libraries and other built modules,
    which is needed in errno.h and netdb.h to decide whether to use an
    internal symbol or an external one.
    
    Verified that generated code remains unchanged on x86_64.
    
    	* Makeconfig (module-cppflags): Include libc-modules.h for
    	everything except shlib-versions.v.i.
    	(CPPFLAGS): Use it.
    	(before-compile): Add libc-modules.h.
    	($(common-objpfx)libc-modules.h,
    	$(common-objpfx)libc-modules.stmp): New targets.
    	(common-generated): Add libc-modules.h and libc-modules.stmp.
    	($(common-objpfx)Versions.v.i): Depend on libc-modules.h.
    	* build.list: New file.
    	* include/libc-symbols.h: Don't include libc-modules.h.
    	* include/libc-modules.h: Remove file.
    	* scripts/gen-libc-modules.awk: New script to generate
    	libc-modules.h.
    	* sysdeps/unix/Makefile ($(common-objpfx)sysd-syscalls):
    	Depend on libc-modules.stmp.

diff --git a/Makeconfig b/Makeconfig
index 671eceb..5ffbd92 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -813,10 +813,22 @@ endif	# $(+cflags) == ""
 # of many little headers in the include directory.
 libio-include = -I$(..)libio
 
+# We don't include libc-modules.h when these targets are being built.  These
+# targets don't (and will likely never need to) use the IS_IN facility.  In
+# fact, shlib-versions should not use it because that will create a circular
+# dependency as libc-modules.h is generated from shlib-versions.
+skip-module-cppflags = shlib-versions.v.i Versions.v.i
+
 in-module = $(strip $(foreach lib,$(libof-$(basename $(@F))) $(libof-$(<F)) \
 				  $(libof-$(@F)),-DIN_MODULE=MODULE_$(lib)))
 
 module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
+module-cppflags-real = -include $(common-objpfx)libc-modules.h $(module-def)
+
+# We don't need libc-modules.h and the IN_MODULE definition for
+# shlib-version.v.i.
+module-cppflags = $(if $(filter $(@F),$(skip-module-cppflags)), \
+		       ,$(module-cppflags-real))
 
 # These are the variables that the implicit compilation rules use.
 # Note that we can't use -std=* in CPPFLAGS, because it overrides
@@ -824,9 +836,9 @@ module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
 # it causes cpp to stop predefining __ASSEMBLER__.
 CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
 	   $($(subdir)-CPPFLAGS) \
-	   $(+includes) $(defines) \
+	   $(+includes) $(defines) $(module-cppflags) \
 	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
-	   $(CPPFLAGS-$(suffix $@)) $(module-def) \
+	   $(CPPFLAGS-$(suffix $@)) \
 	   $(foreach lib,$(libof-$(basename $(@F))) \
 			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
@@ -986,6 +998,24 @@ endif
 postclean-generated += soversions.mk soversions.i \
 		       shlib-versions.v shlib-versions.v.i
 
+before-compile += $(common-objpfx)libc-modules.h
+ifeq ($(soversions.mk-done),t)
+# Generate a header with macro definitions for use with the IS_IN macro.
+# These are the possible values for the IN_MODULE macro defined when building
+# sources, to identify which module the translation unit is going to be built
+# into.
+$(common-objpfx)libc-modules.h: $(common-objpfx)libc-modules.stmp; @:
+$(common-objpfx)libc-modules.stmp: $(..)scripts/gen-libc-modules.awk \
+				   $(common-objpfx)soversions.i \
+				   $(..)build.list
+	$(AWK) -f $^ > ${@:stmp=T}
+	$(move-if-change) ${@:stmp=T} ${@:stmp=h}
+	touch $@
+
+endif
+
+common-generated += libc-modules.h libc-modules.stmp
+
 # The name under which the run-time dynamic linker is installed.
 # We are currently going for the convention that `/lib/ld.so.1'
 # names the SVR4/ELF ABI-compliant dynamic linker.
diff --git a/build.list b/build.list
new file mode 100644
index 0000000..eab57c7
--- /dev/null
+++ b/build.list
@@ -0,0 +1,15 @@
+iconvprogs
+iconvdata
+ldconfig
+lddlibc4
+libmemusage
+libSegFault
+libpcprofile
+librpcsvc
+libutil
+locale_programs
+memusagestat
+nonlib
+nscd
+extramodules
+libnldbl
diff --git a/include/libc-modules.h b/include/libc-modules.h
deleted file mode 100644
index d12fb90..0000000
--- a/include/libc-modules.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#define MODULE_libc		1
-#define MODULE_libpthread	2
-#define MODULE_rtld		3
-#define MODULE_libdl		4
-#define MODULE_libm		5
-#define MODULE_iconvprogs	6
-#define MODULE_iconvdata	7
-#define MODULE_lddlibc4		8
-#define MODULE_locale_programs	9
-#define MODULE_memusagestat	10
-#define MODULE_libutil		12
-#define MODULE_libBrokenLocale	13
-#define MODULE_libmemusage	15
-#define MODULE_libresolv	16
-#define MODULE_libnss_db	17
-#define MODULE_libnss_files	18
-#define	MODULE_libnss_dns	19
-#define MODULE_libnss_compat	20
-#define MODULE_libnss_hesiod	21
-#define MODULE_libnss_nis	22
-#define MODULE_libnss_nisplus	23
-#define MODULE_libanl		24
-#define MODULE_librt		25
-#define MODULE_libSegFault	26
-#define MODULE_libthread_db	27
-#define MODULE_libcidn		28
-#define MODULE_libcrypt		29
-#define MODULE_libnsl		30
-#define MODULE_libpcprofile	31
-#define MODULE_librpcsvc	32
-#define MODULE_nscd		33
-#define MODULE_ldconfig 	34
-#define MODULE_libnldbl 	35
-
-/* Catch-all for test modules and other binaries.  */
-#define MODULE_nonlib		98
-#define MODULE_extramodules	99
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 131d7eb..9b8208b 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -20,8 +20,6 @@
 #ifndef _LIBC_SYMBOLS_H
 #define _LIBC_SYMBOLS_H	1
 
-#include "libc-modules.h"
-
 #define IS_IN(lib) (IN_MODULE == MODULE_##lib)
 
 /* This file's macros are included implicitly in the compilation of every
diff --git a/scripts/gen-libc-modules.awk b/scripts/gen-libc-modules.awk
new file mode 100644
index 0000000..d3382b6
--- /dev/null
+++ b/scripts/gen-libc-modules.awk
@@ -0,0 +1,40 @@
+# Generate a header file that defines the MODULE_* macros for each library and
+# module we build in glibc.  The library names are pulled in from soversions.i
+# and the additional modules are mentioned one-per-line in build.list.
+BEGIN {
+  PROCINFO["sorted_in"] = "@val_type_asc"
+  shlibs = 1
+  others = 1000
+  libs["OTHERS_BEGIN"] = others++
+}
+
+# Skip over comments.
+$1 == "#" {
+  next
+}
+
+# build.list is simply one module per line.
+match (FILENAME, ".*build.list") {
+  libs[$0] = others++
+}
+
+# We have only one special case in soversions.i parsing, which is to replace ld
+# with rtld since that's what we call it throughout the sources.
+match (FILENAME, ".*soversions.i") {
+  name = $2
+  if (name == "ld")
+    name = "rtld"
+
+  if (!(name in libs)) {
+    libs[name] = shlibs++
+  }
+}
+
+# Finally, print out the header file.
+END {
+  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n\n")
+  i = 1
+  for (l in libs) {
+    printf ("#define MODULE_%s %d\n", l, libs[l])
+  }
+}
diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile
index 0e535b6..573e90d 100644
--- a/sysdeps/unix/Makefile
+++ b/sysdeps/unix/Makefile
@@ -79,7 +79,8 @@ compile-syscall = $(COMPILE.S) -o $@ -x assembler-with-cpp - \
 
 ifndef avoid-generated
 $(common-objpfx)sysd-syscalls: $(..)sysdeps/unix/make-syscalls.sh \
-			       $(wildcard $(+sysdep_dirs:%=%/syscalls.list))
+			       $(wildcard $(+sysdep_dirs:%=%/syscalls.list)) \
+			       $(common-objpfx)libc-modules.stmp
 	for dir in $(+sysdep_dirs); do \
 	  test -f $$dir/syscalls.list && \
 	  { sysdirs='$(sysdirs)' \

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [ping3][PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB
  2014-09-17 12:47   ` [ping][PATCH " Siddhesh Poyarekar
  2014-09-24  9:07     ` [ping2][PATCH " Siddhesh Poyarekar
@ 2014-10-01  8:19     ` Siddhesh Poyarekar
  2014-10-14 16:22       ` [ping4][PATCH " Siddhesh Poyarekar
  2014-11-07 23:32     ` [ping][PATCH " Roland McGrath
  2 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-10-01  8:19 UTC (permalink / raw)
  To: libc-alpha; +Cc: Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 2843 bytes --]

Rebased against current master and the patch is unchanged.

Ping!

Siddhesh

On Wed, Sep 17, 2014 at 06:17:16PM +0530, Siddhesh Poyarekar wrote:
> Rebased on top of latest master.  No changes to the patch.
> 
> Siddhesh
> 
> From b3ae47d0b34aa5d0366cf27cb944aa008e069186 Mon Sep 17 00:00:00 2001
> From: Siddhesh Poyarekar <siddhesh@redhat.com>
> Date: Thu, 21 Aug 2014 11:55:35 +0530
> Subject: [PATCH] Use MODULE_NAME in stap-probe instead of IN_LIB
> 
> Verified that the generated code is unchanged on x86_64.
> 
> 	* scripts/gen-libc-modules.awk (END): Generate defines for
> 	MODULE_NAME.
> 	* include/stap-probe.h (LIBC_PROBE_1): Use MODULE_NAME instead
> 	of IN_LIB.
> 	(STAP_PROBE_ASM): Likewise.
> ---
>  include/stap-probe.h         | 6 +++---
>  scripts/gen-libc-modules.awk | 9 ++++++++-
>  2 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/include/stap-probe.h b/include/stap-probe.h
> index 688646c..150fc1e 100644
> --- a/include/stap-probe.h
> +++ b/include/stap-probe.h
> @@ -30,7 +30,7 @@
>  
>     Systemtap's header defines the macros STAP_PROBE (provider, name) and
>     STAP_PROBEn (provider, name, arg1, ..., argn).  For "provider" we paste
> -   in the IN_LIB name (libc, libpthread, etc.) automagically.
> +   in MODULE_NAME (libc, libpthread, etc.) automagically.
>  
>     The format of the arg parameters is discussed here:
>  
> @@ -53,7 +53,7 @@
>  # endif
>  
>  # define LIBC_PROBE(name, n, ...)	\
> -  LIBC_PROBE_1 (IN_LIB, name, n, ## __VA_ARGS__)
> +  LIBC_PROBE_1 (MODULE_NAME, name, n, ## __VA_ARGS__)
>  
>  # define LIBC_PROBE_1(lib, name, n, ...) \
>    STAP_PROBE##n (lib, name, ## __VA_ARGS__)
> @@ -61,7 +61,7 @@
>  # define STAP_PROBE0		STAP_PROBE
>  
>  # define LIBC_PROBE_ASM(name, template) \
> -  STAP_PROBE_ASM (IN_LIB, name, template)
> +  STAP_PROBE_ASM (MODULE_NAME, name, template)
>  
>  # define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS
>  
> diff --git a/scripts/gen-libc-modules.awk b/scripts/gen-libc-modules.awk
> index d3382b6..1ae4af3 100644
> --- a/scripts/gen-libc-modules.awk
> +++ b/scripts/gen-libc-modules.awk
> @@ -32,9 +32,16 @@ match (FILENAME, ".*soversions.i") {
>  
>  # Finally, print out the header file.
>  END {
> -  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n\n")
> +  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n")
>    i = 1
> +  print ("\n/* Allowed values for IN_MODULE.  */")
>    for (l in libs) {
>      printf ("#define MODULE_%s %d\n", l, libs[l])
>    }
> +  print ("\n/* Module names, used in stap-probe.h */")
> +  for (l in libs) {
> +    printf ("#if IN_MODULE == MODULE_%s\n", l)
> +    printf ("# define MODULE_NAME %s\n", l)
> +    printf ("#endif\n")
> +  }
>  }
> -- 
> 1.9.3
> 



[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [ping2][PATCH v2 06/19] Define IN_MODULE for translation units that define NOT_IN_libc
  2014-09-24  9:07     ` [ping][PATCH " Siddhesh Poyarekar
@ 2014-10-01  8:23       ` Siddhesh Poyarekar
  2014-10-14 16:45         ` [ping3][PATCH " Siddhesh Poyarekar
  0 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-10-01  8:23 UTC (permalink / raw)
  To: libc-alpha; +Cc: Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 1150 bytes --]

Rebased against current upstream and patch is unchanged.

Ping!

Siddhesh

On Wed, Sep 24, 2014 at 02:37:31PM +0530, Siddhesh Poyarekar wrote:
> Ping!
> 
> On Wed, Sep 17, 2014 at 05:59:40PM +0530, Siddhesh Poyarekar wrote:
> > Hi,
> > 
> > I have now rebased this patch against the current master.  interp.c
> > does not need the CPPFLAGS anymore, so sotruss-lib is the only code to
> > be built as extramodules to eventually replace the NOT_IN_libc macro.
> > 
> > Build tested on x86_64 to ensure that the generated code is unchanged.
> > 
> > Siddhesh
> > 
> >     	* elf/Makefile (libof-sotruss-lib): Set as extramodules.
> > 
> > diff --git a/elf/Makefile b/elf/Makefile
> > index 677635b..7a5a9aa 100644
> > --- a/elf/Makefile
> > +++ b/elf/Makefile
> > @@ -96,6 +96,7 @@ extra-objs += sotruss-lib.os sotruss-lib.so
> >  install-others += $(inst_auditdir)/sotruss-lib.so
> >  install-bin-script += sotruss
> >  generated += sotruss
> > +libof-sotruss-lib = extramodules
> >  CPPFLAGS-sotruss-lib = -DNOT_IN_libc
> >  $(objpfx)sotruss-lib.so: $(objpfx)sotruss-lib.os
> >  	$(build-module-asneeded)
> 
> 



[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [ping4][PATCH 01/19 v2] Add new macro IN_MODULE to identify module in which source is built
  2014-10-01  8:16         ` [ping3][PATCH " Siddhesh Poyarekar
@ 2014-10-14 16:20           ` Siddhesh Poyarekar
  2014-11-05 11:03             ` [ping5][PATCH " Siddhesh Poyarekar
  2014-11-07 23:22           ` [ping3][PATCH " Roland McGrath
  1 sibling, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-10-14 16:20 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

Ping!

On Wed, Oct 01, 2014 at 01:46:13PM +0530, Siddhesh Poyarekar wrote:
> Rebased on current master, the only change is an unnecessary
> whitespace addition I had missed earlier.  Ping!
> 
> Siddhesh
> 
> commit 3be0b793dc7e72fde3e2c728ca42541bd0a29c9c
> Author: Siddhesh Poyarekar <siddhesh@redhat.com>
> Date:   Thu Aug 21 10:19:31 2014 +0530
> 
>     Add new macro IN_MODULE to identify module in which source is built
>     
>     The current scheme to identify which module a translation unit is
>     built in depends on defining multiple macros IS_IN_* and also defining
>     NOT_IN_libc if we're building a non-libc module.  In addition, there
>     is an IN_LIB macro that does effectively the same thing, but for
>     different modules (notably the systemtap probes).  This macro scheme
>     unifies both ideas to use just one macro IN_MODULE and assign it a
>     value depending on the module it is being built into.  If the module
>     is not defined, it defaults to MODULE_libc.
>     
>     Patches that follow will remove uses of IS_IN_* variables with the
>     IS_IN() macro.  libc-symbols.h has been converted already to give an
>     example of how such a transition will look.
>     
>     Verified that there are no relevant source changes.  One source change
>     that will crop up repeatedly is that of nscd_stat, since it uses the
>     build timestamp as a constant in its logic.
>     
>     	* Makeconfig (in-module): Get value of libof set for the
>     	translation unit.
>     	(module-def): Set IN_MODULE based on value of libof-*.
>     	(CPPFLAGS): Add $(module-def) to CPPFLAGS.
>     	* Makerules: Don't suffix routine names for nonlib.
>     	* include/libc-modules.h: New file.
>     	* include/libc-symbols.h: Include libc-modules.h
>     	(IS_IN): New macro to replace IS_IN_* macros.
>     	* elf/Makefile: Set libof-* for each routine.
>     	* elf/rtld-Rules: Likewise.
>     	* extra-modules.mk: Likewise.
>     	* iconv/Makefile: Likewise.
>     	* iconvdata/Makefile: Likewise.
>     	* locale/Makefile: Likewise.
>     	* malloc/Makefile: Likewise.
>     	* nss/Makefile: Likewise.
>     	* sysdeps/gnu/Makefile: Likewise.
>     	* sysdeps/ieee754/ldbl-opt/Makefile: Likewise.
>     	* sysdeps/unix/sysv/linux/Makefile: Likewise.
>     	* sysdeps/s390/s390-64/Makefile: Likewise.
>     	* nscd/Makefile: Set libof-* for each routine.  Set CFLAGS and
>     	CPPFLAGS for nscd instead of nonlib.
> 
> diff --git a/Makeconfig b/Makeconfig
> index 24a3b82..671eceb 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -813,6 +813,11 @@ endif	# $(+cflags) == ""
>  # of many little headers in the include directory.
>  libio-include = -I$(..)libio
>  
> +in-module = $(strip $(foreach lib,$(libof-$(basename $(@F))) $(libof-$(<F)) \
> +				  $(libof-$(@F)),-DIN_MODULE=MODULE_$(lib)))
> +
> +module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
> +
>  # These are the variables that the implicit compilation rules use.
>  # Note that we can't use -std=* in CPPFLAGS, because it overrides
>  # the implicit -lang-asm and breaks cpp behavior for .S files--notably
> @@ -821,7 +826,7 @@ CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
>  	   $($(subdir)-CPPFLAGS) \
>  	   $(+includes) $(defines) \
>  	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
> -	   $(CPPFLAGS-$(suffix $@)) \
> +	   $(CPPFLAGS-$(suffix $@)) $(module-def) \
>  	   $(foreach lib,$(libof-$(basename $(@F))) \
>  			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
>  	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
> diff --git a/Makerules b/Makerules
> index 3951bb1..3f4b55b 100644
> --- a/Makerules
> +++ b/Makerules
> @@ -1156,7 +1156,7 @@ xcheck: xtests
>  
>  all-nonlib = $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) $(others))
>  ifneq (,$(all-nonlib))
> -cpp-srcs-left = $(all-nonlib:=.c) $(all-nonlib:=.cc)
> +cpp-srcs-left = $(all-nonlib)
>  lib := nonlib
>  include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
>  endif
> diff --git a/elf/Makefile b/elf/Makefile
> index 94074f3..6263a47 100644
> --- a/elf/Makefile
> +++ b/elf/Makefile
> @@ -436,7 +436,8 @@ $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
>  
>  SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
>  CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
> -		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
> +		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1 -DNOT_IN_libc=1
> +libof-ldconfig = ldconfig
>  CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
>  CFLAGS-cache.c = $(SYSCONF-FLAGS)
>  CFLAGS-rtld.c = $(SYSCONF-FLAGS)
> @@ -444,6 +445,10 @@ CFLAGS-rtld.c = $(SYSCONF-FLAGS)
>  CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
>  		     -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
>  
> +cpp-srcs-left := $(all-rtld-routines:=.os)
> +lib := rtld
> +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> +
>  test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
>  generated += $(addsuffix .so,$(strip $(modules-names)))
>  
> diff --git a/elf/rtld-Rules b/elf/rtld-Rules
> index 0a5d6af..4d78d90 100644
> --- a/elf/rtld-Rules
> +++ b/elf/rtld-Rules
> @@ -138,6 +138,11 @@ ifdef rtld-depfiles
>  -include $(rtld-depfiles)
>  endif
>  
> +# Set libof-* for each routine.
> +cpp-srcs-left := $(subst .os,,$(rtld-modules))
> +lib := rtld
> +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> +
>  # This here is the whole point of all the shenanigans.
>  rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld
>  
> diff --git a/extra-modules.mk b/extra-modules.mk
> index c7ed850..9c2e4d2 100644
> --- a/extra-modules.mk
> +++ b/extra-modules.mk
> @@ -6,4 +6,5 @@
>  module := $(firstword $(extra-modules-left))
>  extra-modules-left := $(filter-out $(module),$(extra-modules-left))
>  
> +libof-$(notdir $(module)) := extramodules
>  CPPFLAGS-$(module).c += -DNOT_IN_libc
> diff --git a/iconv/Makefile b/iconv/Makefile
> index 48d17d7..8031a88 100644
> --- a/iconv/Makefile
> +++ b/iconv/Makefile
> @@ -52,11 +52,12 @@ CFLAGS-gconv_cache.c += -DGCONV_DIR='"$(gconvdir)"'
>  CFLAGS-gconv_conf.c = -DGCONV_PATH='"$(gconvdir)"'
>  CFLAGS-iconvconfig.c = -DGCONV_PATH='"$(gconvdir)"' -DGCONV_DIR='"$(gconvdir)"'
>  
> -CPPFLAGS-iconv_charmap = -DNOT_IN_libc
> -CPPFLAGS-linereader = -DNOT_IN_libc
> -CPPFLAGS-strtab = -DNOT_IN_libc
> -CPPFLAGS-charmap = -DNOT_IN_libc
> -CPPFLAGS-charmap-dir = -DNOT_IN_libc
> +CPPFLAGS-iconvprogs = -DNOT_IN_libc
> +
> +# Set libof-* for each routine.
> +cpp-srcs-left := $(iconv_prog-modules) $(iconvconfig-modules)
> +lib := iconvprogs
> +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
>  
>  ifeq ($(run-built-tests),yes)
>  xtests-special += $(objpfx)test-iconvconfig.out
> diff --git a/iconvdata/Makefile b/iconvdata/Makefile
> index b6327d6..e0252ee 100644
> --- a/iconvdata/Makefile
> +++ b/iconvdata/Makefile
> @@ -211,6 +211,7 @@ $(objpfx)iconv-rules: Makefile
>  	$(AWK) 'NR == 1 { \
>  		  for (i = 1; i <= NF; i++) { \
>  		    printf "%s-routines := %s\n", $$i, tolower($$i); \
> +		    printf "libof-%s := iconvdata\n", tolower($$i); \
>  		    printf "%s-map := gconv.map\n", $$i; \
>  		  } \
>  		}; \
> @@ -273,6 +274,11 @@ endif
>  
>  include ../Rules
>  
> +# Set libof-* for each routine.
> +cpp-srcs-left := $(modules) $(generated-modules)
> +lib := iconvdata
> +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> +
>  tst-loading-ENV = MALLOC_TRACE=$(objpfx)tst-loading.mtrace
>  $(objpfx)mtrace-tst-loading.out: $(objpfx)tst-loading.out
>  	$(common-objpfx)malloc/mtrace $(objpfx)tst-loading.mtrace > $@; \
> diff --git a/include/libc-modules.h b/include/libc-modules.h
> new file mode 100644
> index 0000000..d12fb90
> --- /dev/null
> +++ b/include/libc-modules.h
> @@ -0,0 +1,37 @@
> +#define MODULE_libc		1
> +#define MODULE_libpthread	2
> +#define MODULE_rtld		3
> +#define MODULE_libdl		4
> +#define MODULE_libm		5
> +#define MODULE_iconvprogs	6
> +#define MODULE_iconvdata	7
> +#define MODULE_lddlibc4		8
> +#define MODULE_locale_programs	9
> +#define MODULE_memusagestat	10
> +#define MODULE_libutil		12
> +#define MODULE_libBrokenLocale	13
> +#define MODULE_libmemusage	15
> +#define MODULE_libresolv	16
> +#define MODULE_libnss_db	17
> +#define MODULE_libnss_files	18
> +#define	MODULE_libnss_dns	19
> +#define MODULE_libnss_compat	20
> +#define MODULE_libnss_hesiod	21
> +#define MODULE_libnss_nis	22
> +#define MODULE_libnss_nisplus	23
> +#define MODULE_libanl		24
> +#define MODULE_librt		25
> +#define MODULE_libSegFault	26
> +#define MODULE_libthread_db	27
> +#define MODULE_libcidn		28
> +#define MODULE_libcrypt		29
> +#define MODULE_libnsl		30
> +#define MODULE_libpcprofile	31
> +#define MODULE_librpcsvc	32
> +#define MODULE_nscd		33
> +#define MODULE_ldconfig 	34
> +#define MODULE_libnldbl 	35
> +
> +/* Catch-all for test modules and other binaries.  */
> +#define MODULE_nonlib		98
> +#define MODULE_extramodules	99
> diff --git a/include/libc-symbols.h b/include/libc-symbols.h
> index d4ab1f3..131d7eb 100644
> --- a/include/libc-symbols.h
> +++ b/include/libc-symbols.h
> @@ -20,6 +20,10 @@
>  #ifndef _LIBC_SYMBOLS_H
>  #define _LIBC_SYMBOLS_H	1
>  
> +#include "libc-modules.h"
> +
> +#define IS_IN(lib) (IN_MODULE == MODULE_##lib)
> +
>  /* This file's macros are included implicitly in the compilation of every
>     file in the C library by -imacros.
>  
> @@ -468,7 +472,7 @@ for linking")
>     If the function should be internal to multiple objects, say ld.so and
>     libc.so, the best way is to use:
>  
> -   #if !defined NOT_IN_libc || defined IS_IN_rtld
> +   #if IS_IN (libc) || IS_IN (rtld)
>     hidden_proto (foo)
>     #endif
>  
> @@ -584,7 +588,7 @@ for linking")
>  # define libc_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_rtld
> +#if IS_IN (rtld)
>  # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
>  # define rtld_hidden_def(name) hidden_def (name)
> @@ -604,7 +608,7 @@ for linking")
>  # define rtld_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_libm
> +#if IS_IN (libm)
>  # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define libm_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
>  # define libm_hidden_def(name) hidden_def (name)
> @@ -624,7 +628,7 @@ for linking")
>  # define libm_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_libresolv
> +#if IS_IN (libresolv)
>  # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define libresolv_hidden_tls_proto(name, attrs...) \
>    hidden_tls_proto (name, ##attrs)
> @@ -645,7 +649,7 @@ for linking")
>  # define libresolv_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_librt
> +#if IS_IN (librt)
>  # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define librt_hidden_tls_proto(name, attrs...) \
>    hidden_tls_proto (name, ##attrs)
> @@ -666,7 +670,7 @@ for linking")
>  # define librt_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_libdl
> +#if IS_IN (libdl)
>  # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define libdl_hidden_tls_proto(name, attrs...) \
>    hidden_tls_proto (name, ##attrs)
> @@ -687,7 +691,7 @@ for linking")
>  # define libdl_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_libnss_files
> +#if IS_IN (libnss_files)
>  # define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define libnss_files_hidden_tls_proto(name, attrs...) \
>    hidden_tls_proto (name, ##attrs)
> @@ -708,7 +712,7 @@ for linking")
>  # define libnss_files_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_libnsl
> +#if IS_IN (libnsl)
>  # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define libnsl_hidden_tls_proto(name, attrs...) \
>    hidden_tls_proto (name, ##attrs)
> @@ -729,7 +733,7 @@ for linking")
>  # define libnsl_hidden_data_ver(local, name)
>  #endif
>  
> -#ifdef IS_IN_libnss_nisplus
> +#if IS_IN (libnss_nisplus)
>  # define libnss_nisplus_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define libnss_nisplus_hidden_tls_proto(name, attrs...) \
>    hidden_tls_proto (name, ##attrs)
> @@ -758,7 +762,7 @@ for linking")
>  # define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name)
>  #endif
>  
> -#ifdef IS_IN_libutil
> +#if IS_IN (libutil)
>  # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define libutil_hidden_tls_proto(name, attrs...) \
>    hidden_tls_proto (name, ##attrs)
> diff --git a/locale/Makefile b/locale/Makefile
> index e4c3878..5cd18e0 100644
> --- a/locale/Makefile
> +++ b/locale/Makefile
> @@ -85,7 +85,7 @@ locale-CPPFLAGS = -DLOCALEDIR='"$(localedir)"' \
>  		  -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \
>  		  -Iprograms
>  
> -CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
> +CPPFLAGS-locale_programs = -DLOCALE_PATH='$(localepath)' \
>  			   -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
>  			   -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
>  			   -DLOCSRCDIR='"$(i18ndir)/locales"' \
> @@ -96,7 +96,7 @@ CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
>  CFLAGS-charmap-dir.c = -Wno-write-strings
>  
>  # This makes sure -DNOT_IN_libc et al are passed for all these modules.
> -cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \
> -				$(locale-modules) $(lib-modules))
> -lib := locale-programs
> +cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
> +		 $(lib-modules)
> +lib := locale_programs
>  include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> diff --git a/malloc/Makefile b/malloc/Makefile
> index 9e93523..fbfada2 100644
> --- a/malloc/Makefile
> +++ b/malloc/Makefile
> @@ -89,6 +89,11 @@ endif
>  do-memusagestat: $(objpfx)memusagestat
>  
>  memusagestat-modules = memusagestat
> +
> +cpp-srcs-left := $(memusagestat-modules)
> +lib := memusagestat
> +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> +
>  $(objpfx)memusagestat: $(memusagestat-modules:%=$(objpfx)%.o)
>  	$(LINK.o) -o $@ $^ $(libgd-LDFLAGS) -lgd -lpng -lz -lm
>  
> diff --git a/nscd/Makefile b/nscd/Makefile
> index 639d87b..7ab4e9d 100644
> --- a/nscd/Makefile
> +++ b/nscd/Makefile
> @@ -79,23 +79,22 @@ CFLAGS-nscd_gethst_r.c = -fexceptions
>  CFLAGS-nscd_getai.c = -fexceptions
>  CFLAGS-nscd_initgroups.c = -fexceptions
>  
> -CPPFLAGS-nonlib += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2
> +CPPFLAGS-nscd += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2 -DNOT_IN_libc=1
>  
>  ifeq (yesyes,$(have-fpie)$(build-shared))
> -CFLAGS-nonlib += $(pie-ccflag)
> +CFLAGS-nscd += $(pie-ccflag)
>  endif
>  ifeq (yes,$(have-ssp))
> -CFLAGS-nonlib += -fstack-protector
> +CFLAGS-nscd += -fstack-protector
>  endif
>  
>  ifeq (yesyes,$(have-fpie)$(build-shared))
>  LDFLAGS-nscd = -Wl,-z,now
>  endif
>  
> -# This makes sure CPPFLAGS-nonlib and CFLAGS-nonlib are passed
> -# for all these modules.
> -cpp-srcs-left := $(nscd-modules:=.c)
> -lib := nonlib
> +# Set libof-nscd.
> +cpp-srcs-left := $(nscd-modules)
> +lib := nscd
>  include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
>  
>  $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
> diff --git a/nss/Makefile b/nss/Makefile
> index 1fa7f1f..7114d74 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -105,7 +105,8 @@ $(objpfx)makedb: $(makedb-modules:%=$(objpfx)%.o)
>  $(inst_vardbdir)/Makefile: db-Makefile $(+force)
>  	$(do-install)
>  
> -CFLAGS-nss_test1.c = -DNOT_IN_libc=1
> +libof-nss_test1 = extramodules
> +CPPFLAGS-nss_test1 = -DNOT_IN_libc=1
>  $(objpfx)/libnss_test1.so: $(objpfx)nss_test1.os $(link-libc-deps)
>  	$(build-module)
>  ifdef libnss_test1.so-version
> diff --git a/stdlib/Makefile b/stdlib/Makefile
> index 9b2271b..da6e076 100644
> --- a/stdlib/Makefile
> +++ b/stdlib/Makefile
> @@ -145,6 +145,7 @@ LDFLAGS-tst-putenv = $(no-as-needed)
>  
>  $(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os $(link-libc-deps)
>  	$(build-module)
> +libof-tst-putenvmod = extramodules
>  CFLAGS-tst-putenvmod.c = -DNOT_IN_libc=1
>  
>  $(objpfx)bug-getcontext: $(libm)
> diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
> index c05708d..b5b2cf0 100644
> --- a/sysdeps/gnu/Makefile
> +++ b/sysdeps/gnu/Makefile
> @@ -29,6 +29,8 @@ ifeq ($(subdir),stdio-common)
>  
>  errlist-c = $(firstword $(wildcard $(addsuffix /errlist.c,$(sysdirs) .)))
>  
> +libof-errlist-compat = extramodules
> +
>  ifeq ($(build-shared),yes)
>  $(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \
>  			   $(common-objpfx)Versions.v.i $(before-compile)
> diff --git a/sysdeps/s390/s390-64/Makefile b/sysdeps/s390/s390-64/Makefile
> index fe5030e..ce4f0c5 100644
> --- a/sysdeps/s390/s390-64/Makefile
> +++ b/sysdeps/s390/s390-64/Makefile
> @@ -28,6 +28,10 @@ s390x-iconv-modules = ISO-8859-1_CP037_Z900 UTF8_UTF16_Z9 UTF16_UTF32_Z9 UTF8_UT
>  extra-modules-left += $(s390x-iconv-modules)
>  include extra-module.mk
>  
> +cpp-srcs-left := $(foreach mod,$(s390x-iconv-modules),$($(mod)-routines))
> +lib := iconvdata
> +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> +
>  extra-objs      += $(addsuffix .so, $(s390x-iconv-modules))
>  install-others  += $(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules))
>  
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index 9ad6d22..2d6d8bb 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -178,6 +178,7 @@ ifeq ($(subdir),elf)
>  sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \
>  			dl-fxstatat64
>  
> +libof-lddlibc4 = lddlibc4
>  CPPFLAGS-lddlibc4 += -DNOT_IN_libc
>  
>  others += pldd


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

* [ping4][PATCH 03/19 v2] Auto-generate libc-modules.h
  2014-10-01  8:18         ` [ping3][PATCH " Siddhesh Poyarekar
@ 2014-10-14 16:21           ` Siddhesh Poyarekar
  2014-11-07 23:29           ` [ping3][PATCH " Roland McGrath
  1 sibling, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-10-14 16:21 UTC (permalink / raw)
  To: libc-alpha; +Cc: Roland McGrath

Ping!

On Wed, Oct 01, 2014 at 01:47:50PM +0530, Siddhesh Poyarekar wrote:
> Rebased against current master and verified that the generated code is
> still unchanged.
> 
> Siddhesh
> 
> commit 33724079bde7aca8149fa9c2831578041cf7da03
> Author: Siddhesh Poyarekar <siddhesh@redhat.com>
> Date:   Thu Aug 21 11:44:54 2014 +0530
> 
>     Auto-generate libc-modules.h
>     
>     Remove libc-modules.h from the tree and auto-generate it from
>     soversions.i and a new file build.list.  Macros generated from
>     soversions.i have lower values starting from 1, while those from
>     build.list start from a special value MODULE_OTHER_BEGIN, which has a
>     high enough value (1000).  This allows us to conveniently
>     differentiate between the versioned libraries and other built modules,
>     which is needed in errno.h and netdb.h to decide whether to use an
>     internal symbol or an external one.
>     
>     Verified that generated code remains unchanged on x86_64.
>     
>     	* Makeconfig (module-cppflags): Include libc-modules.h for
>     	everything except shlib-versions.v.i.
>     	(CPPFLAGS): Use it.
>     	(before-compile): Add libc-modules.h.
>     	($(common-objpfx)libc-modules.h,
>     	$(common-objpfx)libc-modules.stmp): New targets.
>     	(common-generated): Add libc-modules.h and libc-modules.stmp.
>     	($(common-objpfx)Versions.v.i): Depend on libc-modules.h.
>     	* build.list: New file.
>     	* include/libc-symbols.h: Don't include libc-modules.h.
>     	* include/libc-modules.h: Remove file.
>     	* scripts/gen-libc-modules.awk: New script to generate
>     	libc-modules.h.
>     	* sysdeps/unix/Makefile ($(common-objpfx)sysd-syscalls):
>     	Depend on libc-modules.stmp.
> 
> diff --git a/Makeconfig b/Makeconfig
> index 671eceb..5ffbd92 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -813,10 +813,22 @@ endif	# $(+cflags) == ""
>  # of many little headers in the include directory.
>  libio-include = -I$(..)libio
>  
> +# We don't include libc-modules.h when these targets are being built.  These
> +# targets don't (and will likely never need to) use the IS_IN facility.  In
> +# fact, shlib-versions should not use it because that will create a circular
> +# dependency as libc-modules.h is generated from shlib-versions.
> +skip-module-cppflags = shlib-versions.v.i Versions.v.i
> +
>  in-module = $(strip $(foreach lib,$(libof-$(basename $(@F))) $(libof-$(<F)) \
>  				  $(libof-$(@F)),-DIN_MODULE=MODULE_$(lib)))
>  
>  module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
> +module-cppflags-real = -include $(common-objpfx)libc-modules.h $(module-def)
> +
> +# We don't need libc-modules.h and the IN_MODULE definition for
> +# shlib-version.v.i.
> +module-cppflags = $(if $(filter $(@F),$(skip-module-cppflags)), \
> +		       ,$(module-cppflags-real))
>  
>  # These are the variables that the implicit compilation rules use.
>  # Note that we can't use -std=* in CPPFLAGS, because it overrides
> @@ -824,9 +836,9 @@ module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
>  # it causes cpp to stop predefining __ASSEMBLER__.
>  CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
>  	   $($(subdir)-CPPFLAGS) \
> -	   $(+includes) $(defines) \
> +	   $(+includes) $(defines) $(module-cppflags) \
>  	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
> -	   $(CPPFLAGS-$(suffix $@)) $(module-def) \
> +	   $(CPPFLAGS-$(suffix $@)) \
>  	   $(foreach lib,$(libof-$(basename $(@F))) \
>  			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
>  	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
> @@ -986,6 +998,24 @@ endif
>  postclean-generated += soversions.mk soversions.i \
>  		       shlib-versions.v shlib-versions.v.i
>  
> +before-compile += $(common-objpfx)libc-modules.h
> +ifeq ($(soversions.mk-done),t)
> +# Generate a header with macro definitions for use with the IS_IN macro.
> +# These are the possible values for the IN_MODULE macro defined when building
> +# sources, to identify which module the translation unit is going to be built
> +# into.
> +$(common-objpfx)libc-modules.h: $(common-objpfx)libc-modules.stmp; @:
> +$(common-objpfx)libc-modules.stmp: $(..)scripts/gen-libc-modules.awk \
> +				   $(common-objpfx)soversions.i \
> +				   $(..)build.list
> +	$(AWK) -f $^ > ${@:stmp=T}
> +	$(move-if-change) ${@:stmp=T} ${@:stmp=h}
> +	touch $@
> +
> +endif
> +
> +common-generated += libc-modules.h libc-modules.stmp
> +
>  # The name under which the run-time dynamic linker is installed.
>  # We are currently going for the convention that `/lib/ld.so.1'
>  # names the SVR4/ELF ABI-compliant dynamic linker.
> diff --git a/build.list b/build.list
> new file mode 100644
> index 0000000..eab57c7
> --- /dev/null
> +++ b/build.list
> @@ -0,0 +1,15 @@
> +iconvprogs
> +iconvdata
> +ldconfig
> +lddlibc4
> +libmemusage
> +libSegFault
> +libpcprofile
> +librpcsvc
> +libutil
> +locale_programs
> +memusagestat
> +nonlib
> +nscd
> +extramodules
> +libnldbl
> diff --git a/include/libc-modules.h b/include/libc-modules.h
> deleted file mode 100644
> index d12fb90..0000000
> --- a/include/libc-modules.h
> +++ /dev/null
> @@ -1,37 +0,0 @@
> -#define MODULE_libc		1
> -#define MODULE_libpthread	2
> -#define MODULE_rtld		3
> -#define MODULE_libdl		4
> -#define MODULE_libm		5
> -#define MODULE_iconvprogs	6
> -#define MODULE_iconvdata	7
> -#define MODULE_lddlibc4		8
> -#define MODULE_locale_programs	9
> -#define MODULE_memusagestat	10
> -#define MODULE_libutil		12
> -#define MODULE_libBrokenLocale	13
> -#define MODULE_libmemusage	15
> -#define MODULE_libresolv	16
> -#define MODULE_libnss_db	17
> -#define MODULE_libnss_files	18
> -#define	MODULE_libnss_dns	19
> -#define MODULE_libnss_compat	20
> -#define MODULE_libnss_hesiod	21
> -#define MODULE_libnss_nis	22
> -#define MODULE_libnss_nisplus	23
> -#define MODULE_libanl		24
> -#define MODULE_librt		25
> -#define MODULE_libSegFault	26
> -#define MODULE_libthread_db	27
> -#define MODULE_libcidn		28
> -#define MODULE_libcrypt		29
> -#define MODULE_libnsl		30
> -#define MODULE_libpcprofile	31
> -#define MODULE_librpcsvc	32
> -#define MODULE_nscd		33
> -#define MODULE_ldconfig 	34
> -#define MODULE_libnldbl 	35
> -
> -/* Catch-all for test modules and other binaries.  */
> -#define MODULE_nonlib		98
> -#define MODULE_extramodules	99
> diff --git a/include/libc-symbols.h b/include/libc-symbols.h
> index 131d7eb..9b8208b 100644
> --- a/include/libc-symbols.h
> +++ b/include/libc-symbols.h
> @@ -20,8 +20,6 @@
>  #ifndef _LIBC_SYMBOLS_H
>  #define _LIBC_SYMBOLS_H	1
>  
> -#include "libc-modules.h"
> -
>  #define IS_IN(lib) (IN_MODULE == MODULE_##lib)
>  
>  /* This file's macros are included implicitly in the compilation of every
> diff --git a/scripts/gen-libc-modules.awk b/scripts/gen-libc-modules.awk
> new file mode 100644
> index 0000000..d3382b6
> --- /dev/null
> +++ b/scripts/gen-libc-modules.awk
> @@ -0,0 +1,40 @@
> +# Generate a header file that defines the MODULE_* macros for each library and
> +# module we build in glibc.  The library names are pulled in from soversions.i
> +# and the additional modules are mentioned one-per-line in build.list.
> +BEGIN {
> +  PROCINFO["sorted_in"] = "@val_type_asc"
> +  shlibs = 1
> +  others = 1000
> +  libs["OTHERS_BEGIN"] = others++
> +}
> +
> +# Skip over comments.
> +$1 == "#" {
> +  next
> +}
> +
> +# build.list is simply one module per line.
> +match (FILENAME, ".*build.list") {
> +  libs[$0] = others++
> +}
> +
> +# We have only one special case in soversions.i parsing, which is to replace ld
> +# with rtld since that's what we call it throughout the sources.
> +match (FILENAME, ".*soversions.i") {
> +  name = $2
> +  if (name == "ld")
> +    name = "rtld"
> +
> +  if (!(name in libs)) {
> +    libs[name] = shlibs++
> +  }
> +}
> +
> +# Finally, print out the header file.
> +END {
> +  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n\n")
> +  i = 1
> +  for (l in libs) {
> +    printf ("#define MODULE_%s %d\n", l, libs[l])
> +  }
> +}
> diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile
> index 0e535b6..573e90d 100644
> --- a/sysdeps/unix/Makefile
> +++ b/sysdeps/unix/Makefile
> @@ -79,7 +79,8 @@ compile-syscall = $(COMPILE.S) -o $@ -x assembler-with-cpp - \
>  
>  ifndef avoid-generated
>  $(common-objpfx)sysd-syscalls: $(..)sysdeps/unix/make-syscalls.sh \
> -			       $(wildcard $(+sysdep_dirs:%=%/syscalls.list))
> +			       $(wildcard $(+sysdep_dirs:%=%/syscalls.list)) \
> +			       $(common-objpfx)libc-modules.stmp
>  	for dir in $(+sysdep_dirs); do \
>  	  test -f $$dir/syscalls.list && \
>  	  { sysdirs='$(sysdirs)' \


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

* [ping4][PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB
  2014-10-01  8:19     ` [ping3][PATCH " Siddhesh Poyarekar
@ 2014-10-14 16:22       ` Siddhesh Poyarekar
  0 siblings, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-10-14 16:22 UTC (permalink / raw)
  To: libc-alpha; +Cc: Roland McGrath

Ping!

On Wed, Oct 01, 2014 at 01:49:40PM +0530, Siddhesh Poyarekar wrote:
> Rebased against current master and the patch is unchanged.
> 
> Ping!
> 
> Siddhesh
> 
> On Wed, Sep 17, 2014 at 06:17:16PM +0530, Siddhesh Poyarekar wrote:
> > Rebased on top of latest master.  No changes to the patch.
> > 
> > Siddhesh
> > 
> > From b3ae47d0b34aa5d0366cf27cb944aa008e069186 Mon Sep 17 00:00:00 2001
> > From: Siddhesh Poyarekar <siddhesh@redhat.com>
> > Date: Thu, 21 Aug 2014 11:55:35 +0530
> > Subject: [PATCH] Use MODULE_NAME in stap-probe instead of IN_LIB
> > 
> > Verified that the generated code is unchanged on x86_64.
> > 
> > 	* scripts/gen-libc-modules.awk (END): Generate defines for
> > 	MODULE_NAME.
> > 	* include/stap-probe.h (LIBC_PROBE_1): Use MODULE_NAME instead
> > 	of IN_LIB.
> > 	(STAP_PROBE_ASM): Likewise.
> > ---
> >  include/stap-probe.h         | 6 +++---
> >  scripts/gen-libc-modules.awk | 9 ++++++++-
> >  2 files changed, 11 insertions(+), 4 deletions(-)
> > 
> > diff --git a/include/stap-probe.h b/include/stap-probe.h
> > index 688646c..150fc1e 100644
> > --- a/include/stap-probe.h
> > +++ b/include/stap-probe.h
> > @@ -30,7 +30,7 @@
> >  
> >     Systemtap's header defines the macros STAP_PROBE (provider, name) and
> >     STAP_PROBEn (provider, name, arg1, ..., argn).  For "provider" we paste
> > -   in the IN_LIB name (libc, libpthread, etc.) automagically.
> > +   in MODULE_NAME (libc, libpthread, etc.) automagically.
> >  
> >     The format of the arg parameters is discussed here:
> >  
> > @@ -53,7 +53,7 @@
> >  # endif
> >  
> >  # define LIBC_PROBE(name, n, ...)	\
> > -  LIBC_PROBE_1 (IN_LIB, name, n, ## __VA_ARGS__)
> > +  LIBC_PROBE_1 (MODULE_NAME, name, n, ## __VA_ARGS__)
> >  
> >  # define LIBC_PROBE_1(lib, name, n, ...) \
> >    STAP_PROBE##n (lib, name, ## __VA_ARGS__)
> > @@ -61,7 +61,7 @@
> >  # define STAP_PROBE0		STAP_PROBE
> >  
> >  # define LIBC_PROBE_ASM(name, template) \
> > -  STAP_PROBE_ASM (IN_LIB, name, template)
> > +  STAP_PROBE_ASM (MODULE_NAME, name, template)
> >  
> >  # define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS
> >  
> > diff --git a/scripts/gen-libc-modules.awk b/scripts/gen-libc-modules.awk
> > index d3382b6..1ae4af3 100644
> > --- a/scripts/gen-libc-modules.awk
> > +++ b/scripts/gen-libc-modules.awk
> > @@ -32,9 +32,16 @@ match (FILENAME, ".*soversions.i") {
> >  
> >  # Finally, print out the header file.
> >  END {
> > -  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n\n")
> > +  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n")
> >    i = 1
> > +  print ("\n/* Allowed values for IN_MODULE.  */")
> >    for (l in libs) {
> >      printf ("#define MODULE_%s %d\n", l, libs[l])
> >    }
> > +  print ("\n/* Module names, used in stap-probe.h */")
> > +  for (l in libs) {
> > +    printf ("#if IN_MODULE == MODULE_%s\n", l)
> > +    printf ("# define MODULE_NAME %s\n", l)
> > +    printf ("#endif\n")
> > +  }
> >  }
> > -- 
> > 1.9.3
> > 
> 
> 


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

* [ping3][PATCH v2 06/19] Define IN_MODULE for translation units that define NOT_IN_libc
  2014-10-01  8:23       ` [ping2][PATCH " Siddhesh Poyarekar
@ 2014-10-14 16:45         ` Siddhesh Poyarekar
  0 siblings, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-10-14 16:45 UTC (permalink / raw)
  To: libc-alpha; +Cc: Roland McGrath

Ping!

On Wed, Oct 01, 2014 at 01:52:54PM +0530, Siddhesh Poyarekar wrote:
> Rebased against current upstream and patch is unchanged.
> 
> Ping!
> 
> Siddhesh
> 
> On Wed, Sep 24, 2014 at 02:37:31PM +0530, Siddhesh Poyarekar wrote:
> > Ping!
> > 
> > On Wed, Sep 17, 2014 at 05:59:40PM +0530, Siddhesh Poyarekar wrote:
> > > Hi,
> > > 
> > > I have now rebased this patch against the current master.  interp.c
> > > does not need the CPPFLAGS anymore, so sotruss-lib is the only code to
> > > be built as extramodules to eventually replace the NOT_IN_libc macro.
> > > 
> > > Build tested on x86_64 to ensure that the generated code is unchanged.
> > > 
> > > Siddhesh
> > > 
> > >     	* elf/Makefile (libof-sotruss-lib): Set as extramodules.
> > > 
> > > diff --git a/elf/Makefile b/elf/Makefile
> > > index 677635b..7a5a9aa 100644
> > > --- a/elf/Makefile
> > > +++ b/elf/Makefile
> > > @@ -96,6 +96,7 @@ extra-objs += sotruss-lib.os sotruss-lib.so
> > >  install-others += $(inst_auditdir)/sotruss-lib.so
> > >  install-bin-script += sotruss
> > >  generated += sotruss
> > > +libof-sotruss-lib = extramodules
> > >  CPPFLAGS-sotruss-lib = -DNOT_IN_libc
> > >  $(objpfx)sotruss-lib.so: $(objpfx)sotruss-lib.os
> > >  	$(build-module-asneeded)
> > 
> > 
> 
> 


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

* [ping5][PATCH 01/19 v2] Add new macro IN_MODULE to identify module in which source is built
  2014-10-14 16:20           ` [ping4][PATCH " Siddhesh Poyarekar
@ 2014-11-05 11:03             ` Siddhesh Poyarekar
  0 siblings, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-11-05 11:03 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 19426 bytes --]

Ping!

On Tue, Oct 14, 2014 at 09:50:34PM +0530, Siddhesh Poyarekar wrote:
> Ping!
> 
> On Wed, Oct 01, 2014 at 01:46:13PM +0530, Siddhesh Poyarekar wrote:
> > Rebased on current master, the only change is an unnecessary
> > whitespace addition I had missed earlier.  Ping!
> > 
> > Siddhesh
> > 
> > commit 3be0b793dc7e72fde3e2c728ca42541bd0a29c9c
> > Author: Siddhesh Poyarekar <siddhesh@redhat.com>
> > Date:   Thu Aug 21 10:19:31 2014 +0530
> > 
> >     Add new macro IN_MODULE to identify module in which source is built
> >     
> >     The current scheme to identify which module a translation unit is
> >     built in depends on defining multiple macros IS_IN_* and also defining
> >     NOT_IN_libc if we're building a non-libc module.  In addition, there
> >     is an IN_LIB macro that does effectively the same thing, but for
> >     different modules (notably the systemtap probes).  This macro scheme
> >     unifies both ideas to use just one macro IN_MODULE and assign it a
> >     value depending on the module it is being built into.  If the module
> >     is not defined, it defaults to MODULE_libc.
> >     
> >     Patches that follow will remove uses of IS_IN_* variables with the
> >     IS_IN() macro.  libc-symbols.h has been converted already to give an
> >     example of how such a transition will look.
> >     
> >     Verified that there are no relevant source changes.  One source change
> >     that will crop up repeatedly is that of nscd_stat, since it uses the
> >     build timestamp as a constant in its logic.
> >     
> >     	* Makeconfig (in-module): Get value of libof set for the
> >     	translation unit.
> >     	(module-def): Set IN_MODULE based on value of libof-*.
> >     	(CPPFLAGS): Add $(module-def) to CPPFLAGS.
> >     	* Makerules: Don't suffix routine names for nonlib.
> >     	* include/libc-modules.h: New file.
> >     	* include/libc-symbols.h: Include libc-modules.h
> >     	(IS_IN): New macro to replace IS_IN_* macros.
> >     	* elf/Makefile: Set libof-* for each routine.
> >     	* elf/rtld-Rules: Likewise.
> >     	* extra-modules.mk: Likewise.
> >     	* iconv/Makefile: Likewise.
> >     	* iconvdata/Makefile: Likewise.
> >     	* locale/Makefile: Likewise.
> >     	* malloc/Makefile: Likewise.
> >     	* nss/Makefile: Likewise.
> >     	* sysdeps/gnu/Makefile: Likewise.
> >     	* sysdeps/ieee754/ldbl-opt/Makefile: Likewise.
> >     	* sysdeps/unix/sysv/linux/Makefile: Likewise.
> >     	* sysdeps/s390/s390-64/Makefile: Likewise.
> >     	* nscd/Makefile: Set libof-* for each routine.  Set CFLAGS and
> >     	CPPFLAGS for nscd instead of nonlib.
> > 
> > diff --git a/Makeconfig b/Makeconfig
> > index 24a3b82..671eceb 100644
> > --- a/Makeconfig
> > +++ b/Makeconfig
> > @@ -813,6 +813,11 @@ endif	# $(+cflags) == ""
> >  # of many little headers in the include directory.
> >  libio-include = -I$(..)libio
> >  
> > +in-module = $(strip $(foreach lib,$(libof-$(basename $(@F))) $(libof-$(<F)) \
> > +				  $(libof-$(@F)),-DIN_MODULE=MODULE_$(lib)))
> > +
> > +module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
> > +
> >  # These are the variables that the implicit compilation rules use.
> >  # Note that we can't use -std=* in CPPFLAGS, because it overrides
> >  # the implicit -lang-asm and breaks cpp behavior for .S files--notably
> > @@ -821,7 +826,7 @@ CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
> >  	   $($(subdir)-CPPFLAGS) \
> >  	   $(+includes) $(defines) \
> >  	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
> > -	   $(CPPFLAGS-$(suffix $@)) \
> > +	   $(CPPFLAGS-$(suffix $@)) $(module-def) \
> >  	   $(foreach lib,$(libof-$(basename $(@F))) \
> >  			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
> >  	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
> > diff --git a/Makerules b/Makerules
> > index 3951bb1..3f4b55b 100644
> > --- a/Makerules
> > +++ b/Makerules
> > @@ -1156,7 +1156,7 @@ xcheck: xtests
> >  
> >  all-nonlib = $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) $(others))
> >  ifneq (,$(all-nonlib))
> > -cpp-srcs-left = $(all-nonlib:=.c) $(all-nonlib:=.cc)
> > +cpp-srcs-left = $(all-nonlib)
> >  lib := nonlib
> >  include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> >  endif
> > diff --git a/elf/Makefile b/elf/Makefile
> > index 94074f3..6263a47 100644
> > --- a/elf/Makefile
> > +++ b/elf/Makefile
> > @@ -436,7 +436,8 @@ $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
> >  
> >  SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
> >  CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
> > -		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
> > +		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1 -DNOT_IN_libc=1
> > +libof-ldconfig = ldconfig
> >  CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
> >  CFLAGS-cache.c = $(SYSCONF-FLAGS)
> >  CFLAGS-rtld.c = $(SYSCONF-FLAGS)
> > @@ -444,6 +445,10 @@ CFLAGS-rtld.c = $(SYSCONF-FLAGS)
> >  CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
> >  		     -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
> >  
> > +cpp-srcs-left := $(all-rtld-routines:=.os)
> > +lib := rtld
> > +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> > +
> >  test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
> >  generated += $(addsuffix .so,$(strip $(modules-names)))
> >  
> > diff --git a/elf/rtld-Rules b/elf/rtld-Rules
> > index 0a5d6af..4d78d90 100644
> > --- a/elf/rtld-Rules
> > +++ b/elf/rtld-Rules
> > @@ -138,6 +138,11 @@ ifdef rtld-depfiles
> >  -include $(rtld-depfiles)
> >  endif
> >  
> > +# Set libof-* for each routine.
> > +cpp-srcs-left := $(subst .os,,$(rtld-modules))
> > +lib := rtld
> > +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> > +
> >  # This here is the whole point of all the shenanigans.
> >  rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld
> >  
> > diff --git a/extra-modules.mk b/extra-modules.mk
> > index c7ed850..9c2e4d2 100644
> > --- a/extra-modules.mk
> > +++ b/extra-modules.mk
> > @@ -6,4 +6,5 @@
> >  module := $(firstword $(extra-modules-left))
> >  extra-modules-left := $(filter-out $(module),$(extra-modules-left))
> >  
> > +libof-$(notdir $(module)) := extramodules
> >  CPPFLAGS-$(module).c += -DNOT_IN_libc
> > diff --git a/iconv/Makefile b/iconv/Makefile
> > index 48d17d7..8031a88 100644
> > --- a/iconv/Makefile
> > +++ b/iconv/Makefile
> > @@ -52,11 +52,12 @@ CFLAGS-gconv_cache.c += -DGCONV_DIR='"$(gconvdir)"'
> >  CFLAGS-gconv_conf.c = -DGCONV_PATH='"$(gconvdir)"'
> >  CFLAGS-iconvconfig.c = -DGCONV_PATH='"$(gconvdir)"' -DGCONV_DIR='"$(gconvdir)"'
> >  
> > -CPPFLAGS-iconv_charmap = -DNOT_IN_libc
> > -CPPFLAGS-linereader = -DNOT_IN_libc
> > -CPPFLAGS-strtab = -DNOT_IN_libc
> > -CPPFLAGS-charmap = -DNOT_IN_libc
> > -CPPFLAGS-charmap-dir = -DNOT_IN_libc
> > +CPPFLAGS-iconvprogs = -DNOT_IN_libc
> > +
> > +# Set libof-* for each routine.
> > +cpp-srcs-left := $(iconv_prog-modules) $(iconvconfig-modules)
> > +lib := iconvprogs
> > +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> >  
> >  ifeq ($(run-built-tests),yes)
> >  xtests-special += $(objpfx)test-iconvconfig.out
> > diff --git a/iconvdata/Makefile b/iconvdata/Makefile
> > index b6327d6..e0252ee 100644
> > --- a/iconvdata/Makefile
> > +++ b/iconvdata/Makefile
> > @@ -211,6 +211,7 @@ $(objpfx)iconv-rules: Makefile
> >  	$(AWK) 'NR == 1 { \
> >  		  for (i = 1; i <= NF; i++) { \
> >  		    printf "%s-routines := %s\n", $$i, tolower($$i); \
> > +		    printf "libof-%s := iconvdata\n", tolower($$i); \
> >  		    printf "%s-map := gconv.map\n", $$i; \
> >  		  } \
> >  		}; \
> > @@ -273,6 +274,11 @@ endif
> >  
> >  include ../Rules
> >  
> > +# Set libof-* for each routine.
> > +cpp-srcs-left := $(modules) $(generated-modules)
> > +lib := iconvdata
> > +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> > +
> >  tst-loading-ENV = MALLOC_TRACE=$(objpfx)tst-loading.mtrace
> >  $(objpfx)mtrace-tst-loading.out: $(objpfx)tst-loading.out
> >  	$(common-objpfx)malloc/mtrace $(objpfx)tst-loading.mtrace > $@; \
> > diff --git a/include/libc-modules.h b/include/libc-modules.h
> > new file mode 100644
> > index 0000000..d12fb90
> > --- /dev/null
> > +++ b/include/libc-modules.h
> > @@ -0,0 +1,37 @@
> > +#define MODULE_libc		1
> > +#define MODULE_libpthread	2
> > +#define MODULE_rtld		3
> > +#define MODULE_libdl		4
> > +#define MODULE_libm		5
> > +#define MODULE_iconvprogs	6
> > +#define MODULE_iconvdata	7
> > +#define MODULE_lddlibc4		8
> > +#define MODULE_locale_programs	9
> > +#define MODULE_memusagestat	10
> > +#define MODULE_libutil		12
> > +#define MODULE_libBrokenLocale	13
> > +#define MODULE_libmemusage	15
> > +#define MODULE_libresolv	16
> > +#define MODULE_libnss_db	17
> > +#define MODULE_libnss_files	18
> > +#define	MODULE_libnss_dns	19
> > +#define MODULE_libnss_compat	20
> > +#define MODULE_libnss_hesiod	21
> > +#define MODULE_libnss_nis	22
> > +#define MODULE_libnss_nisplus	23
> > +#define MODULE_libanl		24
> > +#define MODULE_librt		25
> > +#define MODULE_libSegFault	26
> > +#define MODULE_libthread_db	27
> > +#define MODULE_libcidn		28
> > +#define MODULE_libcrypt		29
> > +#define MODULE_libnsl		30
> > +#define MODULE_libpcprofile	31
> > +#define MODULE_librpcsvc	32
> > +#define MODULE_nscd		33
> > +#define MODULE_ldconfig 	34
> > +#define MODULE_libnldbl 	35
> > +
> > +/* Catch-all for test modules and other binaries.  */
> > +#define MODULE_nonlib		98
> > +#define MODULE_extramodules	99
> > diff --git a/include/libc-symbols.h b/include/libc-symbols.h
> > index d4ab1f3..131d7eb 100644
> > --- a/include/libc-symbols.h
> > +++ b/include/libc-symbols.h
> > @@ -20,6 +20,10 @@
> >  #ifndef _LIBC_SYMBOLS_H
> >  #define _LIBC_SYMBOLS_H	1
> >  
> > +#include "libc-modules.h"
> > +
> > +#define IS_IN(lib) (IN_MODULE == MODULE_##lib)
> > +
> >  /* This file's macros are included implicitly in the compilation of every
> >     file in the C library by -imacros.
> >  
> > @@ -468,7 +472,7 @@ for linking")
> >     If the function should be internal to multiple objects, say ld.so and
> >     libc.so, the best way is to use:
> >  
> > -   #if !defined NOT_IN_libc || defined IS_IN_rtld
> > +   #if IS_IN (libc) || IS_IN (rtld)
> >     hidden_proto (foo)
> >     #endif
> >  
> > @@ -584,7 +588,7 @@ for linking")
> >  # define libc_hidden_data_ver(local, name)
> >  #endif
> >  
> > -#ifdef IS_IN_rtld
> > +#if IS_IN (rtld)
> >  # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
> >  # define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
> >  # define rtld_hidden_def(name) hidden_def (name)
> > @@ -604,7 +608,7 @@ for linking")
> >  # define rtld_hidden_data_ver(local, name)
> >  #endif
> >  
> > -#ifdef IS_IN_libm
> > +#if IS_IN (libm)
> >  # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
> >  # define libm_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
> >  # define libm_hidden_def(name) hidden_def (name)
> > @@ -624,7 +628,7 @@ for linking")
> >  # define libm_hidden_data_ver(local, name)
> >  #endif
> >  
> > -#ifdef IS_IN_libresolv
> > +#if IS_IN (libresolv)
> >  # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
> >  # define libresolv_hidden_tls_proto(name, attrs...) \
> >    hidden_tls_proto (name, ##attrs)
> > @@ -645,7 +649,7 @@ for linking")
> >  # define libresolv_hidden_data_ver(local, name)
> >  #endif
> >  
> > -#ifdef IS_IN_librt
> > +#if IS_IN (librt)
> >  # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
> >  # define librt_hidden_tls_proto(name, attrs...) \
> >    hidden_tls_proto (name, ##attrs)
> > @@ -666,7 +670,7 @@ for linking")
> >  # define librt_hidden_data_ver(local, name)
> >  #endif
> >  
> > -#ifdef IS_IN_libdl
> > +#if IS_IN (libdl)
> >  # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
> >  # define libdl_hidden_tls_proto(name, attrs...) \
> >    hidden_tls_proto (name, ##attrs)
> > @@ -687,7 +691,7 @@ for linking")
> >  # define libdl_hidden_data_ver(local, name)
> >  #endif
> >  
> > -#ifdef IS_IN_libnss_files
> > +#if IS_IN (libnss_files)
> >  # define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
> >  # define libnss_files_hidden_tls_proto(name, attrs...) \
> >    hidden_tls_proto (name, ##attrs)
> > @@ -708,7 +712,7 @@ for linking")
> >  # define libnss_files_hidden_data_ver(local, name)
> >  #endif
> >  
> > -#ifdef IS_IN_libnsl
> > +#if IS_IN (libnsl)
> >  # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
> >  # define libnsl_hidden_tls_proto(name, attrs...) \
> >    hidden_tls_proto (name, ##attrs)
> > @@ -729,7 +733,7 @@ for linking")
> >  # define libnsl_hidden_data_ver(local, name)
> >  #endif
> >  
> > -#ifdef IS_IN_libnss_nisplus
> > +#if IS_IN (libnss_nisplus)
> >  # define libnss_nisplus_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
> >  # define libnss_nisplus_hidden_tls_proto(name, attrs...) \
> >    hidden_tls_proto (name, ##attrs)
> > @@ -758,7 +762,7 @@ for linking")
> >  # define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name)
> >  #endif
> >  
> > -#ifdef IS_IN_libutil
> > +#if IS_IN (libutil)
> >  # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
> >  # define libutil_hidden_tls_proto(name, attrs...) \
> >    hidden_tls_proto (name, ##attrs)
> > diff --git a/locale/Makefile b/locale/Makefile
> > index e4c3878..5cd18e0 100644
> > --- a/locale/Makefile
> > +++ b/locale/Makefile
> > @@ -85,7 +85,7 @@ locale-CPPFLAGS = -DLOCALEDIR='"$(localedir)"' \
> >  		  -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \
> >  		  -Iprograms
> >  
> > -CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
> > +CPPFLAGS-locale_programs = -DLOCALE_PATH='$(localepath)' \
> >  			   -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
> >  			   -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
> >  			   -DLOCSRCDIR='"$(i18ndir)/locales"' \
> > @@ -96,7 +96,7 @@ CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
> >  CFLAGS-charmap-dir.c = -Wno-write-strings
> >  
> >  # This makes sure -DNOT_IN_libc et al are passed for all these modules.
> > -cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \
> > -				$(locale-modules) $(lib-modules))
> > -lib := locale-programs
> > +cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
> > +		 $(lib-modules)
> > +lib := locale_programs
> >  include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> > diff --git a/malloc/Makefile b/malloc/Makefile
> > index 9e93523..fbfada2 100644
> > --- a/malloc/Makefile
> > +++ b/malloc/Makefile
> > @@ -89,6 +89,11 @@ endif
> >  do-memusagestat: $(objpfx)memusagestat
> >  
> >  memusagestat-modules = memusagestat
> > +
> > +cpp-srcs-left := $(memusagestat-modules)
> > +lib := memusagestat
> > +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> > +
> >  $(objpfx)memusagestat: $(memusagestat-modules:%=$(objpfx)%.o)
> >  	$(LINK.o) -o $@ $^ $(libgd-LDFLAGS) -lgd -lpng -lz -lm
> >  
> > diff --git a/nscd/Makefile b/nscd/Makefile
> > index 639d87b..7ab4e9d 100644
> > --- a/nscd/Makefile
> > +++ b/nscd/Makefile
> > @@ -79,23 +79,22 @@ CFLAGS-nscd_gethst_r.c = -fexceptions
> >  CFLAGS-nscd_getai.c = -fexceptions
> >  CFLAGS-nscd_initgroups.c = -fexceptions
> >  
> > -CPPFLAGS-nonlib += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2
> > +CPPFLAGS-nscd += -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2 -DNOT_IN_libc=1
> >  
> >  ifeq (yesyes,$(have-fpie)$(build-shared))
> > -CFLAGS-nonlib += $(pie-ccflag)
> > +CFLAGS-nscd += $(pie-ccflag)
> >  endif
> >  ifeq (yes,$(have-ssp))
> > -CFLAGS-nonlib += -fstack-protector
> > +CFLAGS-nscd += -fstack-protector
> >  endif
> >  
> >  ifeq (yesyes,$(have-fpie)$(build-shared))
> >  LDFLAGS-nscd = -Wl,-z,now
> >  endif
> >  
> > -# This makes sure CPPFLAGS-nonlib and CFLAGS-nonlib are passed
> > -# for all these modules.
> > -cpp-srcs-left := $(nscd-modules:=.c)
> > -lib := nonlib
> > +# Set libof-nscd.
> > +cpp-srcs-left := $(nscd-modules)
> > +lib := nscd
> >  include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> >  
> >  $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
> > diff --git a/nss/Makefile b/nss/Makefile
> > index 1fa7f1f..7114d74 100644
> > --- a/nss/Makefile
> > +++ b/nss/Makefile
> > @@ -105,7 +105,8 @@ $(objpfx)makedb: $(makedb-modules:%=$(objpfx)%.o)
> >  $(inst_vardbdir)/Makefile: db-Makefile $(+force)
> >  	$(do-install)
> >  
> > -CFLAGS-nss_test1.c = -DNOT_IN_libc=1
> > +libof-nss_test1 = extramodules
> > +CPPFLAGS-nss_test1 = -DNOT_IN_libc=1
> >  $(objpfx)/libnss_test1.so: $(objpfx)nss_test1.os $(link-libc-deps)
> >  	$(build-module)
> >  ifdef libnss_test1.so-version
> > diff --git a/stdlib/Makefile b/stdlib/Makefile
> > index 9b2271b..da6e076 100644
> > --- a/stdlib/Makefile
> > +++ b/stdlib/Makefile
> > @@ -145,6 +145,7 @@ LDFLAGS-tst-putenv = $(no-as-needed)
> >  
> >  $(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os $(link-libc-deps)
> >  	$(build-module)
> > +libof-tst-putenvmod = extramodules
> >  CFLAGS-tst-putenvmod.c = -DNOT_IN_libc=1
> >  
> >  $(objpfx)bug-getcontext: $(libm)
> > diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
> > index c05708d..b5b2cf0 100644
> > --- a/sysdeps/gnu/Makefile
> > +++ b/sysdeps/gnu/Makefile
> > @@ -29,6 +29,8 @@ ifeq ($(subdir),stdio-common)
> >  
> >  errlist-c = $(firstword $(wildcard $(addsuffix /errlist.c,$(sysdirs) .)))
> >  
> > +libof-errlist-compat = extramodules
> > +
> >  ifeq ($(build-shared),yes)
> >  $(objpfx)errlist-compat.c: $(errlist-c) $(..)sysdeps/gnu/errlist-compat.awk \
> >  			   $(common-objpfx)Versions.v.i $(before-compile)
> > diff --git a/sysdeps/s390/s390-64/Makefile b/sysdeps/s390/s390-64/Makefile
> > index fe5030e..ce4f0c5 100644
> > --- a/sysdeps/s390/s390-64/Makefile
> > +++ b/sysdeps/s390/s390-64/Makefile
> > @@ -28,6 +28,10 @@ s390x-iconv-modules = ISO-8859-1_CP037_Z900 UTF8_UTF16_Z9 UTF16_UTF32_Z9 UTF8_UT
> >  extra-modules-left += $(s390x-iconv-modules)
> >  include extra-module.mk
> >  
> > +cpp-srcs-left := $(foreach mod,$(s390x-iconv-modules),$($(mod)-routines))
> > +lib := iconvdata
> > +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
> > +
> >  extra-objs      += $(addsuffix .so, $(s390x-iconv-modules))
> >  install-others  += $(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules))
> >  
> > diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> > index 9ad6d22..2d6d8bb 100644
> > --- a/sysdeps/unix/sysv/linux/Makefile
> > +++ b/sysdeps/unix/sysv/linux/Makefile
> > @@ -178,6 +178,7 @@ ifeq ($(subdir),elf)
> >  sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \
> >  			dl-fxstatat64
> >  
> > +libof-lddlibc4 = lddlibc4
> >  CPPFLAGS-lddlibc4 += -DNOT_IN_libc
> >  
> >  others += pldd
> 
> 

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [PING] Fix -Wundef warning in SHLIB_COMPAT
  2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
                   ` (19 preceding siblings ...)
  2014-08-22  4:57 ` [all-arch][PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
@ 2014-11-05 11:07 ` Siddhesh Poyarekar
  20 siblings, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-11-05 11:07 UTC (permalink / raw)
  To: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 484 bytes --]

Hi,

The following patches in this series are pending review:

- Add new macro IN_MODULE to identify module in which source is built
    http://patchwork.sourceware.org/patch/3043/

- Auto-generate libc-modules.h
    http://patchwork.sourceware.org/patch/3044/

- Use MODULE_NAME in stap-probe instead of IN_LIB
    http://patchwork.sourceware.org/patch/2887/

- Define IN_MODULE for translation units that define NOT_IN_libc
    http://patchwork.sourceware.org/patch/2883/

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [ping3][PATCH 01/19 v2] Add new macro IN_MODULE to identify module in which source is built
  2014-10-01  8:16         ` [ping3][PATCH " Siddhesh Poyarekar
  2014-10-14 16:20           ` [ping4][PATCH " Siddhesh Poyarekar
@ 2014-11-07 23:22           ` Roland McGrath
  2014-11-08  2:10             ` Siddhesh Poyarekar
  1 sibling, 1 reply; 106+ messages in thread
From: Roland McGrath @ 2014-11-07 23:22 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

>     Patches that follow will remove uses of IS_IN_* variables with the

s/remove/replace/

>     Verified that there are no relevant source changes.  One source change
>     that will crop up repeatedly is that of nscd_stat, since it uses the
>     build timestamp as a constant in its logic.

s/source/binary/

> +in-module = $(strip $(foreach lib,$(libof-$(basename $(@F))) $(libof-$(<F)) \
> +				  $(libof-$(@F)),-DIN_MODULE=MODULE_$(lib)))

I think you can make this:

in-module = $(firstword $(libof-$(basename $(@F))) \
			$(libof-$(<F)) \
			$(libof-$(@F))
			libc)

There should never be more than one nonempty libof-* expansion unless it's
multiple that are the same.  Also don't repeat the fixed parts
(i.e. -DIN_MODULE=MODULE_).

> -	   $(CPPFLAGS-$(suffix $@)) \
> +	   $(CPPFLAGS-$(suffix $@)) $(module-def) \

Here just use -DIN_MODULE=MODULE_$(in-module) directly.

> diff --git a/elf/rtld-Rules b/elf/rtld-Rules
> index 0a5d6af..4d78d90 100644
> --- a/elf/rtld-Rules
> +++ b/elf/rtld-Rules
> @@ -138,6 +138,11 @@ ifdef rtld-depfiles
>  -include $(rtld-depfiles)
>  endif
>  
> +# Set libof-* for each routine.
> +cpp-srcs-left := $(subst .os,,$(rtld-modules))

Use $(rtld-modules:%.os=%) (or patsubst if you prefer).
Plain subst will eat .os out of the middle of a name, which is wrong.

> --- /dev/null
> +++ b/include/libc-modules.h

Even though it's just for a brief window of the revision history, please
put a comment in this file saying it should/will be generated.

> +#include "libc-modules.h"

Use <>.  Add a short comment saying that is defines the MODULE_* macros.

> -CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
> +CPPFLAGS-locale_programs = -DLOCALE_PATH='$(localepath)' \

Rather than changing this name, I think the libc-modules.h generation
should just turn all nonidentifier characters into _.


OK with those changes.


Thanks,
Roland

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

* Re: [PATCH v2 06/19] Define IN_MODULE for translation units that define NOT_IN_libc
  2014-09-17 12:29   ` [PATCH v2 06/19] Define IN_MODULE for translation units that define NOT_IN_libc Siddhesh Poyarekar
  2014-09-24  9:07     ` [ping][PATCH " Siddhesh Poyarekar
@ 2014-11-07 23:23     ` Roland McGrath
  1 sibling, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-11-07 23:23 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

OK

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

* Re: [ping3][PATCH 03/19 v2] Auto-generate libc-modules.h
  2014-10-01  8:18         ` [ping3][PATCH " Siddhesh Poyarekar
  2014-10-14 16:21           ` [ping4][PATCH " Siddhesh Poyarekar
@ 2014-11-07 23:29           ` Roland McGrath
  2014-11-18 16:20             ` [PATCH 03/19 v3] " Siddhesh Poyarekar
  1 sibling, 1 reply; 106+ messages in thread
From: Roland McGrath @ 2014-11-07 23:29 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

I'm not crazy about build.list.  I'd rather it just be a variable in
Makeconfig like subdirs.  You can pass it through to awk with -v.

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

* Re: [ping][PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB
  2014-09-17 12:47   ` [ping][PATCH " Siddhesh Poyarekar
  2014-09-24  9:07     ` [ping2][PATCH " Siddhesh Poyarekar
  2014-10-01  8:19     ` [ping3][PATCH " Siddhesh Poyarekar
@ 2014-11-07 23:32     ` Roland McGrath
  2014-11-19  7:10       ` Siddhesh Poyarekar
  2 siblings, 1 reply; 106+ messages in thread
From: Roland McGrath @ 2014-11-07 23:32 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

> 	* scripts/gen-libc-modules.awk (END): Generate defines for
> 	MODULE_NAME.

Why is this better than just putting -DMODULE_NAME=... in CPPFLAGS
as with IN_MODULE?  In fact, you could pass only -DMODULE_NAME=...
and then use PASTE(MODULE_,MODULE_NAME).

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

* Re: [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined
  2014-08-28  6:55   ` [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined Siddhesh Poyarekar
  2014-08-28 16:58     ` Joseph S. Myers
@ 2014-11-07 23:33     ` Roland McGrath
  2014-11-18 13:54       ` Siddhesh Poyarekar
  1 sibling, 1 reply; 106+ messages in thread
From: Roland McGrath @ 2014-11-07 23:33 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

Use #if defined _LIBC && IS_IN (...) rather than nesting.
Otherwise OK.

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

* Re: [ping3][PATCH 01/19 v2] Add new macro IN_MODULE to identify module in which source is built
  2014-11-07 23:22           ` [ping3][PATCH " Roland McGrath
@ 2014-11-08  2:10             ` Siddhesh Poyarekar
  2014-11-18 18:48               ` Roland McGrath
  0 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-11-08  2:10 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 764 bytes --]

On Fri, Nov 07, 2014 at 03:22:10PM -0800, Roland McGrath wrote:
> > +# Set libof-* for each routine.
> > -CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
> > +CPPFLAGS-locale_programs = -DLOCALE_PATH='$(localepath)' \
> 
> Rather than changing this name, I think the libc-modules.h generation
> should just turn all nonidentifier characters into _.

Doing that for libc-modules.h is easy, but it will be hard to do that
in Makeconfig to set -DIN_MODULE=MODULE_* because I don't think there
is a straightforward way to do regex substitutions in GNU make.  I
could just use subst to just replace the - with _, but then wouldn't
it make sense to just restrict module names to always have only valid
identifier characters instead?

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined
  2014-11-07 23:33     ` [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined Roland McGrath
@ 2014-11-18 13:54       ` Siddhesh Poyarekar
  2014-11-18 13:55         ` Siddhesh Poyarekar
  2014-11-18 18:42         ` Roland McGrath
  0 siblings, 2 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-11-18 13:54 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 256 bytes --]

On Fri, Nov 07, 2014 at 03:33:33PM -0800, Roland McGrath wrote:
> Use #if defined _LIBC && IS_IN (...) rather than nesting.
> Otherwise OK.

That doesn't work - the compiler complains about IS_IN not being
defined.  That is why I had to nest it.

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined
  2014-11-18 13:54       ` Siddhesh Poyarekar
@ 2014-11-18 13:55         ` Siddhesh Poyarekar
  2014-11-18 18:42         ` Roland McGrath
  1 sibling, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-11-18 13:55 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 384 bytes --]

On Tue, Nov 18, 2014 at 07:24:45PM +0530, Siddhesh Poyarekar wrote:
> On Fri, Nov 07, 2014 at 03:33:33PM -0800, Roland McGrath wrote:
> > Use #if defined _LIBC && IS_IN (...) rather than nesting.
> > Otherwise OK.
> 
> That doesn't work - the compiler complains about IS_IN not being
> defined.  That is why I had to nest it.

s/compiler/preprocessor/ of course.

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* [PATCH 03/19 v3] Auto-generate libc-modules.h
  2014-11-07 23:29           ` [ping3][PATCH " Roland McGrath
@ 2014-11-18 16:20             ` Siddhesh Poyarekar
  2014-11-18 18:45               ` Roland McGrath
  0 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-11-18 16:20 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 9453 bytes --]

On Fri, Nov 07, 2014 at 03:29:05PM -0800, Roland McGrath wrote:
> I'm not crazy about build.list.  I'd rather it just be a variable in
> Makeconfig like subdirs.  You can pass it through to awk with -v.

Done.  Here's the updated patch.  Generated binary remains unchanged
on x86_64.  Patch 5 (Remove IN_LIB) has a slight adjustment to cater
for the change in the separator name (OTHERS_BEGIN -> LIBS_BEGIN) and
the change in order (built-modules first).

Siddhesh

From 6f3528b134d764c78ead184c0143981138dea2ad Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Tue, 18 Nov 2014 21:30:09 +0530
Subject: [PATCH] Auto-generate libc-modules.h

Remove libc-modules.h from the tree and auto-generate it from
soversions.i and the list of modules in the built-modules variable
defined in Makeconfig.  Macros generated have increasing numbered
values, with built-modules having lower values starting from 1,
following which a separator value LIBS_BEGIN is added and then finally
the library names from soversions.i are appended to the list.  This
allows us to conveniently differentiate between the versioned
libraries and other built modules, which is needed in errno.h and
netdb.h to decide whether to use an internal symbol or an external
one.

Verified that generated code remains unchanged on x86_64.

	* Makeconfig (built-modules): List non-library modules to be
	built.
	(module-cppflags): Include libc-modules.h for
	everything except shlib-versions.v.i.
	(CPPFLAGS): Use it.
	(before-compile): Add libc-modules.h.
	($(common-objpfx)libc-modules.h,
	$(common-objpfx)libc-modules.stmp): New targets.
	(common-generated): Add libc-modules.h and libc-modules.stmp.
	($(common-objpfx)Versions.v.i): Depend on libc-modules.h.
	* include/libc-symbols.h: Don't include libc-modules.h.
	* include/libc-modules.h: Remove file.
	* scripts/gen-libc-modules.awk: New script to generate
	libc-modules.h.
	* sysdeps/unix/Makefile ($(common-objpfx)sysd-syscalls):
	Depend on libc-modules.stmp.
---
 Makeconfig                   | 40 ++++++++++++++++++++++++++++++++++++++--
 include/libc-modules.h       | 41 -----------------------------------------
 include/libc-symbols.h       |  3 ---
 scripts/gen-libc-modules.awk | 34 ++++++++++++++++++++++++++++++++++
 sysdeps/unix/Makefile        |  3 ++-
 5 files changed, 74 insertions(+), 47 deletions(-)
 delete mode 100644 include/libc-modules.h
 create mode 100644 scripts/gen-libc-modules.awk

diff --git a/Makeconfig b/Makeconfig
index 526def9..4f13ca9 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -813,20 +813,39 @@ endif	# $(+cflags) == ""
 # of many little headers in the include directory.
 libio-include = -I$(..)libio
 
+# List of non-library modules that we build.
+built-modules = iconvprogs iconvdata ldconfig lddlibc4 libmemusage \
+		libSegFault libpcprofile librpcsvc locale_programs \
+		memusagestat nonlib nscd extramodules libnldbl
+
+# We don't include libc-modules.h when these targets are being built.  These
+# targets don't (and will likely never need to) use the IS_IN facility.  In
+# fact, shlib-versions should not use it because that will create a circular
+# dependency as libc-modules.h is generated from shlib-versions.
+skip-module-cppflags = shlib-versions.v.i Versions.v.i
+
 in-module = $(firstword $(libof-$(basename $(@F))) \
 			$(libof-$(<F)) \
 			$(libof-$(@F)) \
 			libc)
 
+module-cppflags-real = -include $(common-objpfx)libc-modules.h \
+		       -DIN_MODULE=MODULE_$(in-module)
+
+# We don't need libc-modules.h and the IN_MODULE definition for
+# shlib-version.v.i.
+module-cppflags = $(if $(filter $(@F),$(skip-module-cppflags)), \
+		       ,$(module-cppflags-real))
+
 # These are the variables that the implicit compilation rules use.
 # Note that we can't use -std=* in CPPFLAGS, because it overrides
 # the implicit -lang-asm and breaks cpp behavior for .S files--notably
 # it causes cpp to stop predefining __ASSEMBLER__.
 CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
 	   $($(subdir)-CPPFLAGS) \
-	   $(+includes) $(defines) \
+	   $(+includes) $(defines) $(module-cppflags) \
 	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
-	   $(CPPFLAGS-$(suffix $@)) -DIN_MODULE=MODULE_$(in-module) \
+	   $(CPPFLAGS-$(suffix $@)) \
 	   $(foreach lib,$(libof-$(basename $(@F))) \
 			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
@@ -986,6 +1005,23 @@ endif
 postclean-generated += soversions.mk soversions.i \
 		       shlib-versions.v shlib-versions.v.i
 
+before-compile += $(common-objpfx)libc-modules.h
+ifeq ($(soversions.mk-done),t)
+# Generate a header with macro definitions for use with the IS_IN macro.
+# These are the possible values for the IN_MODULE macro defined when building
+# sources, to identify which module the translation unit is going to be built
+# into.
+$(common-objpfx)libc-modules.h: $(common-objpfx)libc-modules.stmp; @:
+$(common-objpfx)libc-modules.stmp: $(..)scripts/gen-libc-modules.awk \
+				   $(common-objpfx)soversions.i
+	$(AWK) -v buildlist="$(built-modules)" -f $^ > ${@:stmp=T}
+	$(move-if-change) ${@:stmp=T} ${@:stmp=h}
+	touch $@
+
+endif
+
+common-generated += libc-modules.h libc-modules.stmp
+
 # The name under which the run-time dynamic linker is installed.
 # We are currently going for the convention that `/lib/ld.so.1'
 # names the SVR4/ELF ABI-compliant dynamic linker.
diff --git a/include/libc-modules.h b/include/libc-modules.h
deleted file mode 100644
index 029b600..0000000
--- a/include/libc-modules.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Valid values for the IN_MODULE macro, which is defined for each source file
-   during compilation to indicate which module it is to be built into.
-
-   TODO: This file should eventually be auto-generated.  */
-#define MODULE_libc		1
-#define MODULE_libpthread	2
-#define MODULE_rtld		3
-#define MODULE_libdl		4
-#define MODULE_libm		5
-#define MODULE_iconvprogs	6
-#define MODULE_iconvdata	7
-#define MODULE_lddlibc4		8
-#define MODULE_locale_programs	9
-#define MODULE_memusagestat	10
-#define MODULE_libutil		12
-#define MODULE_libBrokenLocale	13
-#define MODULE_libmemusage	15
-#define MODULE_libresolv	16
-#define MODULE_libnss_db	17
-#define MODULE_libnss_files	18
-#define	MODULE_libnss_dns	19
-#define MODULE_libnss_compat	20
-#define MODULE_libnss_hesiod	21
-#define MODULE_libnss_nis	22
-#define MODULE_libnss_nisplus	23
-#define MODULE_libanl		24
-#define MODULE_librt		25
-#define MODULE_libSegFault	26
-#define MODULE_libthread_db	27
-#define MODULE_libcidn		28
-#define MODULE_libcrypt		29
-#define MODULE_libnsl		30
-#define MODULE_libpcprofile	31
-#define MODULE_librpcsvc	32
-#define MODULE_nscd		33
-#define MODULE_ldconfig 	34
-#define MODULE_libnldbl 	35
-
-/* Catch-all for test modules and other binaries.  */
-#define MODULE_nonlib		98
-#define MODULE_extramodules	99
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 58c3577..9c5c9bb 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -20,9 +20,6 @@
 #ifndef _LIBC_SYMBOLS_H
 #define _LIBC_SYMBOLS_H	1
 
-/* Pull in definitions for the MODULE_* macros.  */
-#include <libc-modules.h>
-
 #define IS_IN(lib) (IN_MODULE == MODULE_##lib)
 
 /* This file's macros are included implicitly in the compilation of every
diff --git a/scripts/gen-libc-modules.awk b/scripts/gen-libc-modules.awk
new file mode 100644
index 0000000..05ba85d
--- /dev/null
+++ b/scripts/gen-libc-modules.awk
@@ -0,0 +1,34 @@
+# Generate a header file that defines the MODULE_* macros for each library and
+# module we build in glibc.  The library names are pulled in from soversions.i
+# and the additional modules are mentioned one-per-line in build.list.
+BEGIN {
+  # BUILDLIST is set from the build-list variable in Makeconfig and is a space
+  # separated list of non-library modules that we build in glibc.
+  num = split (buildlist, libs, " ")
+  # Separate the built modules from the libraries.
+  libs[++num] = "LIBS_BEGIN"
+}
+
+# Skip over comments.
+$1 == "#" {
+  next
+}
+
+# We have only one special case in soversions.i parsing, which is to replace ld
+# with rtld since that's what we call it throughout the sources.
+match (FILENAME, ".*soversions.i") {
+  name = $2
+  if (name == "ld")
+    name = "rtld"
+
+  # Library names are not duplicated in soversions.i.
+  libs[++num] = name
+}
+
+# Finally, print out the header file.
+END {
+  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n\n")
+  for (l in libs) {
+    printf ("#define MODULE_%s %d\n", libs[l], l)
+  }
+}
diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile
index 0e535b6..573e90d 100644
--- a/sysdeps/unix/Makefile
+++ b/sysdeps/unix/Makefile
@@ -79,7 +79,8 @@ compile-syscall = $(COMPILE.S) -o $@ -x assembler-with-cpp - \
 
 ifndef avoid-generated
 $(common-objpfx)sysd-syscalls: $(..)sysdeps/unix/make-syscalls.sh \
-			       $(wildcard $(+sysdep_dirs:%=%/syscalls.list))
+			       $(wildcard $(+sysdep_dirs:%=%/syscalls.list)) \
+			       $(common-objpfx)libc-modules.stmp
 	for dir in $(+sysdep_dirs); do \
 	  test -f $$dir/syscalls.list && \
 	  { sysdirs='$(sysdirs)' \
-- 
1.9.3


[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined
  2014-11-18 13:54       ` Siddhesh Poyarekar
  2014-11-18 13:55         ` Siddhesh Poyarekar
@ 2014-11-18 18:42         ` Roland McGrath
  2014-11-18 19:53           ` Andreas Schwab
  1 sibling, 1 reply; 106+ messages in thread
From: Roland McGrath @ 2014-11-18 18:42 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

I see.  I was not expecting such an error because it doesn't give one for
"#if defined notdefined && alsonotdefined" but evidently the function-like
macro case is different.

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

* Re: [PATCH 03/19 v3] Auto-generate libc-modules.h
  2014-11-18 16:20             ` [PATCH 03/19 v3] " Siddhesh Poyarekar
@ 2014-11-18 18:45               ` Roland McGrath
  2014-11-19  7:58                 ` Siddhesh Poyarekar
  0 siblings, 1 reply; 106+ messages in thread
From: Roland McGrath @ 2014-11-18 18:45 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

Top comment in the awk script still mentions the build.list file.
Looks good otherwise.

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

* Re: [ping3][PATCH 01/19 v2] Add new macro IN_MODULE to identify module in which source is built
  2014-11-08  2:10             ` Siddhesh Poyarekar
@ 2014-11-18 18:48               ` Roland McGrath
  0 siblings, 0 replies; 106+ messages in thread
From: Roland McGrath @ 2014-11-18 18:48 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

We don't use _ as a separator in makefile variable names.  I don't think we
want to start.  Using subst to just replace - with _ is fine.  We can
restrict the module names to the C identifier characters and -.

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

* Re: [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined
  2014-11-18 18:42         ` Roland McGrath
@ 2014-11-18 19:53           ` Andreas Schwab
  0 siblings, 0 replies; 106+ messages in thread
From: Andreas Schwab @ 2014-11-18 19:53 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Siddhesh Poyarekar, libc-alpha

Roland McGrath <roland@hack.frob.com> writes:

> I see.  I was not expecting such an error because it doesn't give one for
> "#if defined notdefined && alsonotdefined" but evidently the function-like
> macro case is different.

The problem is that all remaining identifiers are replaced by 0 before
the expression is evaluated, thus resulting in a non-syntactical
expression.

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] 106+ messages in thread

* Re: [ping][PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB
  2014-11-07 23:32     ` [ping][PATCH " Roland McGrath
@ 2014-11-19  7:10       ` Siddhesh Poyarekar
  2014-11-19 23:47         ` Roland McGrath
  0 siblings, 1 reply; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-11-19  7:10 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

Sorry, I missed this one.

On Fri, Nov 07, 2014 at 03:32:06PM -0800, Roland McGrath wrote:
> > 	* scripts/gen-libc-modules.awk (END): Generate defines for
> > 	MODULE_NAME.
> 
> Why is this better than just putting -DMODULE_NAME=... in CPPFLAGS
> as with IN_MODULE?  In fact, you could pass only -DMODULE_NAME=...
> and then use PASTE(MODULE_,MODULE_NAME).

I don't think that is possible.  We cannot paste macro definitions.
That is, I cannot do:

#define MODULE_ ## libc 42

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH 03/19 v3] Auto-generate libc-modules.h
  2014-11-18 18:45               ` Roland McGrath
@ 2014-11-19  7:58                 ` Siddhesh Poyarekar
  0 siblings, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-11-19  7:58 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

On Tue, Nov 18, 2014 at 10:45:39AM -0800, Roland McGrath wrote:
> Top comment in the awk script still mentions the build.list file.
> Looks good otherwise.

Thanks, I have pushed patches 1-3 now.  Once patch 4 is resolved, I
have acks for all other patches, which I have to just adjust for
Joseph's latest changes and then push.  I'll verify that the generated
binaries are unchanged before pushing them.

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [ping][PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB
  2014-11-19  7:10       ` Siddhesh Poyarekar
@ 2014-11-19 23:47         ` Roland McGrath
  2014-11-24 10:43           ` Siddhesh Poyarekar
  0 siblings, 1 reply; 106+ messages in thread
From: Roland McGrath @ 2014-11-19 23:47 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha

> > Why is this better than just putting -DMODULE_NAME=... in CPPFLAGS
> > as with IN_MODULE?  In fact, you could pass only -DMODULE_NAME=...
> > and then use PASTE(MODULE_,MODULE_NAME).
> 
> I don't think that is possible.  We cannot paste macro definitions.
> That is, I cannot do:
> 
> #define MODULE_ ## libc 42

I'm not sure what you imagine I imagine that would do.  What I'm talking
about is -DMODULE_NAME=libc instead of -DIN_MODULE=MODULE_libc and:

#define IN_MODULE PASTE(MODULE_, MODULE_NAME)
#define PASTE(a, b) PASTE_1(a, b)
#define PASTE_1(a, b) a##b

instead of generating #if IN_MODULE == ... #define MODULE_NAME ... #endif.
Of course the "#define MODULE_foo N" bit has to be generated.

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

* Re: [ping][PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB
  2014-11-19 23:47         ` Roland McGrath
@ 2014-11-24 10:43           ` Siddhesh Poyarekar
  0 siblings, 0 replies; 106+ messages in thread
From: Siddhesh Poyarekar @ 2014-11-24 10:43 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 4814 bytes --]

On Wed, Nov 19, 2014 at 03:47:07PM -0800, Roland McGrath wrote:
> I'm not sure what you imagine I imagine that would do.  What I'm talking
> about is -DMODULE_NAME=libc instead of -DIN_MODULE=MODULE_libc and:
> 
> #define IN_MODULE PASTE(MODULE_, MODULE_NAME)
> #define PASTE(a, b) PASTE_1(a, b)
> #define PASTE_1(a, b) a##b
> 
> instead of generating #if IN_MODULE == ... #define MODULE_NAME ... #endif.
> Of course the "#define MODULE_foo N" bit has to be generated.

Thanks for clarifying.  I have pushed the patch below, since it
directly incorporates your suggestion and doesn't change the generated
code.  I have also pushed the remaining patches, which completes this
patchset!

... and now for the next one :)

Siddhesh

commit 279bc5b3c384c09746fbadb2b68c6db9e833c064
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Thu Nov 20 11:42:00 2014 +0530

    Use MODULE_NAME in stap-probe instead of IN_LIB
    
    Define MODULE_NAME in the build command and define IN_MODULE using
    MODULE_NAME.  Verified that the generated code is unchanged on x86_64.
    
    	* Makeconfig (module-cppflags-real): Define MODULE_NAME
    	instead of IN_MODULE.
    	* include/libc-symbols.h (IN_MODULE): Define using
    	MODULE_NAME.
    	(PASTE_NAME, PASTE_NAME1): New macros.
    	* include/stap-probe.h (LIBC_PROBE_1): Use MODULE_NAME instead
    	of IN_LIB.
    	(STAP_PROBE_ASM): Likewise.

diff --git a/ChangeLog b/ChangeLog
index 0bde88c..43759c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2014-11-24  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+	* Makeconfig (module-cppflags-real): Define MODULE_NAME
+	instead of IN_MODULE.
+	* include/libc-symbols.h (IN_MODULE): Define using
+	MODULE_NAME.
+	(PASTE_NAME, PASTE_NAME1): New macros.
+	* include/stap-probe.h (LIBC_PROBE_1): Use MODULE_NAME instead
+	of IN_LIB.
+	(STAP_PROBE_ASM): Likewise.
+
 2014-11-23  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
 	* sysdeps/mach/hurd/i386/init-first.c (posixland_init): Call
diff --git a/Makeconfig b/Makeconfig
index 1a26cc5..bbf5460 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -830,9 +830,9 @@ in-module = $(subst -,_,$(firstword $(libof-$(basename $(@F))) \
 				    libc))
 
 module-cppflags-real = -include $(common-objpfx)libc-modules.h \
-		       -DIN_MODULE=MODULE_$(in-module)
+		       -DMODULE_NAME=$(in-module)
 
-# We don't need libc-modules.h and the IN_MODULE definition for
+# We don't need libc-modules.h and the MODULE_NAME definition for
 # shlib-version.v.i.
 module-cppflags = $(if $(filter $(@F),$(skip-module-cppflags)), \
 		       ,$(module-cppflags-real))
@@ -1008,7 +1008,7 @@ postclean-generated += soversions.mk soversions.i \
 before-compile += $(common-objpfx)libc-modules.h
 ifeq ($(soversions.mk-done),t)
 # Generate a header with macro definitions for use with the IS_IN macro.
-# These are the possible values for the IN_MODULE macro defined when building
+# These are the possible values for the MODULE_NAME macro defined when building
 # sources, to identify which module the translation unit is going to be built
 # into.
 $(common-objpfx)libc-modules.h: $(common-objpfx)libc-modules.stmp; @:
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 9c5c9bb..5cbf473 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -20,8 +20,12 @@
 #ifndef _LIBC_SYMBOLS_H
 #define _LIBC_SYMBOLS_H	1
 
+#define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME)
 #define IS_IN(lib) (IN_MODULE == MODULE_##lib)
 
+#define PASTE_NAME(a,b)      PASTE_NAME1 (a,b)
+#define PASTE_NAME1(a,b)     a##b
+
 /* This file's macros are included implicitly in the compilation of every
    file in the C library by -imacros.
 
diff --git a/include/stap-probe.h b/include/stap-probe.h
index 688646c..150fc1e 100644
--- a/include/stap-probe.h
+++ b/include/stap-probe.h
@@ -30,7 +30,7 @@
 
    Systemtap's header defines the macros STAP_PROBE (provider, name) and
    STAP_PROBEn (provider, name, arg1, ..., argn).  For "provider" we paste
-   in the IN_LIB name (libc, libpthread, etc.) automagically.
+   in MODULE_NAME (libc, libpthread, etc.) automagically.
 
    The format of the arg parameters is discussed here:
 
@@ -53,7 +53,7 @@
 # endif
 
 # define LIBC_PROBE(name, n, ...)	\
-  LIBC_PROBE_1 (IN_LIB, name, n, ## __VA_ARGS__)
+  LIBC_PROBE_1 (MODULE_NAME, name, n, ## __VA_ARGS__)
 
 # define LIBC_PROBE_1(lib, name, n, ...) \
   STAP_PROBE##n (lib, name, ## __VA_ARGS__)
@@ -61,7 +61,7 @@
 # define STAP_PROBE0		STAP_PROBE
 
 # define LIBC_PROBE_ASM(name, template) \
-  STAP_PROBE_ASM (IN_LIB, name, template)
+  STAP_PROBE_ASM (MODULE_NAME, name, template)
 
 # define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS
 

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH] Remove CFLAGS for interp.c
  2014-09-15  8:21               ` [PATCH] Remove CFLAGS for interp.c Siddhesh Poyarekar
  2014-09-16 15:52                 ` Roland McGrath
@ 2015-03-02 14:57                 ` Andreas Schwab
  2015-10-28 14:31                   ` Marcus Shawcroft
  1 sibling, 1 reply; 106+ messages in thread
From: Andreas Schwab @ 2015-03-02 14:57 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha, Roland McGrath

	* elf/Makefile ($(elf-objpfx)runtime-linker.st): Fix typo in
	variable name.

diff --git a/elf/Makefile b/elf/Makefile
index 20b1682..711beed 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -362,7 +362,7 @@ $(objpfx)interp.os: $(elf-objpfx)runtime-linker.h
 
 $(elf-objpfx)runtime-linker.h: $(elf-objpfx)runtime-linker.st; @:
 $(elf-objpfx)runtime-linker.st: $(common-objpfx)config.make
-	$(name-target-directory)
+	$(make-target-directory)
 	echo '#define RUNTIME_LINKER "$(rtlddir)/$(rtld-installed-name)"' \
 		> ${@:st=T}
 	$(move-if-change) ${@:st=T} ${@:st=h}
-- 
2.3.1


-- 
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] 106+ messages in thread

* Re: [PATCH] Include .interp section only for libc.so
  2014-09-15  8:19               ` Siddhesh Poyarekar
  2014-09-16 15:50                 ` Roland McGrath
@ 2015-06-02 18:47                 ` Dmitry V. Levin
  1 sibling, 0 replies; 106+ messages in thread
From: Dmitry V. Levin @ 2015-06-02 18:47 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: libc-alpha, Roland McGrath

[-- Attachment #1: Type: text/plain, Size: 782 bytes --]

On Mon, Sep 15, 2014 at 01:49:09PM +0530, Siddhesh Poyarekar wrote:
> Barring libc.so and libdl.so, none of the libraries have any entry
> points, so it is pointless to add a .interp section for them.  The
> libdl.so entry point (in dlfcn/eval.c) is also defunct, so remove that
> file as well.

Actually, libpthread has an entry point since 2003,
so this commit introduced a regression:

$ /lib64/libpthread.so.0 
Native POSIX Threads Library by Ulrich Drepper et al
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Forced unwind support included.
Segmentation fault

A patch will follow shortly.


-- 
ldv

[-- Attachment #2: Type: application/pgp-signature, Size: 181 bytes --]

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

* Re: [PATCH] Remove CFLAGS for interp.c
  2015-03-02 14:57                 ` Andreas Schwab
@ 2015-10-28 14:31                   ` Marcus Shawcroft
  0 siblings, 0 replies; 106+ messages in thread
From: Marcus Shawcroft @ 2015-10-28 14:31 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Siddhesh Poyarekar, GNU C Library, Roland McGrath

On 2 March 2015 at 14:56, Andreas Schwab <schwab@suse.de> wrote:
>         * elf/Makefile ($(elf-objpfx)runtime-linker.st): Fix typo in
>         variable name.
>
> diff --git a/elf/Makefile b/elf/Makefile
> index 20b1682..711beed 100644
> --- a/elf/Makefile
> +++ b/elf/Makefile
> @@ -362,7 +362,7 @@ $(objpfx)interp.os: $(elf-objpfx)runtime-linker.h
>
>  $(elf-objpfx)runtime-linker.h: $(elf-objpfx)runtime-linker.st; @:
>  $(elf-objpfx)runtime-linker.st: $(common-objpfx)config.make
> -       $(name-target-directory)
> +       $(make-target-directory)
>         echo '#define RUNTIME_LINKER "$(rtlddir)/$(rtld-installed-name)"' \
>                 > ${@:st=T}
>         $(move-if-change) ${@:st=T} ${@:st=h}

This fix was not  back ported to the 2.21 release branch, which
explains occasional build failures I've been seeing. The patch applies
cleanly, committed.

Cheers
/Marcus

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

end of thread, other threads:[~2015-10-28 14:31 UTC | newest]

Thread overview: 106+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-21 10:58 [PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
2014-08-21 10:58 ` [PATCH 13/19] Remove IS_IN_libm Siddhesh Poyarekar
2014-08-22 19:33   ` Roland McGrath
2014-08-21 10:58 ` [PATCH 16/19] Remove NOT_IN_libc Siddhesh Poyarekar
2014-08-22 19:36   ` Roland McGrath
2014-08-21 10:58 ` [PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB Siddhesh Poyarekar
2014-09-17 12:47   ` [ping][PATCH " Siddhesh Poyarekar
2014-09-24  9:07     ` [ping2][PATCH " Siddhesh Poyarekar
2014-10-01  8:19     ` [ping3][PATCH " Siddhesh Poyarekar
2014-10-14 16:22       ` [ping4][PATCH " Siddhesh Poyarekar
2014-11-07 23:32     ` [ping][PATCH " Roland McGrath
2014-11-19  7:10       ` Siddhesh Poyarekar
2014-11-19 23:47         ` Roland McGrath
2014-11-24 10:43           ` Siddhesh Poyarekar
2014-08-21 10:58 ` [PATCH 10/19] Remove IS_IN_libdl Siddhesh Poyarekar
2014-08-22 18:30   ` Roland McGrath
2014-08-21 10:58 ` [PATCH 12/19] Remove IS_IN_libpthread Siddhesh Poyarekar
2014-08-22 18:31   ` Roland McGrath
2014-08-21 10:58 ` [PATCH 11/19] Remove IS_IN_librt Siddhesh Poyarekar
2014-08-22 18:31   ` Roland McGrath
2014-08-21 10:58 ` [PATCH 09/19] Remove IS_IN_nscd Siddhesh Poyarekar
2014-08-22 18:30   ` Roland McGrath
2014-08-21 10:58 ` [PATCH 03/19] Auto-generate libc-modules.h Siddhesh Poyarekar
2014-08-22 18:42   ` Siddhesh Poyarekar
2014-08-28  6:11   ` [PATCH 03/19 v2] " Siddhesh Poyarekar
2014-09-17 12:43     ` [ping][PATCH " Siddhesh Poyarekar
2014-09-24  9:06       ` [ping2][PATCH " Siddhesh Poyarekar
2014-10-01  8:18         ` [ping3][PATCH " Siddhesh Poyarekar
2014-10-14 16:21           ` [ping4][PATCH " Siddhesh Poyarekar
2014-11-07 23:29           ` [ping3][PATCH " Roland McGrath
2014-11-18 16:20             ` [PATCH 03/19 v3] " Siddhesh Poyarekar
2014-11-18 18:45               ` Roland McGrath
2014-11-19  7:58                 ` Siddhesh Poyarekar
2014-08-21 10:58 ` [PATCH 02/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
2014-08-22 18:23   ` Roland McGrath
2014-08-21 10:58 ` [PATCH 06/19] Define IN_MODULE for translation units that define NOT_IN_libc Siddhesh Poyarekar
2014-08-22 18:28   ` Roland McGrath
2014-08-22 18:54     ` Siddhesh Poyarekar
2014-09-01 17:19       ` Siddhesh Poyarekar
2014-09-05 18:54         ` Roland McGrath
2014-09-05 22:50           ` Siddhesh Poyarekar
2014-09-05 22:54             ` Roland McGrath
2014-09-15  6:06               ` [PATCH] Include .interp section only for libc.so Siddhesh Poyarekar
2014-09-15  8:19               ` Siddhesh Poyarekar
2014-09-16 15:50                 ` Roland McGrath
2015-06-02 18:47                 ` Dmitry V. Levin
2014-09-15  8:21               ` [PATCH] Remove CFLAGS for interp.c Siddhesh Poyarekar
2014-09-16 15:52                 ` Roland McGrath
2015-03-02 14:57                 ` Andreas Schwab
2015-10-28 14:31                   ` Marcus Shawcroft
2014-09-17 12:29   ` [PATCH v2 06/19] Define IN_MODULE for translation units that define NOT_IN_libc Siddhesh Poyarekar
2014-09-24  9:07     ` [ping][PATCH " Siddhesh Poyarekar
2014-10-01  8:23       ` [ping2][PATCH " Siddhesh Poyarekar
2014-10-14 16:45         ` [ping3][PATCH " Siddhesh Poyarekar
2014-11-07 23:23     ` [PATCH " Roland McGrath
2014-08-21 10:58 ` [PATCH 05/19] Remove IN_LIB Siddhesh Poyarekar
2014-08-22 18:26   ` Roland McGrath
2014-08-21 10:58 ` [PATCH 17/19] Provide default definition for IS_IN when _LIBC is not defined Siddhesh Poyarekar
2014-08-22 19:38   ` Roland McGrath
2014-08-22 19:47     ` Siddhesh Poyarekar
2014-08-22 20:34     ` Joseph S. Myers
2014-08-28  6:55   ` [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined Siddhesh Poyarekar
2014-08-28 16:58     ` Joseph S. Myers
2014-09-01 16:59       ` [PATCH 17/19 v3] " Siddhesh Poyarekar
2014-09-01 22:18         ` Siddhesh Poyarekar
2014-09-17 12:55         ` [ping][PATCH 17/17 v3] Use IS_IN internally only Siddhesh Poyarekar
2014-09-24  9:08           ` [ping2][PATCH " Siddhesh Poyarekar
2014-09-24  9:16             ` Joseph S. Myers
2014-11-07 23:33     ` [PATCH 17/19 v2] Use IS_IN only when _LIBC is defined Roland McGrath
2014-11-18 13:54       ` Siddhesh Poyarekar
2014-11-18 13:55         ` Siddhesh Poyarekar
2014-11-18 18:42         ` Roland McGrath
2014-11-18 19:53           ` Andreas Schwab
2014-08-21 10:58 ` [PATCH 08/19] Remove IS_IN_ldconfig Siddhesh Poyarekar
2014-08-22 18:29   ` Roland McGrath
2014-08-21 10:58 ` [PATCH 01/19] Add new macro IN_MODULE to identify module in which source is built Siddhesh Poyarekar
2014-08-22 18:22   ` Roland McGrath
2014-08-22 18:45     ` Siddhesh Poyarekar
2014-08-27 17:19     ` [PATCH 01/19 v2] " Siddhesh Poyarekar
2014-09-17 12:38       ` [ping][PATCH " Siddhesh Poyarekar
2014-09-24  9:06         ` [ping2][PATCH " Siddhesh Poyarekar
2014-10-01  8:16         ` [ping3][PATCH " Siddhesh Poyarekar
2014-10-14 16:20           ` [ping4][PATCH " Siddhesh Poyarekar
2014-11-05 11:03             ` [ping5][PATCH " Siddhesh Poyarekar
2014-11-07 23:22           ` [ping3][PATCH " Roland McGrath
2014-11-08  2:10             ` Siddhesh Poyarekar
2014-11-18 18:48               ` Roland McGrath
2014-08-21 10:58 ` [PATCH 14/19] Remove IS_IN_rtld Siddhesh Poyarekar
2014-08-22 19:34   ` Roland McGrath
2014-08-21 11:17 ` [PATCH 19/19] Define NOT_IN when building outside glibc Siddhesh Poyarekar
2014-08-22 13:51   ` Richard Henderson
2014-08-22 14:24     ` Siddhesh Poyarekar
2014-08-22 19:50       ` Siddhesh Poyarekar
2014-08-21 11:37 ` [PATCH 07/19] Remove IS_IN_libc Siddhesh Poyarekar
2014-08-22 18:29   ` Roland McGrath
2014-08-21 11:52 ` [PATCH 18/19] Define new macro NOT_IN Siddhesh Poyarekar
2014-08-22 19:39   ` Roland McGrath
2014-08-22 19:49     ` Siddhesh Poyarekar
2014-08-21 11:52 ` [PATCH 15/19] Remove last place for definition of IS_IN_* macros Siddhesh Poyarekar
2014-08-22 19:34   ` Roland McGrath
2014-08-22  4:57 ` [all-arch][PATCH 00/19] Fix -Wundef warning in SHLIB_COMPAT Siddhesh Poyarekar
2014-08-22 16:01   ` Joseph S. Myers
2014-08-22 17:32     ` Siddhesh Poyarekar
2014-08-22 18:01       ` Joseph S. Myers
2014-08-22 18:34         ` Siddhesh Poyarekar
2014-11-05 11:07 ` [PING] " Siddhesh Poyarekar

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