From owner-svn-ports-head@freebsd.org Thu Feb 8 22:39:43 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEF04F0B985; Thu, 8 Feb 2018 22:39:43 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AFB882DB0; Thu, 8 Feb 2018 22:39:43 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 734C91C4EC; Thu, 8 Feb 2018 22:39:43 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w18MdhDF005256; Thu, 8 Feb 2018 22:39:43 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18Mdhtx005253; Thu, 8 Feb 2018 22:39:43 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201802082239.w18Mdhtx005253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Thu, 8 Feb 2018 22:39:43 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r461279 - in head/devel/android-tools-simpleperf: . files X-SVN-Group: ports-head X-SVN-Commit-Author: jbeich X-SVN-Commit-Paths: in head/devel/android-tools-simpleperf: . files X-SVN-Commit-Revision: 461279 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Feb 2018 22:39:44 -0000 Author: jbeich Date: Thu Feb 8 22:39:42 2018 New Revision: 461279 URL: https://svnweb.freebsd.org/changeset/ports/461279 Log: devel/android-tools-simpleperf: switch to llvm50 Added: head/devel/android-tools-simpleperf/files/patch-llvm6 (contents, props changed) Modified: head/devel/android-tools-simpleperf/Makefile (contents, props changed) head/devel/android-tools-simpleperf/files/Makefile (contents, props changed) Modified: head/devel/android-tools-simpleperf/Makefile ============================================================================== --- head/devel/android-tools-simpleperf/Makefile Thu Feb 8 22:38:13 2018 (r461278) +++ head/devel/android-tools-simpleperf/Makefile Thu Feb 8 22:39:42 2018 (r461279) @@ -3,7 +3,7 @@ PORTNAME= android-tools-simpleperf DISTVERSIONPREFIX= android- DISTVERSION= 7.1.2_r17 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MAINTAINER= jbeich@FreeBSD.org @@ -30,7 +30,7 @@ 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 Modified: head/devel/android-tools-simpleperf/files/Makefile ============================================================================== --- head/devel/android-tools-simpleperf/files/Makefile Thu Feb 8 22:38:13 2018 (r461278) +++ head/devel/android-tools-simpleperf/files/Makefile Thu Feb 8 22:39:42 2018 (r461279) @@ -89,7 +89,10 @@ TEST_CPPFLAGS+= $$(${GTEST_CONFIG} --cppflags) 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/} Added: head/devel/android-tools-simpleperf/files/patch-llvm6 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/android-tools-simpleperf/files/patch-llvm6 Thu Feb 8 22:39:42 2018 (r461279) @@ -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);