diff options
author | Tomas Mraz <tomas@openssl.org> | 2022-09-14 10:41:04 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-09-19 11:50:13 +0200 |
commit | 9b25f52a4425d03fee1364d3531331d5d37ef742 (patch) | |
tree | f9dad3313f9beb724851b75a231d9890c5d5baa9 /Configure | |
parent | bebc6c899943cc3f519501aee221c9d0eb10fcfd (diff) | |
download | openssl-new-9b25f52a4425d03fee1364d3531331d5d37ef742.tar.gz |
Fix detection of ktls support in cross-compile environment on Linux
Fixes #19212
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19213)
Diffstat (limited to 'Configure')
-rwxr-xr-x | Configure | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -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 <sys/types.h>\n#include <linux/tls.h>' | $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 <sys/types.h>\n#include <sys/ktls.h>' | $cc -E - >/dev/null 2>&1"); if ($? != 0) { disable('too-old-freebsd', 'ktls'); |