From 9b25f52a4425d03fee1364d3531331d5d37ef742 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Wed, 14 Sep 2022 10:41:04 +0200 Subject: Fix detection of ktls support in cross-compile environment on Linux Fixes #19212 Reviewed-by: Matt Caswell Reviewed-by: Hugo Landau (Merged from https://github.com/openssl/openssl/pull/19213) --- Configure | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'Configure') diff --git a/Configure b/Configure index 066ff1833e..7cebb72d33 100755 --- a/Configure +++ b/Configure @@ -1709,20 +1709,13 @@ unless ($disabled{devcryptoeng}) { unless ($disabled{ktls}) { $config{ktls}=""; + my $cc = $config{CROSS_COMPILE}.$config{CC}; if ($target =~ m/^linux/) { - my $usr = "/usr/$config{cross_compile_prefix}"; - chop($usr); - if ($config{cross_compile_prefix} eq "") { - $usr = "/usr"; - } - my $minver = (4 << 16) + (13 << 8) + 0; - my @verstr = split(" ",`cat $usr/include/linux/version.h | grep LINUX_VERSION_CODE`); - - if ($verstr[2] < $minver) { + system("printf '#include \n#include ' | $cc -E - >/dev/null 2>&1"); + if ($? != 0) { disable('too-old-kernel', 'ktls'); } } elsif ($target =~ m/^BSD/) { - my $cc = $config{CROSS_COMPILE}.$config{CC}; system("printf '#include \n#include ' | $cc -E - >/dev/null 2>&1"); if ($? != 0) { disable('too-old-freebsd', 'ktls'); -- cgit v1.2.1