public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-util/unicorn/files/, dev-util/unicorn/
@ 2025-02-16  6:32 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2025-02-16  6:32 UTC (permalink / raw
  To: gentoo-commits

commit:     d3dd74e856564aac2414a3fca1fd859961ee162f
Author:     Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
AuthorDate: Sun Oct  8 11:54:40 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 16 06:31:24 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d3dd74e8

dev-util/unicorn: fix modern C issue

Closes: https://bugs.gentoo.org/879685
Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../unicorn-2.0.1-old-style-declaration.patch      |  45 ++++
 .../files/unicorn-2.0.1-strict-prototypes.patch    | 299 +++++++++++++++++++++
 dev-util/unicorn/unicorn-2.0.1-r1.ebuild           |  95 +++++++
 3 files changed, 439 insertions(+)

diff --git a/dev-util/unicorn/files/unicorn-2.0.1-old-style-declaration.patch b/dev-util/unicorn/files/unicorn-2.0.1-old-style-declaration.patch
new file mode 100644
index 000000000000..b63ffee0c096
--- /dev/null
+++ b/dev-util/unicorn/files/unicorn-2.0.1-old-style-declaration.patch
@@ -0,0 +1,45 @@
+commit 9a2583e96710ba49a8fd2a4ab87db7212c1e887c
+Upstream: https://github.com/unicorn-engine/unicorn/pull/1886
+Author: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>
+Date:   Sun Oct 8 13:40:23 2023 +0200
+
+    fix deprecated storage-class declarations
+
+--- a/qemu/accel/tcg/cputlb.c
++++ b/qemu/accel/tcg/cputlb.c
+@@ -1415,7 +1415,7 @@ load_memop(const void *haddr, MemOp op)
+     }
+ }
+ 
+-static uint64_t inline
++static inline uint64_t
+ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
+             uintptr_t retaddr, MemOp op, bool code_read,
+             FullLoadHelper *full_load)
+@@ -1983,7 +1983,7 @@ uint64_t cpu_ldq_data(CPUArchState *env, target_ulong ptr)
+  * Store Helpers
+  */
+ 
+-static void inline
++static inline void
+ store_memop(void *haddr, uint64_t val, MemOp op)
+ {
+     switch (op) {
+@@ -2014,7 +2014,7 @@ store_memop(void *haddr, uint64_t val, MemOp op)
+     }
+ }
+ 
+-static void inline
++static inline void
+ store_helper(CPUArchState *env, target_ulong addr, uint64_t val,
+              TCGMemOpIdx oi, uintptr_t retaddr, MemOp op)
+ {
+@@ -2343,7 +2343,7 @@ void helper_be_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val,
+  * Store Helpers for cpu_ldst.h
+  */
+ 
+-static void inline
++static inline void
+ cpu_store_helper(CPUArchState *env, target_ulong addr, uint64_t val,
+                  int mmu_idx, uintptr_t retaddr, MemOp op) // qq
+ {

diff --git a/dev-util/unicorn/files/unicorn-2.0.1-strict-prototypes.patch b/dev-util/unicorn/files/unicorn-2.0.1-strict-prototypes.patch
new file mode 100644
index 000000000000..d8ae8677d837
--- /dev/null
+++ b/dev-util/unicorn/files/unicorn-2.0.1-strict-prototypes.patch
@@ -0,0 +1,299 @@
+commit 5983b399d84c534ad2f19461dd38f69e70ea9cfb
+Upstream: https://github.com/unicorn-engine/unicorn/pull/1886
+Author: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>
+Date:   Sun Oct 8 13:39:13 2023 +0200
+
+    use full prototypes for functions without parameters
+
+--- a/bindings/ruby/unicorn_gem/ext/unicorn.c
++++ b/bindings/ruby/unicorn_gem/ext/unicorn.c
+@@ -31,7 +31,7 @@ VALUE SavedContext = Qnil;
+ VALUE Hook = Qnil;
+ 
+ 
+-void Init_unicorn_engine() {
++void Init_unicorn_engine(void) {
+     rb_require("unicorn_engine/unicorn_const");
+     UnicornModule = rb_define_module("UnicornEngine");
+     UcError = rb_define_class_under(UnicornModule, "UcError", rb_eStandardError);
+--- a/samples/mem_apis.c
++++ b/samples/mem_apis.c
+@@ -193,7 +193,7 @@ static void do_nx_demo(bool cause_fault)
+     uc_close(uc);
+ }
+ 
+-static void nx_test()
++static void nx_test(void)
+ {
+     printf("NX demo - step 1: show that code runs to completion\n");
+     do_nx_demo(false);
+@@ -276,7 +276,7 @@ static void do_perms_demo(bool change_perms)
+     uc_close(uc);
+ }
+ 
+-static void perms_test()
++static void perms_test(void)
+ {
+     printf("Permissions demo - step 1: show that area is writeable\n");
+     do_perms_demo(false);
+@@ -355,7 +355,7 @@ static void do_unmap_demo(bool do_unmap)
+     uc_close(uc);
+ }
+ 
+-static void unmap_test()
++static void unmap_test(void)
+ {
+     printf("Unmap demo - step 1: show that area is writeable\n");
+     do_unmap_demo(false);
+--- a/samples/sample_arm.c
++++ b/samples/sample_arm.c
+@@ -366,7 +366,7 @@ static void test_thumb_ite_internal(bool step, uint32_t *r2_out,
+     *r3_out = r3;
+ }
+ 
+-static void test_thumb_ite()
++static void test_thumb_ite(void)
+ {
+     uint32_t r2, r3;
+     uint32_t step_r2, step_r3;
+@@ -390,7 +390,7 @@ static void test_thumb_ite()
+     }
+ }
+ 
+-static void test_read_sctlr()
++static void test_read_sctlr(void)
+ {
+     uc_engine *uc;
+     uc_err err;
+--- a/samples/sample_arm64.c
++++ b/samples/sample_arm64.c
+@@ -197,7 +197,7 @@ static void test_arm64eb(void)
+     uc_close(uc);
+ }
+ 
+-static void test_arm64_sctlr()
++static void test_arm64_sctlr(void)
+ {
+     uc_engine *uc;
+     uc_err err;
+@@ -248,7 +248,7 @@ static uint32_t hook_mrs(uc_engine *uc, uc_arm64_reg reg,
+     return 1;
+ }
+ 
+-static void test_arm64_hook_mrs()
++static void test_arm64_hook_mrs(void)
+ {
+     uc_engine *uc;
+     uc_err err;
+--- a/samples/sample_batch_reg.c
++++ b/samples/sample_batch_reg.c
+@@ -49,7 +49,7 @@ void hook_code(uc_engine *uc, uint64_t addr, uint32_t size, void *user_data)
+     printf("HOOK_CODE: 0x%" PRIx64 ", 0x%x\n", addr, size);
+ }
+ 
+-int main()
++int main(void)
+ {
+     int i;
+     uc_hook sys_hook;
+--- a/samples/sample_ctl.c
++++ b/samples/sample_ctl.c
+@@ -79,7 +79,7 @@ static void trace_new_edge(uc_engine *uc, uc_tb *cur, uc_tb *prev, void *data)
+            prev->pc + prev->size - 1, cur->pc);
+ }
+ 
+-void test_uc_ctl_exits()
++void test_uc_ctl_exits(void)
+ {
+     uc_engine *uc;
+     uc_err err;
+@@ -193,7 +193,7 @@ double time_emulation(uc_engine *uc, uint64_t start, uint64_t end)
+     return (t2 - t1) * 1000.0 / CLOCKS_PER_SEC;
+ }
+ 
+-static void test_uc_ctl_tb_cache()
++static void test_uc_ctl_tb_cache(void)
+ {
+     uc_engine *uc;
+     uc_err err;
+--- a/samples/sample_x86.c
++++ b/samples/sample_x86.c
+@@ -1240,7 +1240,7 @@ static void test_i386_invalid_mem_read_in_tb(void)
+     uc_close(uc);
+ }
+ 
+-static void test_i386_smc_xor()
++static void test_i386_smc_xor(void)
+ {
+     uc_engine *uc;
+     uc_err err;
+@@ -1319,7 +1319,7 @@ static void mmio_write_callback(uc_engine *uc, uint64_t offset, unsigned size,
+     return;
+ }
+ 
+-static void test_i386_mmio()
++static void test_i386_mmio(void)
+ {
+     uc_engine *uc;
+     int r_ecx = 0xdeadbeef;
+@@ -1392,7 +1392,7 @@ static bool test_i386_hook_mem_invalid_cb(uc_engine *uc, uc_mem_type type,
+     return true;
+ }
+ 
+-static void test_i386_hook_mem_invalid()
++static void test_i386_hook_mem_invalid(void)
+ {
+     uc_engine *uc;
+     uc_hook hook;
+--- a/samples/sample_x86_32_gdt_and_seg_regs.c
++++ b/samples/sample_x86_32_gdt_and_seg_regs.c
+@@ -163,7 +163,7 @@ static void hex_dump(unsigned char *ptr, unsigned int len)
+ }
+ */
+ 
+-static void gdt_demo()
++static void gdt_demo(void)
+ {
+     uc_engine *uc;
+     uc_hook hook1, hook2;
+--- a/tests/regress/00opcode_uc_crash.c
++++ b/tests/regress/00opcode_uc_crash.c
+@@ -7,7 +7,7 @@
+ #define X86_CODE32 "\x00" // add byte ptr ds:[eax],al
+ #define ADDRESS 0x1000000
+ 
+-static void VM_exec()
++static void VM_exec(void)
+ {
+     uc_engine *uc;
+     uc_err err;
+--- a/tests/regress/arm_enable_vfp.c
++++ b/tests/regress/arm_enable_vfp.c
+@@ -6,7 +6,7 @@
+ #define ADDRESS 0x1000
+ #define ARM_VMOV "\xC0\xEF\x10\x00" // VMOV.I32 D16, #0 ; Vector Move
+ 
+-int main()
++int main(void)
+ {
+     uc_engine *uc;
+     uc_err err;
+--- a/tests/regress/block_test.c
++++ b/tests/regress/block_test.c
+@@ -24,7 +24,7 @@ void cb_hookblock(uc_engine *uc, uint64_t address, uint32_t size, void *user_dat
+    fprintf(stderr, "ok %d - basic block size is correct\n", count++);
+ }
+ 
+-int main() {
++int main(void) {
+    uc_engine *uc;
+ 
+    fprintf(stderr, "# basic block callback test\n");
+--- a/tests/regress/eflags_noset.c
++++ b/tests/regress/eflags_noset.c
+@@ -20,7 +20,7 @@ typedef uint64_t puint;
+ #define PRIX3264 PRIX64
+ #endif
+ 
+-uint32_t realEflags()
++uint32_t realEflags(void)
+ {
+     puint val = 0;
+ 
+@@ -55,7 +55,7 @@ uint32_t realEflags()
+     return (uint32_t)val & 0xFFFFFFFF;
+ }
+ 
+-static void VM_exec()
++static void VM_exec(void)
+ {
+ #if defined(__i386__) || defined(__x86_64__)
+     uc_engine *uc;
+--- a/tests/regress/eflags_nosync.c
++++ b/tests/regress/eflags_nosync.c
+@@ -64,7 +64,7 @@ static bool hook_invalid_mem(uc_engine *uc, uc_mem_type type, uint64_t address,
+     }
+ }
+ 
+-static void VM_exec()
++static void VM_exec(void)
+ {
+     uc_engine *uc;
+     uc_err err;
+--- a/tests/regress/emu_clear_errors.c
++++ b/tests/regress/emu_clear_errors.c
+@@ -38,7 +38,7 @@ bool cb_hookunmapped(uc_engine *uc, uc_mem_type type, uint64_t address, uint32_t
+              "\x56" \
+              "\xFF\x15\x20\x20\x00\x10"
+ 
+-int main() {
++int main(void) {
+    uc_engine *uc;
+ 
+    uc_err err = uc_open(UC_ARCH_X86, UC_MODE_32, &uc);
+--- a/tests/regress/hook_extrainvoke.c
++++ b/tests/regress/hook_extrainvoke.c
+@@ -14,7 +14,7 @@ void hook_ins(uc_engine *uc, uint64_t address, uint32_t size, void *user_data)
+     printf("hook called\n");
+ }
+ 
+-static void VM_exec()
++static void VM_exec(void)
+ {
+     uc_engine *uc;
+     uc_err err;
+--- a/tests/regress/map_crash.c
++++ b/tests/regress/map_crash.c
+@@ -6,7 +6,7 @@
+ #define UC_BUG_WRITE_SIZE 13000
+ #define UC_BUG_WRITE_ADDR 0x1000
+ 
+-int main()
++int main(void)
+ {
+     int size;
+     uint8_t *buf;
+--- a/tests/regress/map_write.c
++++ b/tests/regress/map_write.c
+@@ -6,7 +6,7 @@
+ #define SIZE 1024*64
+ #define OVERFLOW 1
+ 
+-int main()
++int main(void)
+ {
+     uc_engine *uc = NULL;
+     uint8_t *buf = NULL, *buf2 = NULL;
+--- a/tests/regress/mips_kseg0_1.c
++++ b/tests/regress/mips_kseg0_1.c
+@@ -20,7 +20,7 @@
+ 
+ #define MIPS_CODE_EL "\x56\x34\x21\x34" // ori $at, $at, 0x3456;
+ 
+-int main() 
++int main(void)
+ {
+ 
+     uc_engine *uc;
+--- a/tests/regress/sigill.c
++++ b/tests/regress/sigill.c
+@@ -16,7 +16,7 @@ void _interrupt(uc_engine *uc, uint32_t intno, void *user_data)
+     }
+ }
+ 
+-int main()
++int main(void)
+ {
+     int size;
+     uint8_t *buf;
+--- a/tests/regress/sigill2.c
++++ b/tests/regress/sigill2.c
+@@ -6,7 +6,7 @@
+ #define UC_BUG_WRITE_SIZE 128
+ #define UC_BUG_WRITE_ADDR 0x2000
+ 
+-int main()
++int main(void)
+ {
+     int size;
+     uc_engine *uc;

diff --git a/dev-util/unicorn/unicorn-2.0.1-r1.ebuild b/dev-util/unicorn/unicorn-2.0.1-r1.ebuild
new file mode 100644
index 000000000000..ce52142b1b04
--- /dev/null
+++ b/dev-util/unicorn/unicorn-2.0.1-r1.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PV=${PV/_/-}
+
+DISTUTILS_USE_PEP517=setuptools
+DISTUTILS_OPTIONAL=1
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake distutils-r1
+
+DESCRIPTION="A lightweight multi-platform, multi-architecture CPU emulator framework"
+HOMEPAGE="https://www.unicorn-engine.org"
+
+if [[ ${PV} == *9999 ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/unicorn-engine/unicorn"
+else
+	SRC_URI="https://github.com/unicorn-engine/unicorn/archive/${MY_PV}.tar.gz -> ${P}.gh.tar.gz"
+	KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
+fi
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+LICENSE="BSD-2 GPL-2 LGPL-2.1"
+SLOT="0/2"
+IUSE="python static-libs"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+DEPEND="${PYTHON_DEPS}
+	dev-libs/glib:2"
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+BDEPEND="virtual/pkgconfig
+	python? ( ${DISTUTILS_DEPS} )"
+
+UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc s390x tricore"
+
+PATCHES=(
+	"${FILESDIR}/${P}-strict-prototypes.patch"
+	"${FILESDIR}/${P}-old-style-declaration.patch"
+)
+
+# suppress warning wrt 'implicit function declaration' in config logs due to
+# auto-detection of some libc functions (bug #906919)
+QA_CONFIG_IMPL_DECL_SKIP=(
+	clock_adjtime
+	malloc_trim
+)
+
+wrap_python() {
+	if use python; then
+		# src_prepare
+		# Do not compile C extensions
+		export LIBUNICORN_PATH=1
+
+		pushd bindings/python >/dev/null || die
+		distutils-r1_${1} "$@"
+		popd >/dev/null || die
+	fi
+}
+
+src_prepare() {
+	# Build from sources
+	rm -r bindings/python/prebuilt || die "failed to remove prebuilt files"
+
+	cmake_src_prepare
+	wrap_python ${FUNCNAME}
+}
+
+src_configure(){
+	local mycmakeargs=(
+		-DUNICORN_ARCH="${UNICORN_TARGETS// /;}"
+	)
+
+	cmake_src_configure
+
+	wrap_python ${FUNCNAME}
+}
+
+src_compile() {
+	cmake_src_compile
+
+	wrap_python ${FUNCNAME}
+}
+
+src_install() {
+	cmake_src_install
+
+	if ! use static-libs; then
+		find "${ED}" -type f \( -name "*.a" -o -name "*.la" \) -delete || die
+	fi
+
+	wrap_python ${FUNCNAME}
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/unicorn/files/, dev-util/unicorn/
@ 2025-02-19 11:05 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2025-02-19 11:05 UTC (permalink / raw
  To: gentoo-commits

commit:     9d9ee0c5ae72128eb719f28048ab88cb85344965
Author:     Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
AuthorDate: Wed Feb 19 05:52:39 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb 19 11:04:15 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d9ee0c5

dev-util/unicorn: fix build failure on ppc

Closes: https://bugs.gentoo.org/949905
Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/unicorn/files/unicorn-2.1.2-return.patch | 57 +++++++++++++++++++++++
 dev-util/unicorn/unicorn-2.1.2.ebuild             |  4 ++
 2 files changed, 61 insertions(+)

diff --git a/dev-util/unicorn/files/unicorn-2.1.2-return.patch b/dev-util/unicorn/files/unicorn-2.1.2-return.patch
new file mode 100644
index 000000000000..79e5f2f57197
--- /dev/null
+++ b/dev-util/unicorn/files/unicorn-2.1.2-return.patch
@@ -0,0 +1,57 @@
+From d03c0922e6c86741001ff8f40140be37c99eb83a Mon Sep 17 00:00:00 2001
+From: Disconnect3d <dominik.b.czarnota@gmail.com>
+Date: Fri, 14 Feb 2025 18:04:30 +0100
+Subject: [PATCH] Fix #2103: qemu/target/ppc/mem_helper.c remove redundant
+ return statements (#2104)
+Upstream: https://github.com/unicorn-engine/unicorn/pull/2104
+
+--- a/qemu/target/ppc/mem_helper.c
++++ b/qemu/target/ppc/mem_helper.c
+@@ -387,7 +387,6 @@ uint64_t helper_lq_le_parallel(CPUPPCState *env, target_ulong addr,
+     return int128_getlo(ret);
+ #else
+     g_assert_not_reached();
+-    return 0;
+ #endif
+ }
+ 
+@@ -404,7 +403,6 @@ uint64_t helper_lq_be_parallel(CPUPPCState *env, target_ulong addr,
+     return int128_getlo(ret);
+ #else
+     g_assert_not_reached();
+-    return 0;
+ #endif
+ }
+ 
+@@ -420,7 +418,6 @@ void helper_stq_le_parallel(CPUPPCState *env, target_ulong addr,
+     helper_atomic_sto_le_mmu(env, addr, val, opidx, GETPC());
+ #else
+     g_assert_not_reached();
+-    return 0;
+ #endif
+ }
+ 
+@@ -436,7 +433,6 @@ void helper_stq_be_parallel(CPUPPCState *env, target_ulong addr,
+     helper_atomic_sto_be_mmu(env, addr, val, opidx, GETPC());
+ #else
+     g_assert_not_reached();
+-    return 0;
+ #endif
+ }
+ #endif
+@@ -465,7 +461,6 @@ uint32_t helper_stqcx_le_parallel(CPUPPCState *env, target_ulong addr,
+     return env->so + success * CRF_EQ_BIT;
+ #else
+     g_assert_not_reached();
+-    return 0;
+ #endif
+ }
+ 
+@@ -492,7 +487,6 @@ uint32_t helper_stqcx_be_parallel(CPUPPCState *env, target_ulong addr,
+     return env->so + success * CRF_EQ_BIT;
+ #else
+     g_assert_not_reached();
+-    return 0;
+ #endif
+ }
+ 

diff --git a/dev-util/unicorn/unicorn-2.1.2.ebuild b/dev-util/unicorn/unicorn-2.1.2.ebuild
index 6afc0cd70a64..b65c4530a0af 100644
--- a/dev-util/unicorn/unicorn-2.1.2.ebuild
+++ b/dev-util/unicorn/unicorn-2.1.2.ebuild
@@ -39,6 +39,10 @@ RESTRICT="!test? ( test )"
 
 UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc s390x tricore"
 
+PATCHES=(
+	"${FILESDIR}/${PN}-2.1.2-return.patch"
+)
+
 wrap_python() {
 	if use python; then
 		# src_prepare


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/unicorn/files/, dev-util/unicorn/
@ 2025-02-16  9:40 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2025-02-16  9:40 UTC (permalink / raw
  To: gentoo-commits

commit:     ced76873c738bd8b515d7fc4c1799c90d9cc61fd
Author:     Z. Liu <zhixu.liu <AT> gmail <DOT> com>
AuthorDate: Mon Jan 13 11:08:26 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 16 09:39:52 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ced76873

dev-util/unicorn: fix unexpected implicit function declarations

1. patch merged by upstream at https://github.com/unicorn-engine/unicorn/pull/2085
2. malloc_trim is not available for musl only

Closes: https://bugs.gentoo.org/906919
Signed-off-by: Z. Liu <zhixu.liu <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/40116
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../unicorn/files/unicorn-2.0.1-configure.patch    | 34 ++++++++++++++++++++++
 dev-util/unicorn/unicorn-2.0.1-r1.ebuild           | 12 ++++----
 dev-util/unicorn/unicorn-2.0.1.ebuild              | 13 +++++----
 dev-util/unicorn/unicorn-2.1.1.ebuild              | 11 +++----
 dev-util/unicorn/unicorn-9999.ebuild               | 10 ++-----
 5 files changed, 55 insertions(+), 25 deletions(-)

diff --git a/dev-util/unicorn/files/unicorn-2.0.1-configure.patch b/dev-util/unicorn/files/unicorn-2.0.1-configure.patch
new file mode 100644
index 000000000000..57f945e08d37
--- /dev/null
+++ b/dev-util/unicorn/files/unicorn-2.0.1-configure.patch
@@ -0,0 +1,34 @@
+From a78d690da54f3afbd3213502c997ba68b29aa404 Mon Sep 17 00:00:00 2001
+From: "Z. Liu" <zhixu.liu@gmail.com>
+Date: Tue, 14 Jan 2025 08:47:54 +0800
+Subject: [PATCH] configure: add <sys/timex.h> for clock_adjtime on musl
+ (#2085)
+
+for glibc, if _GNU_SOURCE is defined, <time.h> will include <sys/timex.h>
+but not for musl, so add "#include <sys/timex.h>"
+
+although `man clock_adjtime` said "#include <sys/timex.h>", but it won't
+work for glibc w/o "#include <time.h>", I don't known why yet.
+
+PS it seems clock_adjtime is used nowhere?
+
+Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
+---
+ qemu/configure | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/qemu/configure b/qemu/configure
+index db820ca1..47d4a4c6 100755
+--- a/qemu/configure
++++ b/qemu/configure
+@@ -1455,6 +1455,7 @@ fi
+ clock_adjtime=no
+ cat > $TMPC <<EOF
+ #include <time.h>
++#include <sys/timex.h>
+ 
+ int main(void)
+ {
+-- 
+2.45.2
+

diff --git a/dev-util/unicorn/unicorn-2.0.1-r1.ebuild b/dev-util/unicorn/unicorn-2.0.1-r1.ebuild
index ce52142b1b04..43fcd6ebac57 100644
--- a/dev-util/unicorn/unicorn-2.0.1-r1.ebuild
+++ b/dev-util/unicorn/unicorn-2.0.1-r1.ebuild
@@ -37,17 +37,11 @@ BDEPEND="virtual/pkgconfig
 UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc s390x tricore"
 
 PATCHES=(
+	"${FILESDIR}/${PN}-2.0.1-configure.patch"
 	"${FILESDIR}/${P}-strict-prototypes.patch"
 	"${FILESDIR}/${P}-old-style-declaration.patch"
 )
 
-# suppress warning wrt 'implicit function declaration' in config logs due to
-# auto-detection of some libc functions (bug #906919)
-QA_CONFIG_IMPL_DECL_SKIP=(
-	clock_adjtime
-	malloc_trim
-)
-
 wrap_python() {
 	if use python; then
 		# src_prepare
@@ -66,6 +60,10 @@ src_prepare() {
 
 	cmake_src_prepare
 	wrap_python ${FUNCNAME}
+
+	if use elibc_musl ; then
+		QA_CONFIG_IMPL_DECL_SKIP=( malloc_trim )
+	fi
 }
 
 src_configure(){

diff --git a/dev-util/unicorn/unicorn-2.0.1.ebuild b/dev-util/unicorn/unicorn-2.0.1.ebuild
index bc7d5c9c0062..43e298db0e08 100644
--- a/dev-util/unicorn/unicorn-2.0.1.ebuild
+++ b/dev-util/unicorn/unicorn-2.0.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -36,11 +36,8 @@ BDEPEND="virtual/pkgconfig
 
 UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc s390x tricore"
 
-# suppress warning wrt 'implicit function declaration' in config logs due to
-# auto-detection of some libc functions (bug #906919)
-QA_CONFIG_IMPL_DECL_SKIP=(
-	clock_adjtime
-	malloc_trim
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.0.1-configure.patch
 )
 
 wrap_python() {
@@ -61,6 +58,10 @@ src_prepare() {
 
 	cmake_src_prepare
 	wrap_python ${FUNCNAME}
+
+	if use elibc_musl ; then
+		QA_CONFIG_IMPL_DECL_SKIP=( malloc_trim )
+	fi
 }
 
 src_configure(){

diff --git a/dev-util/unicorn/unicorn-2.1.1.ebuild b/dev-util/unicorn/unicorn-2.1.1.ebuild
index 65e1adba73c3..bec4af229dfd 100644
--- a/dev-util/unicorn/unicorn-2.1.1.ebuild
+++ b/dev-util/unicorn/unicorn-2.1.1.ebuild
@@ -36,11 +36,8 @@ BDEPEND="virtual/pkgconfig
 
 UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc s390x tricore"
 
-# suppress warning wrt 'implicit function declaration' in config logs due to
-# auto-detection of some libc functions (bug #906919)
-QA_CONFIG_IMPL_DECL_SKIP=(
-	clock_adjtime
-	malloc_trim
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.0.1-configure.patch
 )
 
 wrap_python() {
@@ -61,6 +58,10 @@ src_prepare() {
 
 	cmake_src_prepare
 	wrap_python ${FUNCNAME}
+
+	if use elibc_musl ; then
+		QA_CONFIG_IMPL_DECL_SKIP=( malloc_trim )
+	fi
 }
 
 src_configure(){

diff --git a/dev-util/unicorn/unicorn-9999.ebuild b/dev-util/unicorn/unicorn-9999.ebuild
index 65e1adba73c3..c5f1b2deb1ce 100644
--- a/dev-util/unicorn/unicorn-9999.ebuild
+++ b/dev-util/unicorn/unicorn-9999.ebuild
@@ -36,13 +36,6 @@ BDEPEND="virtual/pkgconfig
 
 UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc s390x tricore"
 
-# suppress warning wrt 'implicit function declaration' in config logs due to
-# auto-detection of some libc functions (bug #906919)
-QA_CONFIG_IMPL_DECL_SKIP=(
-	clock_adjtime
-	malloc_trim
-)
-
 wrap_python() {
 	if use python; then
 		# src_prepare
@@ -61,6 +54,9 @@ src_prepare() {
 
 	cmake_src_prepare
 	wrap_python ${FUNCNAME}
+	if use elibc_musl ; then
+		QA_CONFIG_IMPL_DECL_SKIP=( malloc_trim )
+	fi
 }
 
 src_configure(){


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/unicorn/files/, dev-util/unicorn/
@ 2023-01-05  5:21 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2023-01-05  5:21 UTC (permalink / raw
  To: gentoo-commits

commit:     c1ac9e2da7946cb98e649a8f56c9ca9bc69dd925
Author:     Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
AuthorDate: Wed Jan  4 20:18:51 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jan  5 05:19:57 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1ac9e2d

dev-util/unicorn: drop 2.0.0

Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/unicorn/Manifest                      |  1 -
 dev-util/unicorn/files/unicorn-2.0.0-lto.patch | 62 ------------------
 dev-util/unicorn/unicorn-2.0.0.ebuild          | 87 --------------------------
 3 files changed, 150 deletions(-)

diff --git a/dev-util/unicorn/Manifest b/dev-util/unicorn/Manifest
index 29cc0380f692..7fc46933a0ac 100644
--- a/dev-util/unicorn/Manifest
+++ b/dev-util/unicorn/Manifest
@@ -1,2 +1 @@
-DIST unicorn-2.0.0.gh.tar.gz 4065595 BLAKE2B c16252a8a4af77c1c76c80101c30b92536d1677f93898acf4711e910dbbe1072715b83b4564c015592465eb51d00333e55849c3e06b07726ea3522286d8429bf SHA512 3996f19755ccdaac6e92a7455160e1c90a592ffb789d55ddc9d1bdcf1e68e8a6150bcfa1025a322780c04878be8de28e0ad5fdd79a7b25887ed2793b769f6789
 DIST unicorn-2.0.1.gh.tar.gz 4070004 BLAKE2B 4ab8f92367e7df5762d29ed58dfff524f59053e28548b170b982d16988eea16df46851d2ea559d8beabb4f1315e5ee627f9ded755a4f3b1cfd6d863a50c633b6 SHA512 4249d33d38614ea1ca51e38c7838cb276306100aa44c65ad1b3e39304e4b856ac643a9c6f9d13678fc07bea58989a08b64653d17afe9e62bcef2936ba63e1b1f

diff --git a/dev-util/unicorn/files/unicorn-2.0.0-lto.patch b/dev-util/unicorn/files/unicorn-2.0.0-lto.patch
deleted file mode 100644
index f6bcda2a18f8..000000000000
--- a/dev-util/unicorn/files/unicorn-2.0.0-lto.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-commit 6d283cf464b82a86f7930e39c91c92ad3cefb58f
-Author: mio <ziqiaokong@outlook.com>
-Date:   Sat Jul 23 20:39:01 2022 +0800
-
-    Fix ppc symbols clash
-
-Bug: https://bugs.gentoo.org/872998
-Bug: https://github.com/unicorn-engine/unicorn/issues/1662
-
-diff --git a/qemu/ppc.h b/qemu/ppc.h
-index 7022629e..eff4b69d 100644
---- a/qemu/ppc.h
-+++ b/qemu/ppc.h
-@@ -1708,4 +1708,12 @@
- #define ppc_dcr_init ppc_dcr_init_ppc
- #define ppc_cpu_pir ppc_cpu_pir_ppc
- #define ppc_irq_reset ppc_irq_reset_ppc
-+#define store_booke_tsr store_booke_tsr_ppc
-+#define get_pteg_offset32 get_pteg_offset32_ppc
-+#define ppc_booke_timers_init ppc_booke_timers_init_ppc
-+#define ppc_hash32_handle_mmu_fault ppc_hash32_handle_mmu_fault_ppc
-+#define gen_helper_store_booke_tsr gen_helper_store_booke_tsr_ppc
-+#define gen_helper_store_booke_tcr gen_helper_store_booke_tcr_ppc
-+#define store_booke_tcr store_booke_tcr_ppc
-+#define ppc_hash32_get_phys_page_debug ppc_hash32_get_phys_page_debug_ppc
- #endif
-diff --git a/qemu/ppc64.h b/qemu/ppc64.h
-index 992caf87..c08ee2d6 100644
---- a/qemu/ppc64.h
-+++ b/qemu/ppc64.h
-@@ -1708,4 +1708,12 @@
- #define ppc_dcr_init ppc_dcr_init_ppc64
- #define ppc_cpu_pir ppc_cpu_pir_ppc64
- #define ppc_irq_reset ppc_irq_reset_ppc64
-+#define store_booke_tsr store_booke_tsr_ppc64
-+#define get_pteg_offset32 get_pteg_offset32_ppc64
-+#define ppc_booke_timers_init ppc_booke_timers_init_ppc64
-+#define ppc_hash32_handle_mmu_fault ppc_hash32_handle_mmu_fault_ppc64
-+#define gen_helper_store_booke_tsr gen_helper_store_booke_tsr_ppc64
-+#define gen_helper_store_booke_tcr gen_helper_store_booke_tcr_ppc64
-+#define store_booke_tcr store_booke_tcr_ppc64
-+#define ppc_hash32_get_phys_page_debug ppc_hash32_get_phys_page_debug_ppc64
- #endif
-diff --git a/symbols.sh b/symbols.sh
-index 2968b959..0d426c00 100755
---- a/symbols.sh
-+++ b/symbols.sh
-@@ -6264,6 +6264,14 @@ ppc_dcr_register \
- ppc_dcr_init \
- ppc_cpu_pir \
- ppc_irq_reset \
-+store_booke_tsr \
-+get_pteg_offset32 \
-+ppc_booke_timers_init \
-+ppc_hash32_handle_mmu_fault \
-+gen_helper_store_booke_tsr \
-+gen_helper_store_booke_tcr \
-+store_booke_tcr \
-+ppc_hash32_get_phys_page_debug \
- "
- 
- ppc64_SYMBOLS=${ppc_SYMBOLS}

diff --git a/dev-util/unicorn/unicorn-2.0.0.ebuild b/dev-util/unicorn/unicorn-2.0.0.ebuild
deleted file mode 100644
index 76a25d55547e..000000000000
--- a/dev-util/unicorn/unicorn-2.0.0.ebuild
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-MY_PV=${PV/_/-}
-
-DISTUTILS_USE_PEP517=setuptools
-DISTUTILS_OPTIONAL=1
-PYTHON_COMPAT=( python3_{8..11} )
-inherit cmake distutils-r1
-
-DESCRIPTION="A lightweight multi-platform, multi-architecture CPU emulator framework"
-HOMEPAGE="https://www.unicorn-engine.org"
-
-if [[ ${PV} == *9999 ]]; then
-	inherit git-r3
-	EGIT_REPO_URI="https://github.com/unicorn-engine/unicorn"
-else
-	SRC_URI="https://github.com/unicorn-engine/unicorn/archive/${MY_PV}.tar.gz -> ${P}.gh.tar.gz"
-	KEYWORDS="amd64 x86"
-fi
-
-S="${WORKDIR}/${PN}-${MY_PV}"
-
-LICENSE="BSD-2 GPL-2 LGPL-2.1"
-SLOT="0/2"
-IUSE="python static-libs"
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-DEPEND="${PYTHON_DEPS}
-	dev-libs/glib:2"
-RDEPEND="python? ( ${PYTHON_DEPS} )"
-BDEPEND="virtual/pkgconfig
-	python? ( ${DISTUTILS_DEPS} )"
-
-PATCHES=(
-	"${FILESDIR}/${P}-lto.patch"
-)
-
-UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc s390x tricore"
-
-wrap_python() {
-	if use python; then
-		# src_prepare
-		# Do not compile C extensions
-		export LIBUNICORN_PATH=1
-
-		pushd bindings/python >/dev/null || die
-		distutils-r1_${1} "$@"
-		popd >/dev/null || die
-	fi
-}
-
-src_prepare() {
-	# Build from sources
-	rm -r bindings/python/prebuilt || die "failed to remove prebuilt files"
-
-	cmake_src_prepare
-	wrap_python ${FUNCNAME}
-}
-
-src_configure(){
-	local mycmakeargs=(
-		-DUNICORN_ARCH="${UNICORN_TARGETS// /;}"
-	)
-
-	cmake_src_configure
-
-	wrap_python ${FUNCNAME}
-}
-
-src_compile() {
-	cmake_src_compile
-
-	wrap_python ${FUNCNAME}
-}
-
-src_install() {
-	cmake_src_install
-
-	if ! use static-libs; then
-		find "${ED}" -type f \( -name "*.a" -o -name "*.la" \) -delete || die
-	fi
-
-	wrap_python ${FUNCNAME}
-}


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/unicorn/files/, dev-util/unicorn/
@ 2022-10-01  3:16 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2022-10-01  3:16 UTC (permalink / raw
  To: gentoo-commits

commit:     57caf57304f4f4568c86886b0498b6707ea747f1
Author:     Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
AuthorDate: Mon Sep 26 21:57:35 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Oct  1 03:15:34 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57caf573

dev-util/unicorn: fix lto type mismatch

Closes: https://bugs.gentoo.org/858506
Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
Closes: https://github.com/gentoo/gentoo/pull/27484
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/unicorn/files/unicorn-2.0.0-lto.patch | 62 ++++++++++++++++++++++++++
 dev-util/unicorn/unicorn-2.0.0.ebuild          |  4 ++
 2 files changed, 66 insertions(+)

diff --git a/dev-util/unicorn/files/unicorn-2.0.0-lto.patch b/dev-util/unicorn/files/unicorn-2.0.0-lto.patch
new file mode 100644
index 000000000000..f6bcda2a18f8
--- /dev/null
+++ b/dev-util/unicorn/files/unicorn-2.0.0-lto.patch
@@ -0,0 +1,62 @@
+commit 6d283cf464b82a86f7930e39c91c92ad3cefb58f
+Author: mio <ziqiaokong@outlook.com>
+Date:   Sat Jul 23 20:39:01 2022 +0800
+
+    Fix ppc symbols clash
+
+Bug: https://bugs.gentoo.org/872998
+Bug: https://github.com/unicorn-engine/unicorn/issues/1662
+
+diff --git a/qemu/ppc.h b/qemu/ppc.h
+index 7022629e..eff4b69d 100644
+--- a/qemu/ppc.h
++++ b/qemu/ppc.h
+@@ -1708,4 +1708,12 @@
+ #define ppc_dcr_init ppc_dcr_init_ppc
+ #define ppc_cpu_pir ppc_cpu_pir_ppc
+ #define ppc_irq_reset ppc_irq_reset_ppc
++#define store_booke_tsr store_booke_tsr_ppc
++#define get_pteg_offset32 get_pteg_offset32_ppc
++#define ppc_booke_timers_init ppc_booke_timers_init_ppc
++#define ppc_hash32_handle_mmu_fault ppc_hash32_handle_mmu_fault_ppc
++#define gen_helper_store_booke_tsr gen_helper_store_booke_tsr_ppc
++#define gen_helper_store_booke_tcr gen_helper_store_booke_tcr_ppc
++#define store_booke_tcr store_booke_tcr_ppc
++#define ppc_hash32_get_phys_page_debug ppc_hash32_get_phys_page_debug_ppc
+ #endif
+diff --git a/qemu/ppc64.h b/qemu/ppc64.h
+index 992caf87..c08ee2d6 100644
+--- a/qemu/ppc64.h
++++ b/qemu/ppc64.h
+@@ -1708,4 +1708,12 @@
+ #define ppc_dcr_init ppc_dcr_init_ppc64
+ #define ppc_cpu_pir ppc_cpu_pir_ppc64
+ #define ppc_irq_reset ppc_irq_reset_ppc64
++#define store_booke_tsr store_booke_tsr_ppc64
++#define get_pteg_offset32 get_pteg_offset32_ppc64
++#define ppc_booke_timers_init ppc_booke_timers_init_ppc64
++#define ppc_hash32_handle_mmu_fault ppc_hash32_handle_mmu_fault_ppc64
++#define gen_helper_store_booke_tsr gen_helper_store_booke_tsr_ppc64
++#define gen_helper_store_booke_tcr gen_helper_store_booke_tcr_ppc64
++#define store_booke_tcr store_booke_tcr_ppc64
++#define ppc_hash32_get_phys_page_debug ppc_hash32_get_phys_page_debug_ppc64
+ #endif
+diff --git a/symbols.sh b/symbols.sh
+index 2968b959..0d426c00 100755
+--- a/symbols.sh
++++ b/symbols.sh
+@@ -6264,6 +6264,14 @@ ppc_dcr_register \
+ ppc_dcr_init \
+ ppc_cpu_pir \
+ ppc_irq_reset \
++store_booke_tsr \
++get_pteg_offset32 \
++ppc_booke_timers_init \
++ppc_hash32_handle_mmu_fault \
++gen_helper_store_booke_tsr \
++gen_helper_store_booke_tcr \
++store_booke_tcr \
++ppc_hash32_get_phys_page_debug \
+ "
+ 
+ ppc64_SYMBOLS=${ppc_SYMBOLS}

diff --git a/dev-util/unicorn/unicorn-2.0.0.ebuild b/dev-util/unicorn/unicorn-2.0.0.ebuild
index b50065f271bc..76a25d55547e 100644
--- a/dev-util/unicorn/unicorn-2.0.0.ebuild
+++ b/dev-util/unicorn/unicorn-2.0.0.ebuild
@@ -34,6 +34,10 @@ RDEPEND="python? ( ${PYTHON_DEPS} )"
 BDEPEND="virtual/pkgconfig
 	python? ( ${DISTUTILS_DEPS} )"
 
+PATCHES=(
+	"${FILESDIR}/${P}-lto.patch"
+)
+
 UNICORN_TARGETS="x86 arm aarch64 riscv mips sparc m68k ppc s390x tricore"
 
 wrap_python() {


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-02-19 11:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-16  6:32 [gentoo-commits] repo/gentoo:master commit in: dev-util/unicorn/files/, dev-util/unicorn/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2025-02-19 11:05 Sam James
2025-02-16  9:40 Sam James
2023-01-05  5:21 Sam James
2022-10-01  3:16 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox