From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 17C75158094 for ; Sat, 17 Sep 2022 21:46:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2A1BBE0869; Sat, 17 Sep 2022 21:46:11 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EF1EDE0869 for ; Sat, 17 Sep 2022 21:46:10 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ED9BA340931 for ; Sat, 17 Sep 2022 21:46:09 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4BB9D5D9 for ; Sat, 17 Sep 2022 21:46:08 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1663451155.ee3520b6906c5a46fe56c4bf3b5c26e357dd17a0.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/kcov/, dev-util/kcov/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-util/kcov/files/kcov-40-binutils-2.39.patch dev-util/kcov/files/kcov-40-gcc-13.patch dev-util/kcov/kcov-40.ebuild X-VCS-Directories: dev-util/kcov/ dev-util/kcov/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: ee3520b6906c5a46fe56c4bf3b5c26e357dd17a0 X-VCS-Branch: master Date: Sat, 17 Sep 2022 21:46:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e68f1ab2-0521-4763-a13b-9b155520744b X-Archives-Hash: e5bcc6ebb6bf1a0e297b74f2ba23cdf6 commit: ee3520b6906c5a46fe56c4bf3b5c26e357dd17a0 Author: Sam James gentoo org> AuthorDate: Sat Sep 17 21:45:55 2022 +0000 Commit: Sam James gentoo org> CommitDate: Sat Sep 17 21:45:55 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee3520b6 dev-util/kcov: fix build w/ binutils 2.39 Closes: https://bugs.gentoo.org/868114 Signed-off-by: Sam James gentoo.org> dev-util/kcov/files/kcov-40-binutils-2.39.patch | 92 +++++++++++++++++++++++++ dev-util/kcov/files/kcov-40-gcc-13.patch | 45 ++++++++++++ dev-util/kcov/kcov-40.ebuild | 5 ++ 3 files changed, 142 insertions(+) diff --git a/dev-util/kcov/files/kcov-40-binutils-2.39.patch b/dev-util/kcov/files/kcov-40-binutils-2.39.patch new file mode 100644 index 000000000000..88029305c90f --- /dev/null +++ b/dev-util/kcov/files/kcov-40-binutils-2.39.patch @@ -0,0 +1,92 @@ +https://github.com/SimonKagstrom/kcov/commit/fd1a4fd2f02cee49afd74e427e38c61b89154582 +https://bugs.gentoo.org/868114 + +From fd1a4fd2f02cee49afd74e427e38c61b89154582 Mon Sep 17 00:00:00 2001 +From: oreo639 +Date: Wed, 14 Sep 2022 16:02:17 -0700 +Subject: [PATCH] Fix build with binutils 2.39 + +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -94,6 +94,7 @@ set (DISASSEMBLER_SRCS + ) + + set (HAS_LIBBFD "0") ++set (HAS_LIBBFD_DISASM_STYLED "0") + + if (CMAKE_TARGET_ARCHITECTURES STREQUAL "i386" OR CMAKE_TARGET_ARCHITECTURES STREQUAL "x86_64") + if (LIBBFD_FOUND) +@@ -106,6 +107,23 @@ if (CMAKE_TARGET_ARCHITECTURES STREQUAL "i386" OR CMAKE_TARGET_ARCHITECTURES STR + ${LIBBFD_BFD_LIBRARY} + ${LIBBFD_IBERTY_LIBRARY} + ) ++ include(CheckCSourceCompiles) ++ set(CMAKE_REQUIRED_LIBRARIES ${DISASSEMBLER_LIBRARIES}) ++ check_c_source_compiles(" ++ #define PACKAGE ++ #define PACKAGE_VERSION ++ #include ++ #include ++ ++ int main(int argc, char **argv){ ++ struct disassemble_info info; ++ init_disassemble_info(&info, stdout, NULL, NULL); ++ return 0; ++ } ++ " TEST_LIBBFD_DISASM_STYLED) ++ if (TEST_LIBBFD_DISASM_STYLED) ++ set (HAS_LIBBFD_DISASM_STYLED "1") ++ endif (TEST_LIBBFD_DISASM_STYLED) + endif (LIBBFD_FOUND) + endif (CMAKE_TARGET_ARCHITECTURES STREQUAL "i386" OR CMAKE_TARGET_ARCHITECTURES STREQUAL "x86_64") + +@@ -284,7 +302,7 @@ set (KCOV_SYSTEM_MODE_SRCS + + set (KCOV_LIBRARY_PREFIX "/tmp") + +-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -g -Wall -D_GLIBCXX_USE_NANOSLEEP -DKCOV_LIBRARY_PREFIX=${KCOV_LIBRARY_PREFIX} -DKCOV_HAS_LIBBFD=${HAS_LIBBFD}") ++set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -g -Wall -D_GLIBCXX_USE_NANOSLEEP -DKCOV_LIBRARY_PREFIX=${KCOV_LIBRARY_PREFIX} -DKCOV_HAS_LIBBFD=${HAS_LIBBFD} -DKCOV_LIBFD_DISASM_STYLED=${HAS_LIBBFD_DISASM_STYLED}") + + include_directories( + include/ +--- a/src/parsers/bfd-disassembler.cc ++++ b/src/parsers/bfd-disassembler.cc +@@ -75,7 +75,11 @@ class BfdDisassembler : public IDisassembler + BfdDisassembler() + { + memset(&m_info, 0, sizeof(m_info)); ++#if KCOV_LIBFD_DISASM_STYLED ++ init_disassemble_info(&m_info, (void *)this, BfdDisassembler::opcodesFprintFuncStatic, BfdDisassembler::opcodesFprintStyledFuncStatic); ++#else + init_disassemble_info(&m_info, (void *)this, BfdDisassembler::opcodesFprintFuncStatic); ++#endif + m_disassembler = print_insn_i386; + + m_info.arch = bfd_arch_i386; +@@ -407,6 +411,25 @@ class BfdDisassembler : public IDisassembler + return out; + } + ++#if KCOV_LIBFD_DISASM_STYLED ++ static int opcodesFprintStyledFuncStatic(void *info, enum disassembler_style style, const char *fmt, ...) ++ { ++ (void)style; ++ BfdDisassembler *pThis = (BfdDisassembler *)info; ++ char str[64]; ++ int out; ++ ++ va_list args; ++ va_start (args, fmt); ++ out = vsnprintf( str, sizeof(str) - 1, fmt, args ); ++ va_end (args); ++ ++ pThis->opcodesFprintFunc(str); ++ ++ return out; ++ } ++#endif ++ + typedef std::map SectionCache_t; + typedef std::unordered_map InstructionAddressMap_t; + typedef std::map InstructionOrderedMap_t; + diff --git a/dev-util/kcov/files/kcov-40-gcc-13.patch b/dev-util/kcov/files/kcov-40-gcc-13.patch new file mode 100644 index 000000000000..ea92a6b8364c --- /dev/null +++ b/dev-util/kcov/files/kcov-40-gcc-13.patch @@ -0,0 +1,45 @@ +https://github.com/SimonKagstrom/kcov/commit/b63754b53b3a7cf43e13ec56bd0be76cb6175437 + +From b63754b53b3a7cf43e13ec56bd0be76cb6175437 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Thu, 15 Sep 2022 19:55:21 +0100 +Subject: [PATCH] Fix build on gcc-13: add missing include + +[ 15%] Building CXX object src/CMakeFiles/kcov.dir/writers/cobertura-writer.cc.o +In file included from kcov/src/writers/cobertura-writer.cc:6: +kcov/src/include/reporter.hh:24:90: error: 'uint64_t' has not been declared + 24 | LineExecutionCount(unsigned int hits, unsigned int possibleHits, uint64_t order) : + | ^~~~~~~~ +--- a/src/include/collector.hh ++++ b/src/include/collector.hh +@@ -2,6 +2,8 @@ + + #include + ++#include ++ + namespace kcov + { + class IFileParser; +--- a/src/include/reporter.hh ++++ b/src/include/reporter.hh +@@ -3,6 +3,7 @@ + #include + + #include ++#include + + namespace kcov + { +--- a/src/include/source-file-cache.hh ++++ b/src/include/source-file-cache.hh +@@ -3,6 +3,8 @@ + #include + #include + ++#include ++ + namespace kcov + { + /** + diff --git a/dev-util/kcov/kcov-40.ebuild b/dev-util/kcov/kcov-40.ebuild index 963a9c930a5e..ea10f0c28b26 100644 --- a/dev-util/kcov/kcov-40.ebuild +++ b/dev-util/kcov/kcov-40.ebuild @@ -27,6 +27,11 @@ RDEPEND="dev-libs/elfutils DEPEND="${RDEPEND}" BDEPEND="${PYTHON_DEPS}" +PATCHES=( + "${FILESDIR}"/${P}-binutils-2.39.patch + "${FILESDIR}"/${P}-gcc-13.patch +) + src_configure() { local mycmakeargs=( -DCMAKE_DISABLE_FIND_PACKAGE_Bfd=$(usex !binutils)