Bug#779579: installer broken: multipath-udeb depends on non-existent libgcc1 udeb

Mauricio Faria de Oliveira mauricfo at linux.vnet.ibm.com
Tue Mar 3 19:32:28 UTC 2015


Control: tags -1 patch

Hi Siresh,

On 03/03/2015 08:32 AM, Mauricio Faria de Oliveira wrote:
> Sure, I can try and should send a patch soon.

I've modified the build-arch target to build multipath-udeb first,
and store its output in a different directory; and the install target
to use that dir only for dh_install of multipath-udeb.

May you please consider it for an upload?


The solution ended up being to statically link to libgcc.  I implemented
Cyril's suggestion, adopted by espeakup-udeb, but unfortunately it didnt
remove the references to libgcc. (verified with objdump & runtime test).

(BTW, espeakup-udeb is broken too; that approach no longer works.)

	~ # anna-install espeakup-udeb
	~ # espeakup
	espeakup: error while loading shared libraries: libgcc_s.so.1: cannot 
open shared object file: No such file or directory


With the patch applied, the multipath command runs fine:

	~ # multipath -l
	multipath: error while loading shared libraries: libgcc_s.so.1: cannot 
open shared object file: No such file or directory

	~ # udpkg -i multipath-udeb_0.5.0-5mauricfo1_ppc64el.udeb
	(Reading database...)
	(Updating database...)

	~ # multipath -l
	~ # echo $?
	0

Here's a check that changes are contained in the multipath-udeb package.
The references to libgcc are gone, only libpthread remains (which is OK,
as it exists in the installer).  The nm/sed tests are based on Cyril's
earlier statement (thanks).

udeb (no libgcc):

	$ dpkg-deb -x multipath-udeb_0.5.0-5mauricfo1_ppc64el.udeb lib-udeb
	$ objdump -x lib-udeb/lib/libmultipath.so.0 | grep libgcc

	$ { nm -D lib-udeb/lib/libmultipath.so.0 | sed -n 's,^.*U ,,p'; nm -D 
/lib/powerpc64le-linux-gnu/libgcc_s.so.1 | sed -n 's,.*[^U] ,,p'; } | 
sort | uniq -d
	pthread_mutex_lock
	pthread_mutex_unlock

	~ # find /lib -name 'libpthread*'
	/lib/libpthread.so.0
	/lib/libpthread-2.19.so

deb (no change; still references libgcc)

	$ dpkg-deb -x multipath-tools_0.5.0-5mauricfo1_ppc64el.deb lib-deb
	$ objdump -x lib-deb/lib/libmultipath.so.0 | grep libgcc
	  NEEDED               libgcc_s.so.1
	  required from libgcc_s.so.1:

	$ { nm -D lib-deb/lib/libmultipath.so.0 | sed -n 's,^.*U ,,p'; nm -D 
/lib/powerpc64le-linux-gnu/libgcc_s.so.1 | sed -n 's,.*[^U] ,,p'; } | 
sort | uniq -d
	__gcc_personality_v0
	pthread_mutex_lock
	pthread_mutex_unlock
	_Unwind_Resume



-- 
Mauricio Faria de Oliveira
IBM Linux Technology Center
-------------- next part --------------
diff -Nru multipath-tools-0.5.0/debian/changelog multipath-tools-0.5.0/debian/changelog
--- multipath-tools-0.5.0/debian/changelog	2014-09-16 06:29:29.000000000 -0300
+++ multipath-tools-0.5.0/debian/changelog	2015-03-03 15:54:28.000000000 -0300
@@ -1,3 +1,9 @@
+multipath-tools (0.5.0-5mauricfo1) UNRELEASED; urgency=medium
+
+  * Build multipath-udeb with static libgcc (Closes: #779579)
+
+ -- Mauricio Faria de Oliveira <mauricfo at linux.vnet.ibm.com>  Tue, 03 Mar 2015 15:52:58 -0300
+
 multipath-tools (0.5.0-5) unstable; urgency=medium
 
   * [5f967eb] Better daemon status in init's status action.
diff -Nru multipath-tools-0.5.0/debian/rules multipath-tools-0.5.0/debian/rules
--- multipath-tools-0.5.0/debian/rules	2014-09-05 09:14:33.000000000 -0300
+++ multipath-tools-0.5.0/debian/rules	2015-03-03 15:50:32.000000000 -0300
@@ -27,7 +26,7 @@
 
 build: build-arch build-indep
 
-build-arch: build-stamp
+build-arch: build-multipath-udeb-stamp build-stamp
 build-indep: build-stamp
 
 build-stamp:
@@ -39,15 +38,30 @@
 
 	touch $@
 
+# multipath-udeb: build separately; don't reference dynamic libgcc at runtime (#779579)
+build-multipath-udeb-stamp:
+	dh_testdir
+
+	DEB_CFLAGS_MAINT_APPEND="-static-libgcc" $(MAKE) $(OPTFLAGS) LIB=lib
+	
+	# store files for install target
+	mkdir -p $(CURDIR)/debian/tmp-multipath-udeb/sbin
+	$(MAKE) install INSTALL_PROGRAM=$(INSTALL_PROGRAM) DESTDIR=$(CURDIR)/debian/tmp-multipath-udeb LIB=lib
+
+	$(MAKE) clean
+
+	touch $@
+
 clean-tree:
 	$(MAKE) clean
 
 clean: clean-tree
 	dh_testdir
-	rm -f build-stamp
+	rm -f build-stamp build-multipath-udeb-stamp
 	dh_prep
 	debconf-updatepo
 	rm -rf debian/*.debhelper.log
+	rm -rf debian/tmp-multipath-udeb
 
 install:
 	dh_testdir
@@ -58,7 +72,8 @@
 	mkdir -p $(CURDIR)/debian/tmp/sbin
 	$(MAKE) install INSTALL_PROGRAM=$(INSTALL_PROGRAM) DESTDIR=$(CURDIR)/debian/tmp LIB=lib
 	install -m 755 debian/dmsetup_env $(CURDIR)/debian/tmp/lib/udev/
-	dh_install -X.rules --fail-missing --sourcedir=$(CURDIR)/debian/tmp
+	dh_install -X.rules --fail-missing -Nmultipath-udeb --sourcedir=$(CURDIR)/debian/tmp
+	dh_install -X.rules --fail-missing -pmultipath-udeb --sourcedir=$(CURDIR)/debian/tmp-multipath-udeb
 	# initramfs stuff:
 	install -D -m 755 debian/initramfs/hooks $(INITRAMFS)/hooks/multipath
 	install -D -m 755 debian/initramfs/local-top \


More information about the pkg-lvm-maintainers mailing list