Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ee46460 authored by Stephane Eranian's avatar Stephane Eranian Committed by Arnaldo Carvalho de Melo
Browse files

perf build: Add libcrypto feature detection



Will be used to generate build-ids in the jitdump code.

Signed-off-by: default avatarStephane Eranian <eranian@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Carl Love <cel@us.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: John McCutchan <johnmccutchan@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sonny Rao <sonnyrao@chromium.org>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1448874143-7269-3-git-send-email-eranian@google.com


[ tools/perf/Makefile.perf comment about NO_LIBCRYPTO and added it to tests/make ]
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent e9c4bcdd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ FEATURE_TESTS_BASIC := \
	libpython			\
	libpython-version		\
	libslang			\
	libcrypto			\
	libunwind			\
	pthread-attr-setaffinity-np	\
	stackprotector-all		\
@@ -87,6 +88,7 @@ FEATURE_DISPLAY ?= \
	libperl				\
	libpython			\
	libslang			\
	libcrypto			\
	libunwind			\
	libdw-dwarf-unwind		\
	zlib				\
+4 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ FILES= \
	test-libpython.bin		\
	test-libpython-version.bin	\
	test-libslang.bin		\
	test-libcrypto.bin		\
	test-libunwind.bin		\
	test-libunwind-debug-frame.bin	\
	test-pthread-attr-setaffinity-np.bin	\
@@ -105,6 +106,9 @@ $(OUTPUT)test-libaudit.bin:
$(OUTPUT)test-libslang.bin:
	$(BUILD) -I/usr/include/slang -lslang

$(OUTPUT)test-libcrypto.bin:
	$(BUILD) -lcrypto

$(OUTPUT)test-gtk2.bin:
	$(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)

+5 −0
Original line number Diff line number Diff line
@@ -129,6 +129,10 @@
# include "test-bpf.c"
#undef main

#define main main_test_libcrypto
# include "test-libcrypto.c"
#undef main

int main(int argc, char *argv[])
{
	main_test_libpython();
@@ -158,6 +162,7 @@ int main(int argc, char *argv[])
	main_test_lzma();
	main_test_get_cpuid();
	main_test_bpf();
	main_test_libcrypto();

	return 0;
}
+17 −0
Original line number Diff line number Diff line
#include <openssl/sha.h>
#include <openssl/md5.h>

int main(void)
{
	MD5_CTX context;
	unsigned char md[MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH];
	unsigned char dat[] = "12345";

	MD5_Init(&context);
	MD5_Update(&context, &dat[0], sizeof(dat));
	MD5_Final(&md[0], &context);

	SHA1(&dat[0], sizeof(dat), &md[0]);

	return 0;
}
+3 −0
Original line number Diff line number Diff line
@@ -58,6 +58,9 @@ include config/utilities.mak
#
# Define NO_LIBBIONIC if you do not want bionic support
#
# Define NO_LIBCRYPTO if you do not want libcrypto (openssl) support
# used for generating build-ids for ELFs generated by jitdump.
#
# Define NO_LIBDW_DWARF_UNWIND if you do not want libdw support
# for dwarf backtrace post unwind.
#
Loading