From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id F26EB1F698 for ; Sun, 25 Dec 2022 13:24:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1671974653; bh=u5IWXr79mVP35uk40oxkPpiBSC9jU0LCFd7Ec5iNYL4=; h=From:To:Subject:Date:From; b=NvwBxQYHwQfzO9brlgsStNWNnJn14BXL6L5R9EAalxGuzWlzXpqJJxFrfj05QT403 vL/0a2VRNch6M97+sfvLsYNPr1DrEheWWTeCsWwRzD85sjhlHMNc8WCV2t9SamThsY 0lP5xbuUFu8+K71zezyRjh+m27j5gqJUSt+bkPFE= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] syscall: fix i386/i686 detection Date: Sun, 25 Dec 2022 13:24:12 +0000 Message-Id: <20221225132412.9323-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Both __ILP32__ and __x86_64__ need to be defined for a system to be considered x32. Without this, my 32-bit Debian VM on a 64-bit kernel would fail after upgrading to Perl 5.32.1 on Debian 11 (bullseye). --- lib/PublicInbox/Syscall.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/Syscall.pm b/lib/PublicInbox/Syscall.pm index cecb1247..530ee93b 100644 --- a/lib/PublicInbox/Syscall.pm +++ b/lib/PublicInbox/Syscall.pm @@ -87,7 +87,9 @@ if ($^O eq "linux") { # if we're running on an x86_64 kernel, but a 32-bit process, # we need to use the x32 or i386 syscall numbers. if ($machine eq 'x86_64') { - $machine = $Config{cppsymbols} =~ /\b__ILP32__=1\b/ ? 'x32' : 'i386' + my $s = $Config{cppsymbols}; + $machine = ($s =~ /\b__ILP32__=1\b/ && $s =~ /\b__x86_64__=1\b/) ? + 'x32' : 'i386' } elsif ($machine eq 'mips64') { # similarly for mips64 vs mips $machine = 'mips'; }