Index | Thread | Search

From:
Stuart Henderson <stu@spacehopper.org>
Subject:
Re: make check-shlib-syms
To:
ports@openbsd.org
Date:
Mon, 18 May 2026 20:45:22 +0100

Download raw body.

Thread
On 2026/05/18 21:21, Kirill A. Korinsky wrote:
> On Mon, 18 May 2026 13:41:56 +0200,
> Stuart Henderson <stu@spacehopper.org> wrote:
> > 
> > I wonder if it would be worth adding a mode to check_sym that skips
> > printing external reference / PLT changes and using that? I don't
> > think they're very useful for ports and (looking at bumps in some
> > ports@ submissions) they confuse people sometimes.
> > 
> 
> Like this?

exactly.

ok with me


> Index: src/lib/check_sym
> ===================================================================
> RCS file: /cvs/src/lib/check_sym,v
> diff -u -p -r1.15 check_sym
> --- src/lib/check_sym	12 May 2026 15:14:41 -0000	1.15
> +++ src/lib/check_sym	18 May 2026 19:19:31 -0000
> @@ -20,7 +20,7 @@
>  #	versions of a library
>  #
>  #  SYNOPSIS
> -#	check_sym [-chkSv] [old [new]]
> +#	check_sym [-chIkSv] [old [new]]
>  #
>  #  DESCRIPTION
>  #	Library developers need to be aware when they have changed the
> @@ -35,6 +35,9 @@
>  #
>  #	With the -S option, a similar analysis is done but for the static lib.
>  #
> +#	The -I option ignores changes to undefined external references and
> +#	lazily-resolved functions (PLT).
> +#
>  #	The shared libraries to compare can be specified on the
>  #	command-line.  Otherwise, check_sym expects to be run from the
>  #	source directory of a library with a shlib_version file specifying
> @@ -110,7 +113,7 @@ fail() { echo "$*" >&2; exit 1; }
>  
>  usage()
>  {
> -	usage="usage: check_sym [-chkSv] [old [new]]"
> +	usage="usage: check_sym [-chIkSv] [old [new]]"
>  	[[ $# -eq 0 ]] || fail "check_sym: $*
>  $usage"
>  	echo "$usage"
> @@ -221,7 +224,7 @@ dynamic_output()
>  		output_if_not_empty "data object sizes changes:" \
>  						data_sym_changes DO[12]
>  	fi
> -	if ! cmp -s DU[12]
> +	if ! $ignore_refs && ! cmp -s DU[12]
>  	then
>  		printf "External reference changes:\n"
>  		output_if_not_empty "added:" comm -13 DU[12]
> @@ -235,8 +238,11 @@ dynamic_output()
>  		grep ^R r2
>  	fi
>  
> -	output_if_not_empty "PLT added:" comm -13 J[12]
> -	output_if_not_empty "PLT removed:" comm -23 J[12]
> +	if ! $ignore_refs
> +	then
> +		output_if_not_empty "PLT added:" comm -13 J[12]
> +		output_if_not_empty "PLT removed:" comm -23 J[12]
> +	fi
>  }
>  
>  
> @@ -278,7 +284,7 @@ static_output()
>  		output_if_not_empty "data object sizes changes:" \
>  						data_sym_changes SO[12]
>  	fi
> -	if ! cmp -s SU[12]
> +	if ! $ignore_refs && ! cmp -s SU[12]
>  	then
>  		printf "External reference changes:\n"
>  		output_if_not_empty "added:" comm -13 SU[12]
> @@ -295,15 +301,17 @@ keep_temp=false
>  dynamic=true
>  static=false
>  verbose=false
> +ignore_refs=false
>  
>  do_static() { static=true dynamic=false file_list=$static_file_list; }
>  
> -while getopts :chkSv opt "$@"
> +while getopts :chIkSv opt "$@"
>  do
>  	case $opt in
>  	c)	rm -f /tmp/$file_list
>  		exit 0;;
>  	h)	usage;;
> +	I)	ignore_refs=true;;
>  	k)	keep_temp=true;;
>  	S)	do_static;;
>  	v)	verbose=true;;
> Index: ports/infrastructure/mk/bsd.port.mk
> ===================================================================
> RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
> diff -u -p -r1.1650 bsd.port.mk
> --- ports/infrastructure/mk/bsd.port.mk	18 May 2026 13:20:37 -0000	1.1650
> +++ ports/infrastructure/mk/bsd.port.mk	18 May 2026 19:19:31 -0000
> @@ -2572,7 +2572,7 @@ check-shlib-syms: ${_FAKE_COOKIE}
>  			esac; \
>  			old=$$(ls -rt $$oldpat 2>/dev/null | tail -1); \
>  			[ -n "$$old" ] || { echo "check-shlib-syms: no installed library for $$_l"; continue; }; \
> -			${_CHECK_SYM} "$$old" "$$new"; \
> +			${_CHECK_SYM} -I "$$old" "$$new"; \
>  		done; \
>  	done
>  
> 
> 
> -- 
> wbr, Kirill
>