[DynInst_API:] Improving dyninst rpm packaging


Date: Wed, 13 Jun 2012 17:09:03 -0400
From: William Cohen <wcohen@xxxxxxxxxx>
Subject: [DynInst_API:] Improving dyninst rpm packaging
Hi,

I have gotten back to the dyninst packaging for rpm.  I have been using the dyninst/dyninst_proccontrol branch. One of the things that occurred during the build was that it would attempt build all the tests. This is undesired because it requires many other packages and greatly slows the build.  I am not sure that the the attached dyninst-notest.patch is the best way to address this, but it eliminates the undesired build of the tests.

The resulting dyninst rpms were not installable because all the linking is done with unversioned shared libaries (libcommon.so) then later the library names are changed in the install to versions names (libcommon.so.8.0). The rpmbuild process goes through and looks for implicit library dependencies using ldd (http://www.rpm.org/max-rpm/s1-rpm-depend-auto-depend.html), and finds that the libraries use the unversioned names rather than the versioned names.  The dyninst-vers.patch is an attempt to make the linker get the correct versions of the libraries. dyninst builds, but the resulting rpms do not install because of the library versioning issue.

There is a scratch build of an proccontrol git branch and these patches at:

http://koji.fedoraproject.org/koji/taskinfo?taskID=4159913

-Will
diff -up dyninst-8.0/dyninst/Makefile.notest dyninst-8.0/dyninst/Makefile
--- dyninst-8.0/dyninst/Makefile.notest	2012-06-12 16:43:01.409000013 -0400
+++ dyninst-8.0/dyninst/Makefile	2012-06-12 16:43:20.417998282 -0400
@@ -44,7 +44,7 @@ $(Everything_install) $(Everything_tests
 $(Test_targets):
 	@$(MAKE) -C testsuite/$(PLATFORM) $(@:%_testsuite=%)
 
-install: intro ready $(fullSystem_install) testsuite_install
+install: intro ready $(fullSystem_install)
 
 world: intro $(fullSystem)
 depend:
diff -up dyninst-8.0/dyninst/common/make.module.tmpl.vers dyninst-8.0/dyninst/common/make.module.tmpl
--- dyninst-8.0/dyninst/common/make.module.tmpl.vers	2012-06-08 14:12:59.000000000 -0400
+++ dyninst-8.0/dyninst/common/make.module.tmpl	2012-06-13 16:01:56.680999991 -0400
@@ -97,4 +97,4 @@ IFLAGS	     += -I/usr/include/libxml2
 endif
 
 # All that, and we finally get a target...
-all: $(TARGET) $(EXTRA_LIBS)
+all: $(TARGET).$(RELEASE_NUM) $(EXTRA_LIBS)
diff -up dyninst-8.0/dyninst/dynC_API/make.module.tmpl.vers dyninst-8.0/dyninst/dynC_API/make.module.tmpl
--- dyninst-8.0/dyninst/dynC_API/make.module.tmpl.vers	2012-06-08 14:12:59.000000000 -0400
+++ dyninst-8.0/dyninst/dynC_API/make.module.tmpl	2012-06-13 16:08:01.563000342 -0400
@@ -65,7 +65,7 @@ endif
 IFLAGS       += -I../$(PLATFORM) -I../src -I../h -I../../dynutil/h -I../../symtabAPI/h -I../../common/h -I../../instructionAPI/h -I../../dyninstAPI/src -I. 
 
 # All that, and we finally get a target...
-all: $(TARGET) $(EXTRA_LIBS) 
+all: $(TARGET).$(RELEASE_NUM) $(EXTRA_LIBS) 
 
 # We use a separate target for regenerating Lex and Yacc source files because of 
 # inconsistent Lex and Yacc availability across platforms.
diff -up dyninst-8.0/dyninst/dyninstAPI/make.module.tmpl.vers dyninst-8.0/dyninst/dyninstAPI/make.module.tmpl
--- dyninst-8.0/dyninst/dyninstAPI/make.module.tmpl.vers	2012-06-13 16:07:21.400001572 -0400
+++ dyninst-8.0/dyninst/dyninstAPI/make.module.tmpl	2012-06-13 16:08:00.568999991 -0400
@@ -217,7 +217,7 @@ IFLAGS      += -I../../proccontrol/h
 IFLAGS      += -I../../dataflowAPI/h
 
 # All that, and we finally get a target...
-all: $(TARGET) $(EXTRA_LIBS)
+all: $(TARGET).$(RELEASE_NUM) $(EXTRA_LIBS)
 
 
 # I couldn't figure out how to explicitly instantiate a templated
diff -up dyninst-8.0/dyninst/dyninstAPI_RT/make.module.tmpl.vers dyninst-8.0/dyninst/dyninstAPI_RT/make.module.tmpl
--- dyninst-8.0/dyninst/dyninstAPI_RT/make.module.tmpl.vers	2012-06-08 14:12:59.000000000 -0400
+++ dyninst-8.0/dyninst/dyninstAPI_RT/make.module.tmpl	2012-06-13 16:01:56.681999991 -0400
@@ -34,7 +34,7 @@ ifdef DISABLE_STACK_PROT
 CFLAGS += -fno-stack-protector
 endif
 
-all: $(TARGET) $(STATIC_TARGET)
+all: $(TARGET).$(RELEASE_NUM) $(STATIC_TARGET)
 
 #OBJS =		$(patsubst %.C, %.o, $(filter %.C,$(notdir $(SRCS)))) \
 #		$(patsubst %.c, %.o, $(filter %.c,$(notdir $(SRCS)))) \
diff -up dyninst-8.0/dyninst/dyninstAPI_RT/x86_64-unknown-linux2.4/Makefile.vers dyninst-8.0/dyninst/dyninstAPI_RT/x86_64-unknown-linux2.4/Makefile
--- dyninst-8.0/dyninst/dyninstAPI_RT/x86_64-unknown-linux2.4/Makefile.vers	2012-06-08 14:12:59.000000000 -0400
+++ dyninst-8.0/dyninst/dyninstAPI_RT/x86_64-unknown-linux2.4/Makefile	2012-06-13 16:01:56.681999991 -0400
@@ -78,18 +78,18 @@ $(VOUCHER_32):
 	@echo Updating build voucher information: $(VOUCHER_32)
 	$(HIDE_COMP)$(BUILDSTAMP) $(BUILD_ID) $(XTARGET)
 	$(HIDE_COMP)$(MODCC) -m32 -c $(VOUCHER).c -o $(VOUCHER_32).o
-$(TARGET_32_SO): $(OBJS_32) $(ASM_OBJS_32)
-	$(HIDE_COMP)$(RM) $(TARGET_32_SO)
+$(TARGET_32_SO).$(RELEASE_NUM): $(OBJS_32) $(ASM_OBJS_32)
+	$(HIDE_COMP)$(RM) $(TARGET_32_SO).$(RELEASE_NUM)
 	$(HIDE_COMP)$(MAKE) $(VOUCHER_32)
-	$(HIDE_COMP)$(LD) $(subst -m64,-m32,$(LDFLAGS_32)) -o $(TARGET_32_SO) $(VOUCHER_32).o $(OBJS_32) $(ASM_OBJS_32) $(LIBS_32)
+	$(HIDE_COMP)$(LD) $(subst -m64,-m32,$(LDFLAGS_32)) -o $(TARGET_32_SO).$(RELEASE_NUM) $(VOUCHER_32).o $(OBJS_32) $(ASM_OBJS_32) $(LIBS_32)
 RTspace.o: ../src/RTspace.S
 	@echo "Compiling RTspace"
 	$(HIDE_COMP)$(CC) $(CFLAGS) -c $< -o $@
 
 RELEASE_NUM ?= $(RELEASE_MAJOR).$(RELEASE_MINOR)
 
-$(DEST)/$(TARGET_32_SO): $(TARGET_32_SO)
-	-$(INSTALL) $(TARGET_32_SO) $(DEST)/$(TARGET_32_SO).$(RELEASE_NUM)
+$(DEST)/$(TARGET_32_SO).$(RELEASE_NUM): $(TARGET_32_SO).$(RELEASE_NUM)
+	-$(INSTALL) $(TARGET_32_SO).$(RELEASE_NUM) $(DEST)/$(TARGET_32_SO).$(RELEASE_NUM)
 	-$(LN) -f $(TARGET_32_SO).$(RELEASE_NUM) $(DEST)/$(TARGET_32_SO)
 
 # 32-bit static runtime library
@@ -113,8 +113,8 @@ $(DEST)/$(STATIC_TARGET_32): $(STATIC_TA
 	-$(INSTALL) $(STATIC_TARGET_32) $(DEST)
 
 ifndef SKIP_BUILD_RTLIB_32
-install: $(DEST)/$(TARGET_32_SO) $(DEST)/$(STATIC_TARGET_32)
-all: $(TARGET_32_SO) $(STATIC_TARGET_32)
+install: $(DEST)/$(TARGET_32_SO).$(RELEASE_NUM) $(DEST)/$(STATIC_TARGET_32)
+all: $(TARGET_32_SO).$(RELEASE_NUM) $(STATIC_TARGET_32)
 endif
 
 # Include the "standard program template".  This defines all the
diff -up dyninst-8.0/dyninst/instructionAPI/make.module.tmpl.vers dyninst-8.0/dyninst/instructionAPI/make.module.tmpl
--- dyninst-8.0/dyninst/instructionAPI/make.module.tmpl.vers	2012-06-08 14:12:59.000000000 -0400
+++ dyninst-8.0/dyninst/instructionAPI/make.module.tmpl	2012-06-13 16:01:56.681999991 -0400
@@ -73,7 +73,7 @@ PUBLIC_H =      BinaryFunction.h \
 
 
 # All that, and we finally get a target...
-all: $(TARGET) $(EXTRA_LIBS)
+all: $(TARGET).$(RELEASE_NUM) $(EXTRA_LIBS)
 
 
 
diff -up dyninst-8.0/dyninst/make.library.tmpl.vers dyninst-8.0/dyninst/make.library.tmpl
--- dyninst-8.0/dyninst/make.library.tmpl.vers	2012-06-08 14:12:59.000000000 -0400
+++ dyninst-8.0/dyninst/make.library.tmpl	2012-06-13 16:01:56.681999991 -0400
@@ -58,10 +58,11 @@ $(VOUCHER).o: $(VOUCHER).c
 
 ifndef OVERRIDE_LINK
 ifndef STATIC_LIBRARY
-$(TARGET): $(OBJS) $(EXTRA_LIBS) $(VOUCHER).o
-	$(HIDE_COMP)$(RM) $(TARGET)
+$(TARGET).$(RELEASE_NUM): $(OBJS) $(EXTRA_LIBS) $(VOUCHER).o
+	$(HIDE_COMP)$(RM) $(TARGET).$(RELEASE_NUM)
 	@echo Linking $@
-	$(HIDE_COMP)$(LD) $(LIBDIR) $(LDFLAGS) -o $(TARGET) $(VOUCHER).o $(OBJS) $(LIBS)
+	$(HIDE_COMP)$(LD) $(LIBDIR) $(LDFLAGS) -o $(TARGET).$(RELEASE_NUM) $(VOUCHER).o $(OBJS) $(LIBS)
+	$(HIDE_COMP)-$(LN) -f $(TARGET).$(RELEASE_NUM) $(TARGET)
 else # build a static lib
 $(TARGET): $(OBJS) $(EXTRA_LIBS) $(VOUCHER).o
 	$(HIDE_COMP)$(RM) $(TARGET)
@@ -131,14 +132,14 @@ echo:
 	echo $(OBJS)
 
 clean:
-	$(RM) *.o *.[hC] *.a *.so* .__afs* $(TARGET) $(STATIC_TARGET)
+	$(RM) *.o *.[hC] *.a *.so* .__afs* $(TARGET) $(TARGET).$(RELEASE_NUM) $(STATIC_TARGET)
 
 distclean: clean
 	$(RM) DEPENDS
 
-$(DEST)/$(TARGET): $(TARGET)
-	@echo Installing $(TARGET) to $(DEST)/$(TARGET).$(RELEASE_NUM)
-	$(HIDE_COMP)-$(INSTALL) $(TARGET) $(DEST)/$(TARGET).$(RELEASE_NUM)
+$(DEST)/$(TARGET).$(RELEASE_NUM): $(TARGET).$(RELEASE_NUM)
+	@echo Installing $(TARGET).$(RELEASE_NUM) to $(DEST)/$(TARGET).$(RELEASE_NUM)
+	$(HIDE_COMP)-$(INSTALL) $(TARGET).$(RELEASE_NUM) $(DEST)/$(TARGET).$(RELEASE_NUM)
 	@echo Making symlink $(TARGET).$(RELEASE_NUM) to $(DEST)/$(TARGET)
 	$(HIDE_COMP)-$(LN) -f $(TARGET).$(RELEASE_NUM) $(DEST)/$(TARGET)
 
@@ -147,11 +148,11 @@ $(DEST)/$(STATIC_TARGET): $(STATIC_TARGE
 	@echo Installing $(STATIC_TARGET) to $(DEST)
 	$(HIDE_COMP)-$(INSTALL) $(STATIC_TARGET) $(DEST)
 
-install_generic: $(DEST)/$(TARGET) public_includes $(DEST)/$(STATIC_TARGET)
+install_generic: $(DEST)/$(TARGET).$(RELEASE_NUM) public_includes $(DEST)/$(STATIC_TARGET)
 
 else
 
-install_generic: $(DEST)/$(TARGET) public_includes
+install_generic: $(DEST)/$(TARGET).$(RELEASE_NUM) public_includes
 
 endif
 
diff -up dyninst-8.0/dyninst/parseAPI/make.module.tmpl.vers dyninst-8.0/dyninst/parseAPI/make.module.tmpl
--- dyninst-8.0/dyninst/parseAPI/make.module.tmpl.vers	2012-06-08 14:12:59.000000000 -0400
+++ dyninst-8.0/dyninst/parseAPI/make.module.tmpl	2012-06-13 16:01:56.682999991 -0400
@@ -90,5 +90,5 @@ IFLAGS       += -I../$(PLATFORM) -I../sr
 
 
 # All that, and we finally get a target...
-all: $(TARGET) $(EXTRA_LIBS)
+all: $(TARGET).$(RELEASE_NUM) $(EXTRA_LIBS)
 
diff -up dyninst-8.0/dyninst/proccontrol/make.module.tmpl.vers dyninst-8.0/dyninst/proccontrol/make.module.tmpl
--- dyninst-8.0/dyninst/proccontrol/make.module.tmpl.vers	2012-06-08 14:12:59.000000000 -0400
+++ dyninst-8.0/dyninst/proccontrol/make.module.tmpl	2012-06-13 16:01:56.682999991 -0400
@@ -81,4 +81,4 @@ IFLAGS       += -I../src -I../h
 LDFLAGS += -L../../common/$(PLATFORM)
 
 # All that, and we finally get a target...
-all: $(TARGET) $(EXTRA_LIBS)
+all: $(TARGET).$(RELEASE_NUM) $(EXTRA_LIBS)
diff -up dyninst-8.0/dyninst/stackwalk/make.module.tmpl.vers dyninst-8.0/dyninst/stackwalk/make.module.tmpl
--- dyninst-8.0/dyninst/stackwalk/make.module.tmpl.vers	2012-06-08 14:12:59.000000000 -0400
+++ dyninst-8.0/dyninst/stackwalk/make.module.tmpl	2012-06-13 16:01:56.682999991 -0400
@@ -67,11 +67,11 @@ SRCS	     +=	../src/frame.C \
 IFLAGS       += -I../$(PLATFORM) -I../src -I../h -I../../proccontrol/h
 
 # All that, and we finally get a target...
-all: $(TARGET) $(EXTRA_LIBS)
+all: $(TARGET).$(RELEASE_NUM) $(EXTRA_LIBS)
 
 ifdef WRAPPER_LIBS
-all: libstackwalk_c.so
-install: $(DEST)/libstackwalk_c.so
+all: libstackwalk_c.so.$(RELEASE_NUM)
+install: $(DEST)/libstackwalk_c.so.$(RELEASE_NUM)
 endif
 
 SWOBJS = $(filter-out sw_c.o, $(OBJS))
@@ -85,8 +85,8 @@ WRAPPER_LIBS_NOCOMMA = $(subst $(comma),
 libsw.a: $(SWOBJS)
 	ar rs $@ $(SWOBJS)
 
-libstackwalk_c.so: libsw.a sw_c.o
+libstackwalk_c.so.$(RELEASE_NUM): libsw.a sw_c.o
 	g++ -o $@ -shared sw_c.o -Wl,--exclude-libs -Wl,ALL libsw.a $(WRAPPER_LIBS_NOCOMMA)
 
-$(DEST)/libstackwalk_c.so: libstackwalk_c.so
-	-$(INSTALL) libstackwalk_c.so $(DEST)
+$(DEST)/libstackwalk_c.so.$(RELEASE_NUM): libstackwalk_c.so.$(RELEASE_NUM)
+	-$(INSTALL) libstackwalk_c.so.$(RELEASE_NUM) $(DEST)
diff -up dyninst-8.0/dyninst/symtabAPI/make.module.tmpl.vers dyninst-8.0/dyninst/symtabAPI/make.module.tmpl
--- dyninst-8.0/dyninst/symtabAPI/make.module.tmpl.vers	2012-06-08 14:12:59.000000000 -0400
+++ dyninst-8.0/dyninst/symtabAPI/make.module.tmpl	2012-06-13 16:01:56.683999991 -0400
@@ -128,4 +128,4 @@ IFLAGS	     += -I/usr/include/libxml2
 endif
 
 # All that, and we finally get a target...
-all: $(TARGET) $(EXTRA_LIBS)
+all: $(TARGET).$(RELEASE_NUM) $(EXTRA_LIBS)
[← Prev in Thread] Current Thread [Next in Thread→]