All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf build: Suppress openssl v3 deprecation warnings in libcrypto feature test
@ 2022-06-25 15:34 Zixuan Tan
  2022-06-26 14:45 ` Jiri Olsa
  0 siblings, 1 reply; 11+ messages in thread
From: Zixuan Tan @ 2022-06-25 15:34 UTC (permalink / raw)
  To: terrelln
  Cc: Zixuan Tan, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, linux-kernel, netdev, bpf

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 <tanzixuan.me@gmail.com>
---
 tools/build/feature/test-libcrypto.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/build/feature/test-libcrypto.c b/tools/build/feature/test-libcrypto.c
index a98174e0569c..31afff093d0b 100644
--- a/tools/build/feature/test-libcrypto.c
+++ b/tools/build/feature/test-libcrypto.c
@@ -2,6 +2,12 @@
 #include <openssl/sha.h>
 #include <openssl/md5.h>
 
+/*
+ * The MD5_* API have been deprecated since OpenSSL 3.0, which causes the
+ * feature test to fail silently. This is a workaround.
+ */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
 int main(void)
 {
 	MD5_CTX context;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-08-03 16:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-25 15:34 [PATCH] perf build: Suppress openssl v3 deprecation warnings in libcrypto feature test Zixuan Tan
2022-06-26 14:45 ` Jiri Olsa
2022-06-26 15:18   ` Arnaldo Carvalho de Melo
2022-06-27  3:08   ` 谭梓煊
2022-06-28  6:16     ` Jiri Olsa
2022-08-01 13:24       ` Jiri Olsa
2022-08-02 18:09         ` Arnaldo Carvalho de Melo
2022-08-02 18:13           ` Arnaldo Carvalho de Melo
2022-08-03  5:16             ` Zixuan Tan
2022-08-03  7:32           ` Jiri Olsa
2022-08-03 16:01             ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.