00db10
Again we have to fix librtkaio to use MODULE_NAME definitions to
00db10
work around the changes we are making and preserve ABI/API.
00db10
00db10
commit 279bc5b3c384c09746fbadb2b68c6db9e833c064
00db10
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
00db10
Date:   Thu Nov 20 11:42:00 2014 +0530
00db10
00db10
    Use MODULE_NAME in stap-probe instead of IN_LIB
00db10
    
00db10
    Define MODULE_NAME in the build command and define IN_MODULE using
00db10
    MODULE_NAME.  Verified that the generated code is unchanged on x86_64.
00db10
    
00db10
    	* Makeconfig (module-cppflags-real): Define MODULE_NAME
00db10
    	instead of IN_MODULE.
00db10
    	* include/libc-symbols.h (IN_MODULE): Define using
00db10
    	MODULE_NAME.
00db10
    	(PASTE_NAME, PASTE_NAME1): New macros.
00db10
    	* include/stap-probe.h (LIBC_PROBE_1): Use MODULE_NAME instead
00db10
    	of IN_LIB.
00db10
    	(STAP_PROBE_ASM): Likewise.
00db10
00db10
Index: glibc-2.17-c758a686/Makeconfig
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/Makeconfig
00db10
+++ glibc-2.17-c758a686/Makeconfig
00db10
@@ -741,7 +741,7 @@ in-module = $(subst -,_,$(firstword $(li
00db10
 				    libc))
00db10
 
00db10
 module-cppflags-real = -include $(common-objpfx)libc-modules.h \
00db10
-		       -DIN_MODULE=MODULE_$(in-module)
00db10
+		       -DMODULE_NAME=$(in-module)
00db10
 
00db10
 # We don't need libc-modules.h and the MODULE_NAME definition for .v.i
00db10
 # files.  These targets don't (and will likely never need to) use the IS_IN
00db10
@@ -940,7 +940,7 @@ postclean-generated += soversions.mk sov
00db10
 before-compile += $(common-objpfx)libc-modules.h
00db10
 ifeq ($(soversions.mk-done),t)
00db10
 # Generate a header with macro definitions for use with the IS_IN macro.
00db10
-# These are the possible values for the IN_MODULE macro defined when building
00db10
+# These are the possible values for the MODULE_NAME macro defined when building
00db10
 # sources, to identify which module the translation unit is going to be built
00db10
 # into.
00db10
 $(common-objpfx)libc-modules.h: $(common-objpfx)libc-modules.stmp; @:
00db10
Index: glibc-2.17-c758a686/include/libc-symbols.h
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/include/libc-symbols.h
00db10
+++ glibc-2.17-c758a686/include/libc-symbols.h
00db10
@@ -20,8 +20,12 @@
00db10
 #ifndef _LIBC_SYMBOLS_H
00db10
 #define _LIBC_SYMBOLS_H	1
00db10
 
00db10
+#define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME)
00db10
 #define IS_IN(lib) (IN_MODULE == MODULE_##lib)
00db10
 
00db10
+#define PASTE_NAME(a,b)      PASTE_NAME1 (a,b)
00db10
+#define PASTE_NAME1(a,b)     a##b
00db10
+
00db10
 /* This file's macros are included implicitly in the compilation of every
00db10
    file in the C library by -imacros.
00db10
 
00db10
Index: glibc-2.17-c758a686/include/stap-probe.h
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/include/stap-probe.h
00db10
+++ glibc-2.17-c758a686/include/stap-probe.h
00db10
@@ -30,7 +30,7 @@
00db10
 
00db10
    Systemtap's header defines the macros STAP_PROBE (provider, name) and
00db10
    STAP_PROBEn (provider, name, arg1, ..., argn).  For "provider" we paste
00db10
-   in the IN_LIB name (libc, libpthread, etc.) automagically.  */
00db10
+   in MODULE_NAME (libc, libpthread, etc.) automagically.  */
00db10
 
00db10
 # ifndef NOT_IN_libc
00db10
 #  define IN_LIB	libc
00db10
@@ -45,7 +45,7 @@
00db10
 # endif
00db10
 
00db10
 # define LIBC_PROBE(name, n, ...)	\
00db10
-  LIBC_PROBE_1 (IN_LIB, name, n, ## __VA_ARGS__)
00db10
+  LIBC_PROBE_1 (MODULE_NAME, name, n, ## __VA_ARGS__)
00db10
 
00db10
 # define LIBC_PROBE_1(lib, name, n, ...) \
00db10
   STAP_PROBE##n (lib, name, ## __VA_ARGS__)
00db10
@@ -53,7 +53,7 @@
00db10
 # define STAP_PROBE0		STAP_PROBE
00db10
 
00db10
 # define LIBC_PROBE_ASM(name, template) \
00db10
-  STAP_PROBE_ASM (IN_LIB, name, template)
00db10
+  STAP_PROBE_ASM (MODULE_NAME, name, template)
00db10
 
00db10
 # define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS
00db10
 
00db10
Index: glibc-2.17-c758a686/rtkaio/Makefile
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/rtkaio/Makefile
00db10
+++ glibc-2.17-c758a686/rtkaio/Makefile
00db10
@@ -70,7 +70,9 @@ CFLAGS-kaio_librt-cancellation.c = -fasy
00db10
 LDFLAGS-rtkaio.so = -Wl,-soname=lib$(libprefix)rt.so$(librt.so-version) \
00db10
 		    -Wl,--enable-new-dtags,-z,nodelete
00db10
 CPPFLAGS-librtkaio += -UIN_MODULE -DIN_MODULE=MODULE_librt \
00db10
-		      -UIS_IN_librt -DIS_IN_librt=1 -I$(..)rt
00db10
+		      -UMODULE_NAME -DMODULE_NAME=librt \
00db10
+		      -UIS_IN_librt -DIS_IN_librt=1 \
00db10
+		      -I$(..)rt
00db10
 
00db10
 rpath-dirs := $(patsubst rt,rtkaio,$(rpath-dirs))
00db10