|
|
147e83 |
commit a10178bda190a62e7e3f56773f55f23cf06848a7
|
|
|
147e83 |
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
|
|
|
147e83 |
Date: Thu Nov 20 12:03:11 2014 +0530
|
|
|
147e83 |
|
|
|
147e83 |
Remove IN_LIB
|
|
|
147e83 |
|
|
|
147e83 |
Replace with IS_IN and IS_IN_LIB macros instead. This change results
|
|
|
147e83 |
in a change in generated code, because it fixes a subtle bug. The bug
|
|
|
147e83 |
was introduced when systemtap probes were added to lowlevellock.h,
|
|
|
147e83 |
which resulted in stap-probe.h being included in a number of places.
|
|
|
147e83 |
stap-probe.h always defines IN_LIB, which breaks a check in errno.h
|
|
|
147e83 |
and netdb.h since they rely on that macro to decide whether to
|
|
|
147e83 |
implement an internal version of a declaration or an external one.
|
|
|
147e83 |
|
|
|
147e83 |
The components that see a code change due to this are:
|
|
|
147e83 |
|
|
|
147e83 |
iconv_prog
|
|
|
147e83 |
libmemusage.so
|
|
|
147e83 |
libpcprofile.so
|
|
|
147e83 |
libSegFault.so
|
|
|
147e83 |
libutil.so.1
|
|
|
147e83 |
locale
|
|
|
147e83 |
localedef
|
|
|
147e83 |
nscd
|
|
|
147e83 |
|
|
|
147e83 |
All other built components (i.e. libc, libpthread, etc.) remain
|
|
|
147e83 |
unchanged by this on x86_64.
|
|
|
147e83 |
|
|
|
147e83 |
* elf/Makefile (CPPFLAGS-.os): Remove IN_LIB.
|
|
|
147e83 |
* elf/rtld-Rules (rtld-CPPFLAGS): Likewise.
|
|
|
147e83 |
* extra-lib.mk (CPPFLAGS-$(lib)): Likewise.
|
|
|
147e83 |
* include/libc-symbols.h (IS_IN_LIB): New macro.
|
|
|
147e83 |
* include/errno.h: Use IS_IN_LIB instead of IN_LIB.
|
|
|
147e83 |
* include/netdb.h: Likewise.
|
|
|
147e83 |
* include/stap-probe.h: Remove all uses of IN_LIB.
|
|
|
147e83 |
|
|
|
147e83 |
Index: glibc-2.17-c758a686/elf/Makefile
|
|
|
147e83 |
===================================================================
|
|
|
147e83 |
--- glibc-2.17-c758a686.orig/elf/Makefile
|
|
|
147e83 |
+++ glibc-2.17-c758a686/elf/Makefile
|
|
|
147e83 |
@@ -443,7 +443,7 @@ CFLAGS-cache.c = $(SYSCONF-FLAGS)
|
|
|
147e83 |
CFLAGS-rtld.c = $(SYSCONF-FLAGS)
|
|
|
147e83 |
|
|
|
147e83 |
CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
|
|
|
147e83 |
- -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
|
|
|
147e83 |
+ -DNOT_IN_libc=1 -DIS_IN_rtld=1)
|
|
|
147e83 |
|
|
|
147e83 |
# Disable any optimization which might result in function calls during early
|
|
|
147e83 |
# dynamic loader startup. We disable -ftree-loop-distribute-patterns which
|
|
|
147e83 |
Index: glibc-2.17-c758a686/elf/rtld-Rules
|
|
|
147e83 |
===================================================================
|
|
|
147e83 |
--- glibc-2.17-c758a686.orig/elf/rtld-Rules
|
|
|
147e83 |
+++ glibc-2.17-c758a686/elf/rtld-Rules
|
|
|
147e83 |
@@ -134,6 +134,6 @@ lib := rtld
|
|
|
147e83 |
include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
|
|
|
147e83 |
|
|
|
147e83 |
# This here is the whole point of all the shenanigans.
|
|
|
147e83 |
-rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld
|
|
|
147e83 |
+rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1
|
|
|
147e83 |
|
|
|
147e83 |
endif
|
|
|
147e83 |
Index: glibc-2.17-c758a686/extra-lib.mk
|
|
|
147e83 |
===================================================================
|
|
|
147e83 |
--- glibc-2.17-c758a686.orig/extra-lib.mk
|
|
|
147e83 |
+++ glibc-2.17-c758a686/extra-lib.mk
|
|
|
147e83 |
@@ -101,4 +101,4 @@ ifneq (,$(cpp-srcs-left))
|
|
|
147e83 |
include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
|
|
|
147e83 |
endif
|
|
|
147e83 |
|
|
|
147e83 |
-CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1 -DIN_LIB=$(lib)
|
|
|
147e83 |
+CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1
|
|
|
147e83 |
Index: glibc-2.17-c758a686/include/errno.h
|
|
|
147e83 |
===================================================================
|
|
|
147e83 |
--- glibc-2.17-c758a686.orig/include/errno.h
|
|
|
147e83 |
+++ glibc-2.17-c758a686/include/errno.h
|
|
|
147e83 |
@@ -17,7 +17,7 @@
|
|
|
147e83 |
# define errno rtld_errno
|
|
|
147e83 |
extern int rtld_errno attribute_hidden;
|
|
|
147e83 |
|
|
|
147e83 |
-# elif !defined NOT_IN_libc || defined IN_LIB
|
|
|
147e83 |
+# elif !defined NOT_IN_libc || IS_IN_LIB
|
|
|
147e83 |
|
|
|
147e83 |
# include <tls.h>
|
|
|
147e83 |
|
|
|
147e83 |
@@ -29,7 +29,7 @@ extern int rtld_errno attribute_hidden;
|
|
|
147e83 |
# endif
|
|
|
147e83 |
extern __thread int errno attribute_tls_model_ie;
|
|
|
147e83 |
|
|
|
147e83 |
-# endif /* !NOT_IN_libc || IN_LIB */
|
|
|
147e83 |
+# endif /* !NOT_IN_libc || IS_IN_LIB */
|
|
|
147e83 |
|
|
|
147e83 |
# define __set_errno(val) (errno = (val))
|
|
|
147e83 |
|
|
|
147e83 |
Index: glibc-2.17-c758a686/include/libc-symbols.h
|
|
|
147e83 |
===================================================================
|
|
|
147e83 |
--- glibc-2.17-c758a686.orig/include/libc-symbols.h
|
|
|
147e83 |
+++ glibc-2.17-c758a686/include/libc-symbols.h
|
|
|
147e83 |
@@ -23,6 +23,11 @@
|
|
|
147e83 |
#define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME)
|
|
|
147e83 |
#define IS_IN(lib) (IN_MODULE == MODULE_##lib)
|
|
|
147e83 |
|
|
|
147e83 |
+/* Returns true if the current module is a versioned library. Versioned
|
|
|
147e83 |
+ library names culled from shlib-versions files are assigned a MODULE_*
|
|
|
147e83 |
+ value lower than MODULE_LIBS_BEGIN. */
|
|
|
147e83 |
+#define IS_IN_LIB (IN_MODULE > MODULE_LIBS_BEGIN)
|
|
|
147e83 |
+
|
|
|
147e83 |
#define PASTE_NAME(a,b) PASTE_NAME1 (a,b)
|
|
|
147e83 |
#define PASTE_NAME1(a,b) a##b
|
|
|
147e83 |
|
|
|
147e83 |
Index: glibc-2.17-c758a686/include/netdb.h
|
|
|
147e83 |
===================================================================
|
|
|
147e83 |
--- glibc-2.17-c758a686.orig/include/netdb.h
|
|
|
147e83 |
+++ glibc-2.17-c758a686/include/netdb.h
|
|
|
147e83 |
@@ -3,7 +3,7 @@
|
|
|
147e83 |
|
|
|
147e83 |
#ifndef _ISOMAC
|
|
|
147e83 |
/* Macros for accessing h_errno from inside libc. */
|
|
|
147e83 |
-# if !defined NOT_IN_libc || defined IN_LIB
|
|
|
147e83 |
+# if !defined NOT_IN_libc || IS_IN_LIB
|
|
|
147e83 |
# undef h_errno
|
|
|
147e83 |
# ifdef _LIBC_REENTRANT
|
|
|
147e83 |
# include <tls.h>
|
|
|
147e83 |
@@ -16,7 +16,7 @@ extern __thread int h_errno attribute_tl
|
|
|
147e83 |
# else
|
|
|
147e83 |
extern int h_errno;
|
|
|
147e83 |
# endif /* _LIBC_REENTRANT */
|
|
|
147e83 |
-# endif /* !NOT_IN_libc || IN_LIB */
|
|
|
147e83 |
+# endif /* !NOT_IN_libc || IS_IN_LIB */
|
|
|
147e83 |
# define __set_h_errno(x) (h_errno = (x))
|
|
|
147e83 |
|
|
|
147e83 |
libc_hidden_proto (hstrerror)
|
|
|
147e83 |
Index: glibc-2.17-c758a686/include/stap-probe.h
|
|
|
147e83 |
===================================================================
|
|
|
147e83 |
--- glibc-2.17-c758a686.orig/include/stap-probe.h
|
|
|
147e83 |
+++ glibc-2.17-c758a686/include/stap-probe.h
|
|
|
147e83 |
@@ -32,18 +32,6 @@
|
|
|
147e83 |
STAP_PROBEn (provider, name, arg1, ..., argn). For "provider" we paste
|
|
|
147e83 |
in MODULE_NAME (libc, libpthread, etc.) automagically. */
|
|
|
147e83 |
|
|
|
147e83 |
-# ifndef NOT_IN_libc
|
|
|
147e83 |
-# define IN_LIB libc
|
|
|
147e83 |
-# elif !defined IN_LIB
|
|
|
147e83 |
-/* This is intentionally defined with extra unquoted commas in it so
|
|
|
147e83 |
- that macro substitution will bomb out when it is used. We don't
|
|
|
147e83 |
- just use #error here, so that this header can be included by
|
|
|
147e83 |
- other headers that use LIBC_PROBE inside their own macros. We
|
|
|
147e83 |
- only want such headers to fail to compile if those macros are
|
|
|
147e83 |
- actually used in a context where IN_LIB has not been defined. */
|
|
|
147e83 |
-# define IN_LIB ,,,missing -DIN_LIB=... -- not extra-lib.mk?,,,
|
|
|
147e83 |
-# endif
|
|
|
147e83 |
-
|
|
|
147e83 |
# define LIBC_PROBE(name, n, ...) \
|
|
|
147e83 |
LIBC_PROBE_1 (MODULE_NAME, name, n, ## __VA_ARGS__)
|
|
|
147e83 |
|