Index: head/devel/android-tools-simpleperf/Makefile =================================================================== --- head/devel/android-tools-simpleperf/Makefile (revision 461278) +++ head/devel/android-tools-simpleperf/Makefile (revision 461279) @@ -1,46 +1,46 @@ # $FreeBSD$ PORTNAME= android-tools-simpleperf DISTVERSIONPREFIX= android- DISTVERSION= 7.1.2_r17 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MAINTAINER= jbeich@FreeBSD.org COMMENT= Android simpleperf tool LICENSE= APACHE20 BUILD_DEPENDS= llvm-config${LLVM_VER}:devel/llvm${LLVM_VER} USE_GITHUB= yes GH_ACCOUNT= android:bionic,core jbeich GH_PROJECT= platform_bionic:bionic platform_system_core:core \ platform_system_extras GH_SUBDIR= bionic:bionic USES= compiler:c++11-lib ncurses uidfix BUILD_WRKSRC= ${WRKSRC}/simpleperf INSTALL_WRKSRC= ${BUILD_WRKSRC} TEST_WRKSRC= ${BUILD_WRKSRC} MAKEFILE= ${FILESDIR}/Makefile MAKE_ENV= BINDIR="${PREFIX}/bin" LLVM_CONFIG="llvm-config${LLVM_VER}" ALL_TARGET= all TEST_TARGET= test LDFLAGS+= -Wl,--as-needed # avoid overlinking (llvm deps) PLIST_FILES= bin/simpleperf -LLVM_VER?= 38 # XXX Move to DEFAULT_VERSIONS +LLVM_VER?= 50 # XXX Move to DEFAULT_VERSIONS OPTIONS_DEFINE= TEST TEST_BUILD_DEPENDS= googletest>=1.6.0:devel/googletest TEST_ALL_TARGET= simpleperf_test post-extract: # Adjust paths relative to extras @(cd ${WRKSRC_core} && ${COPYTREE_SHARE} . ${WRKSRC}) pre-install-TEST-on: do-test .include Index: head/devel/android-tools-simpleperf/files/Makefile =================================================================== --- head/devel/android-tools-simpleperf/files/Makefile (revision 461278) +++ head/devel/android-tools-simpleperf/files/Makefile (revision 461279) @@ -1,107 +1,110 @@ # $FreeBSD$ PROG_CXX=simpleperf NO_MAN= BINDIR?=/usr/bin SRCS+= callchain.cpp SRCS+= cmd_dumprecord.cpp SRCS+= cmd_help.cpp SRCS+= cmd_report.cpp SRCS+= command.cpp SRCS+= dso.cpp SRCS+= event_attr.cpp SRCS+= event_type.cpp SRCS+= main.cpp SRCS+= perf_regs.cpp SRCS+= read_apk.cpp SRCS+= read_elf.cpp SRCS+= record.cpp SRCS+= record_file_reader.cpp SRCS+= sample_tree.cpp SRCS+= thread_tree.cpp SRCS+= utils.cpp TEST_SRCS+= cmd_report_test.cpp TEST_SRCS+= command_test.cpp TEST_SRCS+= gtest_main.cpp TEST_SRCS+= read_apk_test.cpp TEST_SRCS+= read_elf_test.cpp TEST_SRCS+= record_test.cpp TEST_SRCS+= sample_tree_test.cpp .PATH: ${.CURDIR}/nonlinux_support SRCS+= nonlinux_support.cpp # required by simpleperf .PATH: ${.CURDIR}/../base SRCS+= file.cpp SRCS+= logging.cpp SRCS+= stringprintf.cpp SRCS+= strings.cpp TEST_SRCS+= file_test.cpp TEST_SRCS+= logging_test.cpp TEST_SRCS+= stringprintf_test.cpp TEST_SRCS+= strings_test.cpp TEST_SRCS+= test_utils.cpp # required by base .PATH: ${.CURDIR}/../liblog SRCS+= config_write.c SRCS+= fake_log_device.c SRCS+= fake_writer.c SRCS+= logger_lock.c SRCS+= logger_name.c SRCS+= logger_write.c CPPFLAGS.config_write.c+= -DFAKE_LOG_DEVICE=1 # required by libziparchive .PATH: ${.CURDIR}/../libutils SRCS+= FileMap.cpp # required by simpleperf .PATH: ${.CURDIR}/../libziparchive SRCS+= zip_archive.cc CPPFLAGS+= -D_WITH_GETLINE CPPFLAGS+= -DUSE_BIONIC_UAPI_HEADERS CPPFLAGS+= -Doff64_t=off_t CPPFLAGS+= -Dftruncate64=ftruncate CPPFLAGS+= -Dlseek64=lseek CPPFLAGS+= -Dmmap64=mmap CPPFLAGS+= -Dpread64=pread CPPFLAGS+= -I${.CURDIR} CPPFLAGS+= -I${.CURDIR}/nonlinux_support/include CPPFLAGS+= -I${.CURDIR}/../include CPPFLAGS+= -I${.CURDIR}/../base/include CPPFLAGS+= -I${.CURDIR}/../bionic/libc/kernel CPPFLAGS+= $$(${LLVM_CONFIG} --cppflags) CPPFLAGS+= ${CPPFLAGS.${.IMPSRC:T}} CXXFLAGS+= -std=gnu++11 .ifndef COMPILE.c CFLAGS+= ${CPPFLAGS} CXXFLAGS+= ${CPPFLAGS} .endif TEST_CPPFLAGS+= $$(${GTEST_CONFIG} --cppflags) .for f in ${TEST_SRCS} CPPFLAGS.${f}+= ${TEST_CPPFLAGS} .endfor -LDADD+= $$(${LLVM_CONFIG} --system-libs --libs --ldflags) +LDADD!= ${LLVM_CONFIG} --system-libs --libs --ldflags --link-static +LDADD+= -lz \-lpthread +# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223191#c3 +LDADD:= ${LDADD:S,-l/usr/lib/libexecinfo.so,-lexecinfo,} TEST_LDADD+= $$(${GTEST_CONFIG} --libs --ldflags) TEST_OBJS+= ${TEST_SRCS:R:S/$/.o/} CLEANFILES+= ${PROG}_test ${TEST_OBJS} LLVM_CONFIG?= llvm-config GTEST_CONFIG?= gtest-config .include test: ${PROG}_test @for f in ${.ALLSRC}; do ./$$f -t ${.CURDIR}/testdata; done ${PROG}_test: ${OBJS:Nmain.o} ${TEST_OBJS} ${CXX} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} -o $@ $> ${LDADD} ${TEST_LDADD} Index: head/devel/android-tools-simpleperf/files/patch-llvm6 =================================================================== --- head/devel/android-tools-simpleperf/files/patch-llvm6 (nonexistent) +++ head/devel/android-tools-simpleperf/files/patch-llvm6 (revision 461279) @@ -0,0 +1,72 @@ +read_elf.cpp:170:56: error: no member named 'getError' in + 'llvm::Expected > + >' + << "] is not a binary file: " << binary_or_err.getError().message(); + ~~~~~~~~~~~~~ ^ +read_elf.cpp:105:37: error: no member named 'section_begin' in + 'llvm::object::ELFFile >' + for (auto section_iterator = elf->section_begin(); section_iterator != elf->section_end(); + ~~~ ^ +read_elf.cpp:316:23: error: no member named 'program_header_begin' in + 'llvm::object::ELFFile >' + for (auto it = elf->program_header_begin(); it != elf->program_header_end(); ++it) { + ~~~ ^ + +--- simpleperf/read_elf.cpp.orig 2017-01-06 00:19:41 UTC ++++ simpleperf/read_elf.cpp +@@ -102,11 +102,19 @@ bool GetBuildIdFromNoteFile(const std::string& filenam + + template + bool GetBuildIdFromELFFile(const llvm::object::ELFFile* elf, BuildId* build_id) { ++#if LLVM_VERSION_MAJOR < 4 + for (auto section_iterator = elf->section_begin(); section_iterator != elf->section_end(); ++#else ++ for (auto section_iterator = elf->sections()->begin(); section_iterator != elf->sections()->end(); ++#endif + ++section_iterator) { + if (section_iterator->sh_type == llvm::ELF::SHT_NOTE) { + auto contents = elf->getSectionContents(&*section_iterator); ++#if LLVM_VERSION_MAJOR < 4 + if (contents.getError()) { ++#else ++ if (!contents) { ++#endif + LOG(DEBUG) << "read note section error"; + continue; + } +@@ -167,7 +175,11 @@ static BinaryRet OpenObjectFile(const std::string& fil + auto binary_or_err = llvm::object::createBinary(buffer_or_err.get()->getMemBufferRef()); + if (!binary_or_err) { + LOG(ERROR) << filename << " [" << file_offset << "-" << (file_offset + file_size) ++#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR < 39 + << "] is not a binary file: " << binary_or_err.getError().message(); ++#else ++ << "] is not a binary file: " << errorToErrorCode(binary_or_err.takeError()).message(); ++#endif + return ret; + } + ret.binary = llvm::object::OwningBinary(std::move(binary_or_err.get()), +@@ -313,7 +325,11 @@ template + bool ReadMinExecutableVirtualAddress(const llvm::object::ELFFile* elf, uint64_t* p_vaddr) { + bool has_vaddr = false; + uint64_t min_addr = std::numeric_limits::max(); ++#if LLVM_VERSION_MAJOR < 4 + for (auto it = elf->program_header_begin(); it != elf->program_header_end(); ++it) { ++#else ++ for (auto it = elf->program_headers()->begin(); it != elf->program_headers()->end(); ++it) { ++#endif + if ((it->p_type == llvm::ELF::PT_LOAD) && (it->p_flags & llvm::ELF::PF_X)) { + if (it->p_vaddr < min_addr) { + min_addr = it->p_vaddr; +@@ -357,7 +373,11 @@ bool ReadMinExecutableVirtualAddressFromElfFile(const + template + bool ReadSectionFromELFFile(const llvm::object::ELFFile* elf, const std::string& section_name, + std::string* content) { ++#if LLVM_VERSION_MAJOR < 4 + for (auto it = elf->section_begin(); it != elf->section_end(); ++it) { ++#else ++ for (auto it = elf->sections()->begin(); it != elf->sections()->end(); ++it) { ++#endif + auto name_or_err = elf->getSectionName(&*it); + if (name_or_err && *name_or_err == section_name) { + auto data_or_err = elf->getSectionContents(&*it); Property changes on: head/devel/android-tools-simpleperf/files/patch-llvm6 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property