I'm attaching a patch that solves the issue; verification steps below.
It disables -fexceptions when building multipath-udeb.
(I had in mind something more elegant, like only adding -fno-exceptions from debian/rules into DEB_CFLAGS_MAINT_APPEND as done w/ -static-libgcc, but that way it doesn't override the post-added -fexceptions in Makefile.inc).. and found no other variable that would override it w/ less changes. So it's adding a patch to Makefile.inc and it does the job.)
Some comments with more details/explanation of the issue were not mirrored yet; should be on their way.
Build verification:
------------------
Checking the build log, the 2 tur.o objects are built correctly:
1) multipath-udeb: with -static-libgcc and without -fexceptions
2) multipath deb: without -static-libgcc and with -fexceptions (default)
$ dpkg-buildpackage 2>&1 | tee ../dpkg-buildpackage.log
Checking the build output, the ELF objects (don't) dyn-link to libgcc_s as appropriate:
1) multipath-udeb: ELF objects don't dyn-link with libgcc_s
2) multipath deb: ELF objects dyn-link with libgcc_s
I'm attaching a patch that solves the issue; verification steps below.
It disables -fexceptions when building multipath-udeb.
(I had in mind something more elegant, like only adding -fno-exceptions from debian/rules into DEB_CFLAGS_ MAINT_APPEND as done w/ -static-libgcc, but that way it doesn't override the post-added -fexceptions in Makefile.inc).. and found no other variable that would override it w/ less changes. So it's adding a patch to Makefile.inc and it does the job.)
Some comments with more details/explanation of the issue were not mirrored yet; should be on their way.
Build verification:
------------------
Checking the build log, the 2 tur.o objects are built correctly:
1) multipath-udeb: with -static-libgcc and without -fexceptions
2) multipath deb: without -static-libgcc and with -fexceptions (default)
$ dpkg-buildpackage 2>&1 | tee ../dpkg- buildpackage. log
$ grep -- '-o tur.o' ../dpkg- buildpackage. log protector- strong -Wformat -Werror= format- security -static-libgcc -D_FORTIFY_SOURCE=2 -O2 -g -pipe -Wall -Wp,-D_ FORTIFY_ SOURCE= 2 -fstack-protector --param= ssp-buffer- size=4 -Wunused -Wstrict-prototypes -fPIC -DLIB_STRING= \"lib\" -I.. -c -o tur.o tur.c protector- strong -Wformat -Werror= format- security -D_FORTIFY_SOURCE=2 -O2 -g -pipe -Wall -Wp,-D_ FORTIFY_ SOURCE= 2 -fexceptions -fstack-protector --param= ssp-buffer- size=4 -Wunused -Wstrict-prototypes -fPIC -DLIB_STRING= \"lib\" -I.. -c -o tur.o tur.c
cc -g -O3 -fPIE -fstack-
cc -g -O3 -fPIE -fstack-
Checking the build output, the ELF objects (don't) dyn-link to libgcc_s as appropriate:
1) multipath-udeb: ELF objects don't dyn-link with libgcc_s
2) multipath deb: ELF objects dyn-link with libgcc_s
$ find debian/ tmp-multipath- udeb/ | while read file; do file $file | grep -q ELF && objdump -x $file | grep -q 'NEEDED.*libgcc_s' && echo $file needs libgcc_s; done
$
$ find debian/tmp/ | while read file; do file $file | grep -q ELF && objdump -x $file | grep -q 'NEEDED.*libgcc_s' && echo $file needs libgcc_s; done tmp/lib/ libmultipath. so.0 needs libgcc_s tmp/lib/ multipath/ libchecktur. so needs libgcc_s tmp/sbin/ multipathd needs libgcc_s
debian/
debian/
debian/
$
Installer verification: ------- ------- --
-------
Configure multipath.conf for using tur with QEMU/KVM SCSI disks:
~ # cat <<EOF >/etc/multipath .conf <<EOF friendly_ names yes exceptions {
defaults {
user_
path_checker tur
}
blacklist_
property ID_SERIAL
}
EOF
Test (Not OK):
~ # multipath -v3
...
<...> | A dynamic linking error occurred: (libgcc_s.so.1: cannot open shared object file: No such file or directory)
...
<...> | A dynamic linking error occurred: (libgcc_s.so.1: cannot open shared object file: No such file or directory)
uuid hcil dev dev_t pri dm_st chk_st vend/prod/rev dev_st
0:0:1:0 sda 8:0 -1 undef faulty QEMU,QEMU HARDDISK running
0:0:2:0 sdb 8:16 -1 undef faulty QEMU,QEMU HARDDISK running
...
Install the new udeb:
~ # udpkg -i multipath- udeb_0. 5.0-7ubuntu3fex ceptions1_ ppc64el. udeb
Re-test (now OK):
~ # multipath -v3 QEMU_HARDDISK_ helloworld 0:0:1:0 sda 8:0 1 undef ready QEMU,QEMU HA QEMU_HARDDISK_ helloworld 0:0:2:0 sdb 8:16 1 undef ready QEMU,QEMU HA QEMU_HARDDISK_ helloworld) undef QEMU,QEMU HARDDISK
...
===== paths list =====
uuid hcil dev dev_t pri dm_st chk_st vend/prod/re
0QEMU_
0QEMU_
...
create: mpatha (0QEMU_
size=128G features='0' hwhandler='0' wp=undef
|-+- policy='round-robin 0' prio=1 status=undef
| `- 0:0:1:0 sda 8:0 undef ready running
`-+- policy='round-robin 0' prio=1 status=undef
`- 0:0:2:0 sdb 8:16 undef ready running
...