]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
util/checkplatformsyms.pl: do not exit after the first symbol
authorEugene Syromiatnikov <esyr@openssl.org>
Tue, 31 Mar 2026 04:00:59 +0000 (06:00 +0200)
committerTomas Mraz <tomas@openssl.foundation>
Fri, 3 Apr 2026 15:42:46 +0000 (17:42 +0200)
If there are several offending symbols, using the checker becomes quite
tedious.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Apr  3 15:42:18 2026
(Merged from https://github.com/openssl/openssl/pull/30635)

(cherry picked from commit 127245bb2dc1fcf53c5171e6d14d4e4d9a098b31)

util/checkplatformsyms.pl

index 0ba8d333b2a3cfea0cde8d850859092dee532bf2..f0ab62bdbac71f2b604642f100cfdf2f906e0ffa 100755 (executable)
@@ -62,13 +62,15 @@ if ($Config{osname} eq "MSWin32") {
         close($OBJFH);
         ($? >> 8 == 0) or die "Command '$cmd' has failed.";
 
+        my $ok = 1;
         foreach (@symlist) {
+            chomp;
             if (index($exps, $_) < 0) {
                 print "Symbol $_ not in the allowed platform symbols list\n";
-                exit 1;
+                $ok = 0;
             }
         }
-        exit 0;
+        exit !$ok;
     }
 else {
         $cmd = "objdump -t " . $objfilelist . " | grep UND | grep -v \@OPENSSL";
@@ -83,14 +85,16 @@ else {
         close($expsyms);
 
         open($OBJFH, "$cmd|") or die "Cannot open process: $!";
+        my $ok = 1;
         while (<$OBJFH>)
         {
+                chomp;
                 if (index($exps, $_) < 0) {
                     print "Symbol $_ not in the allowed platform symbols list\n";
-                    exit 1;
+                    $ok = 0;
                 }
         }
         close($OBJFH);
 
-        exit $? >> 8;
+        exit !(!($? >> 8) || !$ok);
     }