From a10178bda190a62e7e3f56773f55f23cf06848a7 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Thu, 20 Nov 2014 12:03:11 +0530 Subject: Remove IN_LIB 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 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'elf') diff --git a/elf/Makefile b/elf/Makefile index f013c22..1cf4c3a 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -443,7 +443,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 f2cc4a1..4d22436 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 -- cgit v1.1