summaryrefslogtreecommitdiff
path: root/dev-util/kcov
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-09-18 05:18:37 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-09-18 05:18:37 +0100
commit95a97c3f0b0d048aaf9e183702a1d06b30415b35 (patch)
tree7f438978df863816967d0e1d3d8ee7ab5e3f12ce /dev-util/kcov
parenta0d1bdbd841fa761e38f468e1009cd058af305fd (diff)
gentoo auto-resync : 18:09:2022 - 05:18:37
Diffstat (limited to 'dev-util/kcov')
-rw-r--r--dev-util/kcov/Manifest4
-rw-r--r--dev-util/kcov/files/kcov-40-binutils-2.39.patch92
-rw-r--r--dev-util/kcov/files/kcov-40-gcc-13.patch45
-rw-r--r--dev-util/kcov/kcov-40.ebuild5
4 files changed, 145 insertions, 1 deletions
diff --git a/dev-util/kcov/Manifest b/dev-util/kcov/Manifest
index a508f672d8c3..660329ea0652 100644
--- a/dev-util/kcov/Manifest
+++ b/dev-util/kcov/Manifest
@@ -1,4 +1,6 @@
+AUX kcov-40-binutils-2.39.patch 3139 BLAKE2B 4a296c2b964913df11d4b01a1a0bb732c7d83e83f12fe91837574f4b11df0d28463329430bac2ebc47a47637d068a7711dfaeeb38222e9bdaae954da6004e8c6 SHA512 219c1ec491c3718ebd81601b0680b1adaa86929e331f5827491dee6ed9cedd2f171f59812d97860d0aff53d6b6509382ca9192009f0cba3daac0beacea3185f3
+AUX kcov-40-gcc-13.patch 1219 BLAKE2B 2f0f84e4b468a6ca639f217aa0199bba1e4c516cf02c87839c94436f960f0c14dc11f1396193f0ee3658c8984103f4c249dc99272429f8bf6a1b82f643a55a74 SHA512 ccbd84da7fcda5c373a520c1bc1e7fa68c2db688733d928c01b62c83c24c52c91b333658137783d66db6282d799a7dbd283222931fd0819653fa34e657a879b5
DIST kcov-40.tar.gz 311012 BLAKE2B 19b3cf681fe3c722fde116f454e1760ddd1e54db6fcecc05eca3ec585524fa7d1f7af3ea237943c8a68a81384567205ea443d1542ec380621d35a6f3e3dc667e SHA512 5abe1dd94fbe93fe73d658840593781216b8562a87d010a94d4520e29dd4d537e167de64b7f535347f894c68d5d8b9974ee4b9fd2cebf9291bac4ddbb9ac7cff
-EBUILD kcov-40.ebuild 884 BLAKE2B 2a643de4724d600089bdf702a3381deda85746d29474281acc960da7d63bef0acac555585b68566a42107afbbc00f2eeb0710b7be5d7a7c5a1de96bd3ee8063a SHA512 25204e7a3aef29a44a6fdc340f19d468252d3995259fd42c31d16a8c321db10eaafb1fc4698bfb5d599bdb0119d23d88bbd4f322cfdc706ac31d11cf6f980a41
+EBUILD kcov-40.ebuild 970 BLAKE2B 7d5eb3f61269e236196ca98570b693b1b685b21c1b62cdee9d6de14b137599b0a3e8e166c8d372827628cc7cd6c583e1e1e74f2dbf0f0130c52c400dd442a0af SHA512 379c4f08443224f161bbf5111dfbd7aa0001248ff6d4e15d6d662514069f258a27b1c429da244d78e7a810b3ca90e9616bf0dbac398df1d8fdf676b362f18845
EBUILD kcov-9999.ebuild 810 BLAKE2B 909304207d86faefa228d004256f4ad2cd377a997bb9f8fe2c5efd7a8ea4fb9d67cfee54daa1caa860fb5d612edd6feb1ed8763f6b5e38f93afc4827e6510f39 SHA512 a8a00d4cbec51b1365f19b0acc2b7827bbcca9055899072962cabb4a3711f60e322c12cbcef2245299cc918a70d52a59c5553d20124d32a5e41bc9d2904dca60
MISC metadata.xml 356 BLAKE2B 515935715197c175b5b3a465d58b4eaf433ae23f4d884f3d6e2796662d1f9e0eb507955ff591844b18df76f3422f01ebc73163d17f67d500f8d8560ec862b8fd SHA512 7bcd02ba7e6b3da5207d72f3985fb0ac1fdfe4a8dfc93c74d970137e603dc2626398fc2e145c8c250e28eaa0678ff671cb4f3b3ee4b74807935c19d76d0b5d9d
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 <oreo6391@gmail.com>
+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 <stdio.h>
++ #include <dis-asm.h>
++
++ 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<uint64_t, Section *> SectionCache_t;
+ typedef std::unordered_map<uint64_t, Instruction> InstructionAddressMap_t;
+ typedef std::map<uint64_t, Instruction *> 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 <slyich@gmail.com>
+Date: Thu, 15 Sep 2022 19:55:21 +0100
+Subject: [PATCH] Fix build on gcc-13: add missing <stdint.h> 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 <string>
+
++#include <stdint.h>
++
+ namespace kcov
+ {
+ class IFileParser;
+--- a/src/include/reporter.hh
++++ b/src/include/reporter.hh
+@@ -3,6 +3,7 @@
+ #include <string>
+
+ #include <stddef.h>
++#include <stdint.h>
+
+ namespace kcov
+ {
+--- a/src/include/source-file-cache.hh
++++ b/src/include/source-file-cache.hh
+@@ -3,6 +3,8 @@
+ #include <vector>
+ #include <string>
+
++#include <stdint.h>
++
+ 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)