[Pkg-dpdk-devel] /usr/bin/dh_strip: dh_strip: perl -B incorrectly filters out some files

Luca Boccassi bluca at debian.org
Sat Mar 28 12:16:28 GMT 2020


Control: tags -1 patch

On Fri, 2020-03-27 at 11:56 +0000, Luca Boccassi wrote:
> > Package: debhelper
> > Version: 10.7.2
> > Severity: normal
> > File: /usr/bin/dh_strip
> > 
> > Dear Maintainer,
> > 
> > I'm working around #35733 and #468333 by renaming *.rlib to
> > *.rlib.a
> > before
> > running dh_strip(1). This works well, however one file is omitted
> > by
> > debhelper:
> > 
> > ----
> > $ xxd debian/libstd-rust-dev/usr/lib/rustlib/x86_64-unknown-linux-
> > gnu/lib/libstd-b6402de156fe6ac9.rlib | head -n16
> > 00000000: 213c 6172 6368 3e0a 2f20 2020 2020 2020  !<arch>./       
> > 00000010: 2020 2020 2020 2020 3020 2020 2020 2020          0       
> > 00000020: 2020 2020 3020 2020 2020 3020 2020 2020      0     0     
> > 00000030: 3020 2020 2020 2020 3132 3037 3634 2020  0       120764  
> > 00000040: 2020 600a 0000 0511 0001 d892 0001 d892    `.............
> > 00000050: 0001 d892 0001 d892 0001 d892 0001 d892  ................
> > 00000060: 0001 d892 0001 d892 0001 d892 0001 d892  ................
> > 00000070: 0001 d892 0001 d892 0001 d892 0001 d892  ................
> > 00000080: 0001 d892 0001 d892 0001 d892 0001 d892  ................
> > 00000090: 0001 d892 0001 d892 0001 d892 0001 d892  ................
> > 000000a0: 0001 d892 0001 d892 0001 d892 0001 d892  ................
> > 000000b0: 0001 d892 0001 d892 0001 d892 0001 d892  ................
> > 000000c0: 0001 d892 0001 d892 0001 d892 0001 d892  ................
> > 000000d0: 0001 d892 0001 d892 0001 d892 0001 d892  ................
> > 000000e0: 0001 d892 0001 d892 0001 d892 0001 d892  ................
> > 000000f0: 0001 d892 0001 d892 0001 d892 0001 d892  ................
> > ----
> > 
> > This is because dh_strip uses perl's -B check to filter out "text"
> > files for stripping, see here:
> > 
> > ----
> > 	# Is it a static library, and not a debug library?
> > 	if ($fn =~ m/\/lib[^\/]*\.a$/ && $fn !~ m/.*_g\.a$/) {
> > 		# Is it a binary file, or something else (maybe a
> > linker
> > 		# script on Hurd, for example? I don't use file,
> > because
> > 		# file returns a variety of things on static libraries.
> > 		if (-B $fn) {
> > 			push @static_libs, $fn;
> > 			return;
> > 		}
> > 	}
> > ----
> > 
> > This fails for the libstd-*.rlib I just gave - but if I remove the
> > -B
> > check
> > everything works. Obviously I can't do that in the packaging files
> > however. Is
> > there another way I can work around this issue, before it is fixed?
> > 
> > X
> 
> I face the same problem - a static library built on Jan 28th was
> stripped correctly, but one built on March 26th is now ignored by
> dh_strip because perl thinks it's a text file. The library has no
> diff
> between the two builds.
> 
> Once manually stripped, diffoscope reports this difference between
> the
> two libraries:
> 
> --- librte_pmd_virtio_crypto.a.old
> +++ librte_pmd_virtio_crypto.a
> ├── nm -s {}
> │ @@ -114,44 +114,44 @@
> │  000000000000012c r .LC82
> │  0000000000000143 r .LC83
> │  000000000000015d r .LC84
> │  0000000000000172 r .LC85
> │  0000000000000187 r .LC86
> │  00000000000000c8 r .LC9
> │                   U _GLOBAL_OFFSET_TABLE_
> │ -00000000000002d0 r __func__.37667
> │ -00000000000002f0 r __func__.39290
> │ -0000000000000170 r __func__.39787
> │ -00000000000004a0 r __func__.39809
> │ -0000000000000480 r __func__.39827
> │ -0000000000000040 r __func__.39845
> │ -0000000000000400 r __func__.39851
> │ -00000000000000a0 r __func__.39865
> │ -00000000000000c0 r __func__.39875
> │ -00000000000000e0 r __func__.39881
> │ -0000000000000100 r __func__.39895
> │ -0000000000000120 r __func__.39901
> │ -0000000000000000 r __func__.39907
> │ -0000000000000020 r __func__.39915
> │ -00000000000003c0 r __func__.39923
> │ -0000000000000460 r __func__.39928
> │ -0000000000000060 r __func__.39934
> │ -0000000000000440 r __func__.39939
> │ -0000000000000420 r __func__.39949
> │ -0000000000000140 r __func__.39960
> │ -0000000000000320 r __func__.39965
> │ -0000000000000360 r __func__.39970
> │ -00000000000003a0 r __func__.39988
> │ -00000000000001e0 r __func__.40023
> │ -00000000000001a0 r __func__.40038
> │ -0000000000000220 r __func__.40053
> │ -0000000000000260 r __func__.40061
> │ -00000000000002a0 r __func__.40078
> │ -0000000000000080 r __func__.40090
> │ -00000000000003e0 r __func__.40097
> │ +00000000000002d0 r __func__.37686
> │ +00000000000002f0 r __func__.39309
> │ +0000000000000170 r __func__.39806
> │ +00000000000004a0 r __func__.39828
> │ +0000000000000480 r __func__.39846
> │ +0000000000000040 r __func__.39864
> │ +0000000000000400 r __func__.39870
> │ +00000000000000a0 r __func__.39884
> │ +00000000000000c0 r __func__.39894
> │ +00000000000000e0 r __func__.39900
> │ +0000000000000100 r __func__.39914
> │ +0000000000000120 r __func__.39920
> │ +0000000000000000 r __func__.39926
> │ +0000000000000020 r __func__.39934
> │ +00000000000003c0 r __func__.39942
> │ +0000000000000460 r __func__.39947
> │ +0000000000000060 r __func__.39953
> │ +0000000000000440 r __func__.39958
> │ +0000000000000420 r __func__.39968
> │ +0000000000000140 r __func__.39979
> │ +0000000000000320 r __func__.39984
> │ +0000000000000360 r __func__.39989
> │ +00000000000003a0 r __func__.40007
> │ +00000000000001e0 r __func__.40042
> │ +00000000000001a0 r __func__.40057
> │ +0000000000000220 r __func__.40072
> │ +0000000000000260 r __func__.40080
> │ +00000000000002a0 r __func__.40097
> │ +0000000000000080 r __func__.40109
> │ +00000000000003e0 r __func__.40116
> │                   U __rte_panic
> │                   U __snprintf_chk
> │                   U __stack_chk_fail
> │                   U __tls_get_addr
> │                   U crypto_virtio_hw_internal
> │  0000000000000fea t crypto_virtio_pci_probe
> │  0000000000000050 t crypto_virtio_pci_remove
> │ @@ -251,19 +251,19 @@
> │  000000000000003c r .LC3
> │  0000000000000028 r .LC4
> │  0000000000000060 r .LC5
> │  000000000000005a r .LC7
> │  0000000000000098 r .LC8
> │  00000000000000c8 r .LC9
> │                   U _GLOBAL_OFFSET_TABLE_
> │ -0000000000000050 r __func__.38928
> │ -0000000000000070 r __func__.39003
> │ -0000000000000000 r __func__.39054
> │ -0000000000000010 r __func__.39062
> │ -0000000000000030 r __func__.39077
> │ +0000000000000050 r __func__.38949
> │ +0000000000000070 r __func__.39024
> │ +0000000000000000 r __func__.39075
> │ +0000000000000010 r __func__.39083
> │ +0000000000000030 r __func__.39098
> │                   U __stack_chk_fail
> │  0000000000000400 C crypto_virtio_hw_internal
> │  000000000000002b t get_cfg_addr
> │  0000000000000190 t modern_del_queue
> │  0000000000000080 t modern_get_features
> │  0000000000000120 t modern_get_isr
> │  0000000000000170 t modern_get_queue_num
> │ @@ -307,23 +307,23 @@
> │  0000000000000010 r .LC2
> │  0000000000000020 r .LC3
> │  0000000000000060 r .LC4
> │  0000000000000080 r .LC5
> │  0000000000000110 r .LC7
> │  0000000000000016 r .LC8
> │                   U _GLOBAL_OFFSET_TABLE_
> │ -00000000000000d0 r __func__.36564
> │ -00000000000000f0 r __func__.38828
> │ -0000000000000060 r __func__.38875
> │ -0000000000000090 r __func__.38887
> │ -0000000000000150 r __func__.38896
> │ -0000000000000170 r __func__.38906
> │ -0000000000000130 r __func__.38912
> │ -0000000000000110 r __func__.38927
> │ -00000000000000b0 r __func__.38936
> │ +00000000000000d0 r __func__.36581
> │ +00000000000000f0 r __func__.38845
> │ +0000000000000060 r __func__.38892
> │ +0000000000000090 r __func__.38904
> │ +0000000000000150 r __func__.38913
> │ +0000000000000170 r __func__.38923
> │ +0000000000000130 r __func__.38929
> │ +0000000000000110 r __func__.38944
> │ +00000000000000b0 r __func__.38953
> │                   U __rte_panic
> │                   U __stack_chk_fail
> │                   U __tls_get_addr
> │                   U crypto_virtio_hw_internal
> │                   U cryptodev_virtio_driver_id
> │                   U per_lcore__lcore_id
> │                   U rte_log
> │ @@ -343,15 +343,15 @@
> │                   U virtqueue_disable_intr
>> │  crypto_virtio_virtqueue.c.o:
> │  0000000000000000 r .LC0
> │  0000000000000000 r .LC1
> │  0000000000000040 r .LC2
> │                   U _GLOBAL_OFFSET_TABLE_
> │ -0000000000000000 r __func__.36474
> │ +0000000000000000 r __func__.36491
> │                   U __rte_panic
> │                   U __stack_chk_fail
> │                   U __tls_get_addr
> │                   U per_lcore__lcore_id
> │  0000000000000000 t rte_mempool_ops_enqueue_bulk.part.0
> │                   U rte_mempool_ops_table
> │  0000000000000000 t rte_pktmbuf_free
> ├── filetype from diffoscope
> │ @@ -1 +1 @@
> │ -ArFile
> │ +StaticLibFile
> 
> 
> Not sure how it detects the file type, and why it changes from ArFile
> to StaticLibFile (or what's the difference between the two).
> 
> Old package with librte_pmd_virtio_crypto.a stripped correctly:
> 
> http://snapshot.debian.org/package/dpdk/19.11-3/#libdpdk-dev_19.11-3
> 
> New package with librte_pmd_virtio_crypto.a unstripped:
> 
> https://salsa.debian.org/paelzer-guest/dpdk/-/jobs/630625/artifacts/file/debian/output/libdpdk-dev_19.11.1-1+salsaci_amd64.deb

Opened MR on Salsa to add a fallback on file --mime-type when perl -B
fails:

https://salsa.debian.org/debian/debhelper/-/merge_requests/37

-- 
Kind regards,
Luca Boccassi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://alioth-lists.debian.net/pipermail/pkg-dpdk-devel/attachments/20200328/d7c9f642/attachment.sig>


More information about the Pkg-dpdk-devel mailing list