Skip to content

Commit ebd5928

Browse files
alan-maguireKernel Patches Daemon
authored andcommitted
tools-build: Add feature test for openssl3
Add test that verifies if libcrypto has >= openssl3 support; use openssl3 function ERR_get_error_all() [1] [1] https://docs.openssl.org/3.0/man3/ERR_get_error/ Signed-off-by: Alan Maguire <[email protected]>
1 parent b8a9697 commit ebd5928

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

tools/build/feature/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ FILES= \
2222
test-cplus-demangle.bin \
2323
test-cxa-demangle.bin \
2424
test-libcap.bin \
25+
test-libcrypto.bin \
2526
test-libelf.bin \
2627
test-libelf-getphdrnum.bin \
2728
test-libelf-gelf_getnote.bin \
@@ -107,7 +108,7 @@ all: $(FILES)
107108
__BUILD = $(CC) $(CFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS)
108109
BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1
109110
BUILD_BFD = $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
110-
BUILD_ALL = $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma -lzstd
111+
BUILD_ALL = $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lcrypto -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma -lzstd
111112

112113
__BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS)
113114
BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1
@@ -138,6 +139,9 @@ $(OUTPUT)test-bionic.bin:
138139
$(OUTPUT)test-libcap.bin:
139140
$(BUILD) -lcap
140141

142+
$(OUTPUT)test-libcrypto.bin:
143+
$(BUILD) -lcrypto
144+
141145
$(OUTPUT)test-libelf.bin:
142146
$(BUILD) -lelf
143147

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <openssl/err.h>
3+
4+
/*
5+
* ERR_get_error_all() was introduced in openssl3
6+
*
7+
* https://docs.openssl.org/3.0/man3/ERR_get_error/
8+
*/
9+
int main(void)
10+
{
11+
return ERR_get_error_all(NULL, NULL, NULL, NULL, NULL);
12+
}

0 commit comments

Comments
 (0)