View | Details | Raw Unified | Return to bug 221134 | Differences between
and this patch

Collapse All | Expand All

(-)Mk/Scripts/qa.sh (-1 / +58 lines)
Lines 822-831 Link Here
822
	return $rc
826
	return $rc
823
}
827
}
824
828
829
badlibmix() {
830
	local file dep_file rc
831
	local base_ssl_libs port_ssl_libs
832
	local base_gcc_libs port_gcc_libs
825
833
834
	rc=0
835
836
	# Check all dynamicaly linked ELF files
837
	# Some .so are not executable, but we want to check them too.
838
	while read file; do
839
		# No results presents a blank line from heredoc.
840
		[ -z "${file}" ] && continue
841
842
		base_ssl_libs=""
843
		port_ssl_libs=""
844
		base_gcc_libs=""
845
		port_gcc_libs=""
846
847
		while read dep_file; do
848
			# openssl
849
			if echo ${dep_file} | grep -qE "^(/usr/lib/libssl|/lib/libcrypto)\.so" > /dev/null; then
850
				base_ssl_libs="${base_ssl_libs} ${dep_file}"
851
			fi
852
			if echo ${dep_file} | grep -qE "^(${PREFIX}|${LOCALBASE})/lib/lib(ssl|crypto)\.so" > /dev/null; then
853
				port_ssl_libs="${port_ssl_libs} ${dep_file}"
854
			fi
855
			# libgcc_s
856
			if echo ${dep_file} | grep -qE "^/usr/lib/libgcc_s\.so" > /dev/null; then
857
				base_gcc_libs="${base_gcc_libs} ${dep_file}"
858
			fi
859
			if echo ${dep_file} | grep -qE "^/usr/local/lib/.*/libgcc_s\.so" > /dev/null; then
860
				port_gcc_libs="${port_gcc_libs} ${dep_file}"
861
			fi
862
		done <<-EOT
863
		$(LD_LIBRARY_PATH=${STAGEDIR}${PREFIX}/lib ldd "${STAGEDIR}${file}" | \
864
			grep '=>' | \
865
			awk '{print $3}')
866
		EOT
867
868
		if [ -n "${base_ssl_libs}" -a -n "${port_ssl_libs}" ]; then
869
			err "${file} is linked to both base and port SSL libraries: `echo ${base_ssl_libs}` and `echo ${port_ssl_libs}`"
870
			rc=1
871
		fi
872
		if [ -n "${base_gcc_libs}" -a -n "${port_gcc_libs}" ]; then
873
			err "${file} is linked to both base and port gcc_s libraries: `echo ${base_gcc_libs}` and `echo ${port_gcc_libs}`"
874
			rc=1
875
		fi
876
	done <<-EOT
877
	$(list_stagedir_elfs | \
878
		file -F $'\1' -f - | \
879
		grep -a 'ELF.*FreeBSD.*dynamically linked' | \
880
		cut -f 1 -d $'\1'| \
881
		sed -e 's/^\.//')
882
	EOT
883
884
	return ${rc}
885
}
886
826
checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo"
887
checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo"
827
checks="$checks suidfiles libtool libperl prefixvar baselibs terminfo"
888
checks="$checks suidfiles libtool libperl prefixvar baselibs terminfo"
828
checks="$checks proxydeps sonames perlcore no_arch"
889
checks="$checks proxydeps sonames perlcore no_arch badlibmix"
829
890
830
ret=0
891
ret=0
831
cd ${STAGEDIR}
892
cd ${STAGEDIR}

Return to bug 221134