From 752d6256e5204b958b0ef7905675a940b5e9172f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 12 May 2022 16:42:50 +0300 Subject: gentoo resync : 12.05.2022 --- app-misc/reptyr/Manifest | 3 +- .../files/reptyr-0.8.0-riscv64-support.patch | 115 +++++++++++++++++++++ app-misc/reptyr/reptyr-0.8.0.ebuild | 7 +- 3 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 app-misc/reptyr/files/reptyr-0.8.0-riscv64-support.patch (limited to 'app-misc/reptyr') diff --git a/app-misc/reptyr/Manifest b/app-misc/reptyr/Manifest index 9e12ef8d90bd..c80f35154297 100644 --- a/app-misc/reptyr/Manifest +++ b/app-misc/reptyr/Manifest @@ -1,3 +1,4 @@ +AUX reptyr-0.8.0-riscv64-support.patch 4120 BLAKE2B d7bd33368e97083e2c213be23440bff3f5823a6bc9176c45047ef9db6754c94167e00669837c6060e8a4ee2a5e741b37e70fcf58481aa31f8abbe37d42fe2cb7 SHA512 c281d654bebb3d1c1450ffcca2992c0aceff04daf6d06a1c91ccb886aadb6c0091e0156b04c20139492b2a9c077e194b0f4091f685641b1c6089c2dbc2f82c11 DIST reptyr-0.8.0.tar.gz 32239 BLAKE2B eb3d966c06df710ea27a421bceaca0c91e342cb981567eedc9125e5dd2dc937be294dc212ed9b3021d5e5d75e1011fa4a39eaf93c152c24ef7c5098f8edd9018 SHA512 880d899a2b6df3c33909dc70ce0a58f413b2e2eec2e212abc709348345d48294cf2e39f5891ab4b1fa24e69b54effe99c1b8ab03b448bfd7097e20498e7e85dc -EBUILD reptyr-0.8.0.ebuild 778 BLAKE2B f2200a6dbc2608d9c13d0fa2cfbb895bac5a10a8ef88c2473759428d4eb01e9e80cb7913647165824a078f7a248091df6cea09f0d9f54311698481ca88a87c3a SHA512 f67f248928679d40f713af7889ba3588951cbac47e47693920eeedd6e933ab9fc67a9840d7aab798e226d6d1bc41e0d3899fa0b9c206bacfd277c26909d95866 +EBUILD reptyr-0.8.0.ebuild 876 BLAKE2B 67dbdb76e704f87adef46cb7d7bc5e111e34194965473e4a5bc98b463284ce28187e5fa95c8e7142e6f7958cf007476294e686091eec2d4ee10128f3387eda95 SHA512 307eafc1b4372138576c1595c3a6da6cfe618a9f522b59faa6cee482bd21b3ec02683c4227de2b50e00130adc16bcdc467b39260ca4f4c537bf05d7216336720 MISC metadata.xml 473 BLAKE2B 2022d918552715fde48dc339d09a5e31480b9df7a9724d2275c6a26bb3414eff4a69d199fb04b2df61922d00587ff61028fcb67bde72748600afac8318814f75 SHA512 d8538e25ff5ff782d4d19cbed3417db3aa9ea1589d487025277476832dbae48026e0d36e790d5702dd657a9e0c6fd2173248765c9994f8a27ffdddc5a0291da9 diff --git a/app-misc/reptyr/files/reptyr-0.8.0-riscv64-support.patch b/app-misc/reptyr/files/reptyr-0.8.0-riscv64-support.patch new file mode 100644 index 000000000000..6cedd3a55c5d --- /dev/null +++ b/app-misc/reptyr/files/reptyr-0.8.0-riscv64-support.patch @@ -0,0 +1,115 @@ +Taken from https://github.com/nelhage/reptyr/commit/e26724cc1ae5fe7af0c9fb6369f6cf09d1d12900 + +From ae0b4ec014c1a01b1c3409e5404cf0fa0102c349 Mon Sep 17 00:00:00 2001 +From: Ast-x64 +Date: Wed, 10 Nov 2021 09:39:45 +0800 +Subject: [PATCH] Support riscv64 on Linux. + +--- + platform/linux/arch/riscv64.h | 68 +++++++++++++++++++++++++++++++++++ + platform/linux/linux_ptrace.c | 2 ++ + ptrace.h | 3 ++ + 3 files changed, 73 insertions(+) + create mode 100644 platform/linux/arch/riscv64.h + +diff --git a/platform/linux/arch/riscv64.h b/platform/linux/arch/riscv64.h +new file mode 100644 +index 0000000..96221c3 +--- /dev/null ++++ b/platform/linux/arch/riscv64.h +@@ -0,0 +1,68 @@ ++/* ++ * Copyright (C) 2021 by Ast-x64 ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a copy ++ * of this software and associated documentation files (the "Software"), to deal ++ * in the Software without restriction, including without limitation the rights ++ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ++ * copies of the Software, and to permit persons to whom the Software is ++ * furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in ++ * all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ++ * THE SOFTWARE. ++ */ ++static struct ptrace_personality arch_personality[1] = { ++ { ++ offsetof(struct user_regs_struct, a0), ++ offsetof(struct user_regs_struct, a0), ++ offsetof(struct user_regs_struct, a1), ++ offsetof(struct user_regs_struct, a2), ++ offsetof(struct user_regs_struct, a3), ++ offsetof(struct user_regs_struct, a4), ++ offsetof(struct user_regs_struct, a5), ++ offsetof(struct user_regs_struct, pc), ++ } ++}; ++ ++static inline void arch_fixup_regs(struct ptrace_child *child) { ++ child->regs.pc -= 4; ++} ++ ++static inline int arch_set_syscall(struct ptrace_child *child, ++ unsigned long sysno) { ++ unsigned long x_reg[18]; ++ struct iovec reg_iovec = { ++ .iov_base = x_reg, ++ .iov_len = sizeof(x_reg) ++ }; ++ if (ptrace_command(child, PTRACE_GETREGSET, NT_PRSTATUS, ®_iovec) < 0) ++ return -1; ++ ++ x_reg[17] = sysno; ++ return ptrace_command(child, PTRACE_SETREGSET, NT_PRSTATUS, ®_iovec); ++} ++ ++static inline int arch_save_syscall(struct ptrace_child *child) { ++ unsigned long x_reg[18]; ++ struct iovec reg_iovec = { ++ .iov_base = x_reg, ++ .iov_len = sizeof(x_reg) ++ }; ++ if (ptrace_command(child, PTRACE_GETREGSET, NT_PRSTATUS, ®_iovec) < 0) ++ return -1; ++ ++ child->saved_syscall = x_reg[17]; ++ return 0; ++} ++ ++static inline int arch_restore_syscall(struct ptrace_child *child) { ++ return arch_set_syscall(child, child->saved_syscall); ++} +diff --git a/platform/linux/linux_ptrace.c b/platform/linux/linux_ptrace.c +index d065199..bcbe600 100644 +--- a/platform/linux/linux_ptrace.c ++++ b/platform/linux/linux_ptrace.c +@@ -84,6 +84,8 @@ static struct ptrace_personality *personality(struct ptrace_child *child); + #include "arch/aarch64.h" + #elif defined(__powerpc__) + #include "arch/powerpc.h" ++#elif defined(__riscv) && __riscv_xlen == 64 ++#include "arch/riscv64.h" + #else + #error Unsupported architecture. + #endif +diff --git a/ptrace.h b/ptrace.h +index ee05bd7..8e3a7f4 100644 +--- a/ptrace.h ++++ b/ptrace.h +@@ -25,6 +25,9 @@ + #ifdef __powerpc__ + #include + #endif ++#ifdef __riscv ++#include ++#endif + #include + #include + #include diff --git a/app-misc/reptyr/reptyr-0.8.0.ebuild b/app-misc/reptyr/reptyr-0.8.0.ebuild index 960ac099ad2a..6bfa5e3f6049 100644 --- a/app-misc/reptyr/reptyr-0.8.0.ebuild +++ b/app-misc/reptyr/reptyr-0.8.0.ebuild @@ -11,10 +11,15 @@ SRC_URI="https://github.com/nelhage/${PN}/archive/${P}.tar.gz" LICENSE="MIT" SLOT="0" -KEYWORDS="amd64 ~arm ~arm64 ~ppc64 x86 ~amd64-linux ~x86-linux" +KEYWORDS="amd64 ~arm ~arm64 ~ppc64 ~riscv x86 ~amd64-linux ~x86-linux" RESTRICT="test" +PATCHES=( + # drop on next version bump + "${FILESDIR}"/${PN}-0.8.0-riscv64-support.patch +) + src_prepare() { default # respect CFLAGS -- cgit v1.2.3