Commit 9239ed33 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

mk: Don't use mime-type to determine type of the lib file



Some versions of the file (e.g. 5.33) confuse the sharedlib files with
pie-executable ones when they already have the executable bit set.
Since this particular bit is already set on the .so.* when they are
built, file may report the type as "application/x-pie-executable"
instead. As a result, lib files won't have proper permissions set
when installed.

This is a bit problematic for building the RPMs since when
find-provides kicks in to determine the dependencies, said files
are not picked up at all - package ends up with empty "provides:"
data breaking the dependency lookup during installation of other
packages which may depend on the broken one.

To mitigate, don't use mime-type, simply run file against the lib
in default mode and look for "shared object" string - this should
work for most of the file versions available on the supported
distribution.

Spotted on Fedora31.

Signed-off-by: default avatarMichal Berger <michalx.berger@intel.com>
Change-Id: If9974f5acbdad6eb1204b64f0ee1ac9b2e20f85b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6703


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
parent bfe83fd3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -394,7 +394,7 @@ endef
INSTALL_SHARED_LIB=\
	$(Q)echo "  INSTALL $(DESTDIR)$(libdir)/$(notdir $(SHARED_LINKED_LIB))"; \
	install -d -m 755 "$(DESTDIR)$(libdir)"; \
	if file --mime-type $(SHARED_REALNAME_LIB) | grep -q 'application/x-sharedlib'; then \
	if file $(SHARED_REALNAME_LIB) | grep -q 'LSB shared object'; then \
		perm_mode=755; \
	else \
		perm_mode=644; \