Skip to content

Commit 10fef86

Browse files
frezcirnoacmel
authored andcommitted
perf build: Suppress openssl v3 deprecation warnings in libcrypto feature test
With OpenSSL v3 installed, the libcrypto feature check fails as it use the deprecated MD5_* API (and is compiled with -Werror). The error message is as follows. $ make tools/perf ``` Makefile.config:778: No libcrypto.h found, disables jitted code injection, please install openssl-devel or libssl-dev Auto-detecting system features: ... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... libbfd: [ on ] ... libbfd-buildid: [ on ] ... libcap: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... numa_num_possible_cpus: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libcrypto: [ OFF ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ] ... libaio: [ on ] ... libzstd: [ on ] ... disassembler-four-args: [ on ] ``` This is very confusing because the suggested library (on my Ubuntu 20.04 it is libssl-dev) is already installed. As the test only checks for the presence of libcrypto, this commit suppresses the deprecation warning to allow the test to pass. Signed-off-by: Zixuan Tan <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Andrii Nakryiko <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: John Fastabend <[email protected]> Cc: KP Singh <[email protected]> Cc: Martin KaFai Lau <[email protected]> Cc: Nick Terrell <[email protected]> Cc: Song Liu <[email protected]> Cc: Yonghong Song <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 9b7c772 commit 10fef86

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/build/feature/test-libcrypto.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
#include <openssl/sha.h>
33
#include <openssl/md5.h>
44

5+
/*
6+
* The MD5_* API have been deprecated since OpenSSL 3.0, which causes the
7+
* feature test to fail silently. This is a workaround.
8+
*/
9+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
10+
511
int main(void)
612
{
713
MD5_CTX context;

0 commit comments

Comments
 (0)