From: Eugene Syromiatnikov Date: Tue, 31 Mar 2026 10:17:51 +0000 (+0200) Subject: util/checkplatformsyms.pl: update the Unix symbol filtering X-Git-Tag: openssl-4.0.0~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=363ceb7dc8871cae7f9158e40502854cc1b9da37;p=thirdparty%2Fopenssl.git util/checkplatformsyms.pl: update the Unix symbol filtering Replace the grep|grep|awk|sed|sort|uniq abomination with a simple and elegant awk script. Signed-off-by: Eugene Syromiatnikov Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz MergeDate: Fri Apr 3 15:42:20 2026 (Merged from https://github.com/openssl/openssl/pull/30635) (cherry picked from commit 794fe02e500ff58dabb94513f577e61cc9b85a18) --- diff --git a/util/checkplatformsyms.pl b/util/checkplatformsyms.pl index f0ab62bdbac..0f44a4dbd90 100755 --- a/util/checkplatformsyms.pl +++ b/util/checkplatformsyms.pl @@ -73,9 +73,13 @@ if ($Config{osname} eq "MSWin32") { exit !$ok; } else { - $cmd = "objdump -t " . $objfilelist . " | grep UND | grep -v \@OPENSSL"; - $cmd = $cmd . " | awk '{print \$NF}' |"; - $cmd = $cmd . " sed -e\"s/@.*\$//\" | sort | uniq"; + $cmd = "objdump -t " . $objfilelist . " | awk " . + "'/\\\\*UND\\\\*/ {" . + "split(\$NF, sym_lib, \"@\");" . + "if (sym_lib[2] !~ \"OPENSSL_[1-9][0-9]*\\\\.[0-9]+\\\\.[0-9]+\$\")" . + "syms[sym_lib[1]] = 1;" . + "}" . + "END { for (s in syms) print s; };'"; open $expsyms, '<', $expectedsyms or die; {