mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-10 16:34:00 +00:00
perf build: Add libcrypto feature detection
Will be used to generate build-ids in the jitdump code. Signed-off-by: Stephane 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: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
e9c4bcdd34
commit
8ee4646038
7 changed files with 44 additions and 0 deletions
|
@ -46,6 +46,7 @@ FEATURE_TESTS_BASIC := \
|
||||||
libpython \
|
libpython \
|
||||||
libpython-version \
|
libpython-version \
|
||||||
libslang \
|
libslang \
|
||||||
|
libcrypto \
|
||||||
libunwind \
|
libunwind \
|
||||||
pthread-attr-setaffinity-np \
|
pthread-attr-setaffinity-np \
|
||||||
stackprotector-all \
|
stackprotector-all \
|
||||||
|
@ -87,6 +88,7 @@ FEATURE_DISPLAY ?= \
|
||||||
libperl \
|
libperl \
|
||||||
libpython \
|
libpython \
|
||||||
libslang \
|
libslang \
|
||||||
|
libcrypto \
|
||||||
libunwind \
|
libunwind \
|
||||||
libdw-dwarf-unwind \
|
libdw-dwarf-unwind \
|
||||||
zlib \
|
zlib \
|
||||||
|
|
|
@ -23,6 +23,7 @@ FILES= \
|
||||||
test-libpython.bin \
|
test-libpython.bin \
|
||||||
test-libpython-version.bin \
|
test-libpython-version.bin \
|
||||||
test-libslang.bin \
|
test-libslang.bin \
|
||||||
|
test-libcrypto.bin \
|
||||||
test-libunwind.bin \
|
test-libunwind.bin \
|
||||||
test-libunwind-debug-frame.bin \
|
test-libunwind-debug-frame.bin \
|
||||||
test-pthread-attr-setaffinity-np.bin \
|
test-pthread-attr-setaffinity-np.bin \
|
||||||
|
@ -105,6 +106,9 @@ $(OUTPUT)test-libaudit.bin:
|
||||||
$(OUTPUT)test-libslang.bin:
|
$(OUTPUT)test-libslang.bin:
|
||||||
$(BUILD) -I/usr/include/slang -lslang
|
$(BUILD) -I/usr/include/slang -lslang
|
||||||
|
|
||||||
|
$(OUTPUT)test-libcrypto.bin:
|
||||||
|
$(BUILD) -lcrypto
|
||||||
|
|
||||||
$(OUTPUT)test-gtk2.bin:
|
$(OUTPUT)test-gtk2.bin:
|
||||||
$(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
|
$(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,10 @@
|
||||||
# include "test-bpf.c"
|
# include "test-bpf.c"
|
||||||
#undef main
|
#undef main
|
||||||
|
|
||||||
|
#define main main_test_libcrypto
|
||||||
|
# include "test-libcrypto.c"
|
||||||
|
#undef main
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
main_test_libpython();
|
main_test_libpython();
|
||||||
|
@ -158,6 +162,7 @@ int main(int argc, char *argv[])
|
||||||
main_test_lzma();
|
main_test_lzma();
|
||||||
main_test_get_cpuid();
|
main_test_get_cpuid();
|
||||||
main_test_bpf();
|
main_test_bpf();
|
||||||
|
main_test_libcrypto();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
17
tools/build/feature/test-libcrypto.c
Normal file
17
tools/build/feature/test-libcrypto.c
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#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;
|
||||||
|
}
|
|
@ -58,6 +58,9 @@ include config/utilities.mak
|
||||||
#
|
#
|
||||||
# Define NO_LIBBIONIC if you do not want bionic support
|
# 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
|
# Define NO_LIBDW_DWARF_UNWIND if you do not want libdw support
|
||||||
# for dwarf backtrace post unwind.
|
# for dwarf backtrace post unwind.
|
||||||
#
|
#
|
||||||
|
|
|
@ -404,6 +404,17 @@ ifndef NO_LIBAUDIT
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef NO_LIBCRYPTO
|
||||||
|
ifneq ($(feature-libcrypto), 1)
|
||||||
|
msg := $(warning No libcrypto.h found, disables jitted code injection, please install libssl-devel or libssl-dev);
|
||||||
|
NO_LIBCRYPTO := 1
|
||||||
|
else
|
||||||
|
CFLAGS += -DHAVE_LIBCRYPTO_SUPPORT
|
||||||
|
EXTLIBS += -lcrypto
|
||||||
|
$(call detected,CONFIG_CRYPTO)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef NO_NEWT
|
ifdef NO_NEWT
|
||||||
NO_SLANG=1
|
NO_SLANG=1
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -80,6 +80,7 @@ make_no_libaudit := NO_LIBAUDIT=1
|
||||||
make_no_libbionic := NO_LIBBIONIC=1
|
make_no_libbionic := NO_LIBBIONIC=1
|
||||||
make_no_auxtrace := NO_AUXTRACE=1
|
make_no_auxtrace := NO_AUXTRACE=1
|
||||||
make_no_libbpf := NO_LIBBPF=1
|
make_no_libbpf := NO_LIBBPF=1
|
||||||
|
make_no_libcrypto := NO_LIBCRYPTO=1
|
||||||
make_tags := tags
|
make_tags := tags
|
||||||
make_cscope := cscope
|
make_cscope := cscope
|
||||||
make_help := help
|
make_help := help
|
||||||
|
@ -103,6 +104,7 @@ make_minimal := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1
|
||||||
make_minimal += NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1
|
make_minimal += NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1
|
||||||
make_minimal += NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1
|
make_minimal += NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1
|
||||||
make_minimal += NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1
|
make_minimal += NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1
|
||||||
|
make_minimal += NO_LIBCRYPTO=1
|
||||||
|
|
||||||
# $(run) contains all available tests
|
# $(run) contains all available tests
|
||||||
run := make_pure
|
run := make_pure
|
||||||
|
|
Loading…
Add table
Reference in a new issue