Blob Blame History Raw
Again we have to fix librtkaio to use MODULE_NAME definitions to
work around the changes we are making and preserve ABI/API.

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.

Index: glibc-2.17-c758a686/Makeconfig
===================================================================
--- glibc-2.17-c758a686.orig/Makeconfig
+++ glibc-2.17-c758a686/Makeconfig
@@ -741,7 +741,7 @@ in-module = $(subst -,_,$(firstword $(li
 				    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 MODULE_NAME definition for .v.i
 # files.  These targets don't (and will likely never need to) use the IS_IN
@@ -940,7 +940,7 @@ postclean-generated += soversions.mk sov
 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; @:
Index: glibc-2.17-c758a686/include/libc-symbols.h
===================================================================
--- glibc-2.17-c758a686.orig/include/libc-symbols.h
+++ glibc-2.17-c758a686/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.
 
Index: glibc-2.17-c758a686/include/stap-probe.h
===================================================================
--- glibc-2.17-c758a686.orig/include/stap-probe.h
+++ glibc-2.17-c758a686/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.  */
 
 # ifndef NOT_IN_libc
 #  define IN_LIB	libc
@@ -45,7 +45,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__)
@@ -53,7 +53,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
 
Index: glibc-2.17-c758a686/rtkaio/Makefile
===================================================================
--- glibc-2.17-c758a686.orig/rtkaio/Makefile
+++ glibc-2.17-c758a686/rtkaio/Makefile
@@ -70,7 +70,9 @@ CFLAGS-kaio_librt-cancellation.c = -fasy
 LDFLAGS-rtkaio.so = -Wl,-soname=lib$(libprefix)rt.so$(librt.so-version) \
 		    -Wl,--enable-new-dtags,-z,nodelete
 CPPFLAGS-librtkaio += -UIN_MODULE -DIN_MODULE=MODULE_librt \
-		      -UIS_IN_librt -DIS_IN_librt=1 -I$(..)rt
+		      -UMODULE_NAME -DMODULE_NAME=librt \
+		      -UIS_IN_librt -DIS_IN_librt=1 \
+		      -I$(..)rt
 
 rpath-dirs := $(patsubst rt,rtkaio,$(rpath-dirs))