diff options
Diffstat (limited to 'sys-apps/sg3_utils')
-rw-r--r-- | sys-apps/sg3_utils/Manifest | 4 | ||||
-rw-r--r-- | sys-apps/sg3_utils/files/sg3_utils-1.26-stdint.patch | 31 | ||||
-rw-r--r-- | sys-apps/sg3_utils/files/sg3_utils-1.46-musl-drand48-compat.patch | 99 | ||||
-rw-r--r-- | sys-apps/sg3_utils/sg3_utils-1.46-r1.ebuild | 5 |
4 files changed, 104 insertions, 35 deletions
diff --git a/sys-apps/sg3_utils/Manifest b/sys-apps/sg3_utils/Manifest index 47669fcdc426..5187f093bbf8 100644 --- a/sys-apps/sg3_utils/Manifest +++ b/sys-apps/sg3_utils/Manifest @@ -1,4 +1,4 @@ -AUX sg3_utils-1.26-stdint.patch 678 BLAKE2B 52a78fcc176492e6ca5a7a4465e76a3b6642b27c3b6dd77d5d0e8e7f7c59e564cd7e78f2297847db2e0c6b4611284cf5a67973ec9bcc533deab4625381f27d04 SHA512 07f7d46d70f79508169c482bbe251dd4057be4d546ce8ac4b0928ca8708c55086ca2765c78e5f894af1828ff7383ff33b5d354d4c1af9857a9122dfd6fc916fb +AUX sg3_utils-1.46-musl-drand48-compat.patch 4532 BLAKE2B 454837f33c374eb3002a47b441de9d34f57944ce99c26710b44cab010c1a5fdf538e97dfbea5714cb2d4ac5c7fd508fb23a5d835f0932ca6fcec22604dd55e46 SHA512 faba667b6cb4b7b1d6e04ddd7e80073cd5e80dd4ec7b2312c599a5c1c44df4b9ba8394354881a4968625450691587ddb42adec004043ab604f923d5fb643a86b DIST sg3_utils-1.46.tar.xz 1031800 BLAKE2B 034af23d10da49938979ea4d0041c6ce4309b9ceac13f06bd524011dccf285e88fbc5f4c3f261ec3e316db86278ccff235015de43d98b0b62ff05a2f98df0850 SHA512 0b4caab97ccc11fb45e88219e460b37c6ff69b8f3c79e513279aef51783ff22399d141253abdbf55db198db0815bc39d30e9b1e3bd7dda5e15c5f4dae3fe89cf -EBUILD sg3_utils-1.46-r1.ebuild 1066 BLAKE2B 4871a822cc621c43c04838380cc6d4afc1360ecc851414106141c3e676d29fb236b0a7e386af7c629386beeeb8e2dbd15d083fda0deb8464901c0d3ba1e1325c SHA512 fc2717f60f31087fed00be923c0fa7e04a66928093f1a93524de9629a48f1292bcaa4a43599473ac8eb0da86ac6195f7ff5619643f30042a61598f61bf3deeaf +EBUILD sg3_utils-1.46-r1.ebuild 1088 BLAKE2B 632dbbc1dd7e7211967ab167c68564ad7c0ea94ec99f37a9448c30b5c586d437d45ba5f065c1aebd8b1db16ee1ac446bba8c6fc7265f5c9721eb02ad5921b7f2 SHA512 8bcec3a5fe58004ea287cf27b9921f20220af986429a9fb31c2bc6ab9ae7dafea304fd163f9d918070cb2766f3f5d7b5d01465a57cc98f7249947ca6055a43c3 MISC metadata.xml 253 BLAKE2B 295e9d6d93aaa12af413972e1590c67087801cc09c9aa6b59d4606c0f4106d1dacf2baa9858559083b4c6d91beeef218d0729e8593a33788958da6d2897e8ce2 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 diff --git a/sys-apps/sg3_utils/files/sg3_utils-1.26-stdint.patch b/sys-apps/sg3_utils/files/sg3_utils-1.26-stdint.patch deleted file mode 100644 index 62fb30240e10..000000000000 --- a/sys-apps/sg3_utils/files/sg3_utils-1.26-stdint.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Ed Catmur <ed@catmur.co.uk> -Gentoo-Bug: 229653 -X-Gentoo-URL: http://bugs.gentoo.org/show_bug.cgi?id=229653 -X-Gentoo-URL: http://bugs.gentoo.org/attachment.cgi?id=158565&action=view -Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> - -For uint64_t to be available, <stdint.h> must be included: -http://www.opengroup.org/onlinepubs/009695399/basedefs/stdint.h.html - ---- a/include/sg_cmds_basic.h -+++ b/include/sg_cmds_basic.h -@@ -30,6 +30,8 @@ - * - */ - -+#include <stdint.h> -+ - #ifdef __cplusplus - extern "C" { - #endif ---- a/include/sg_cmds_extra.h -+++ b/include/sg_cmds_extra.h -@@ -30,6 +30,8 @@ - * - */ - -+#include <stdint.h> -+ - #ifdef __cplusplus - extern "C" { - #endif diff --git a/sys-apps/sg3_utils/files/sg3_utils-1.46-musl-drand48-compat.patch b/sys-apps/sg3_utils/files/sg3_utils-1.46-musl-drand48-compat.patch new file mode 100644 index 000000000000..d4152c3d2651 --- /dev/null +++ b/sys-apps/sg3_utils/files/sg3_utils-1.46-musl-drand48-compat.patch @@ -0,0 +1,99 @@ +diff -Naurp sg3_utils-1.46.orig/doc/sg_dd.8 sg3_utils-1.46/doc/sg_dd.8 +--- sg3_utils-1.46.orig/doc/sg_dd.8 2021-03-22 00:36:43.000000000 -0400 ++++ sg3_utils-1.46/doc/sg_dd.8 2021-08-16 14:07:16.703526168 -0400 +@@ -394,7 +394,7 @@ random + this flag is only active with \fIiflag=\fR and when given replaces + \fIif=IFILE\fR. If both are given an error is generated. The input will + be a stream of pseudo random bytes. The Linux getrandom(2) system call is +-used to create a seed and thereadter mrand48_r(3) is used to generate a ++used to create a seed and thereadter mrand48(3) is used to generate a + pseudo random sequence, 4 bytes at a time. The quality of the randomness + can be viewed with the ent(1) utility. This is not a high quality random + number generator, it is built for speed, not quality. One application is +diff -Naurp sg3_utils-1.46.orig/src/sg_dd.c sg3_utils-1.46/src/sg_dd.c +--- sg3_utils-1.46.orig/src/sg_dd.c 2021-03-27 20:58:36.000000000 -0400 ++++ sg3_utils-1.46/src/sg_dd.c 2021-08-16 12:56:26.316550042 -0400 +@@ -176,7 +176,6 @@ static uint8_t * free_zeros_buff = NULL; + static int read_long_blk_inc = READ_LONG_DEF_BLK_INC; + + static long seed; +-static struct drand48_data drand;/* opaque, used by srand48_r and mrand48_r */ + + static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio"; + +@@ -2124,7 +2123,7 @@ main(int argc, char * argv[]) + #endif + if (verbose > 1) + pr2serr("seed=%ld\n", seed); +- srand48_r(seed, &drand); ++ srand48(seed); + } else if (iflag.zero) { + ccp = "<zero bytes>"; + cc2p = "00"; +@@ -2401,7 +2400,7 @@ main(int argc, char * argv[]) + for (kk = 0; kk < blocks; ++kk, bp += blk_sz) { + for (j = 0; j < blk_sz; j += jbump) { + /* mrand48 takes uniformly from [-2^31, 2^31) */ +- mrand48_r(&drand, &rn); ++ rn = mrand48(); + *((uint32_t *)(bp + j)) = (uint32_t)rn; + } + } +diff -Naurp sg3_utils-1.46.orig/testing/sgh_dd.cpp sg3_utils-1.46/testing/sgh_dd.cpp +--- sg3_utils-1.46.orig/testing/sgh_dd.cpp 2021-03-28 21:27:17.000000000 -0400 ++++ sg3_utils-1.46/testing/sgh_dd.cpp 2021-08-16 14:06:37.262536902 -0400 +@@ -312,7 +312,6 @@ typedef struct request_element + uint32_t in_mrq_q_blks; + uint32_t out_mrq_q_blks; + long seed; +- struct drand48_data drand; /* opaque, used by srand48_r and mrand48_r */ + pthread_t mrq_abort_thread_id; + Mrq_abort_info mai; + } Rq_elem; +@@ -1491,7 +1490,7 @@ read_write_thread(void * v_tip) + #endif + if (vb > 1) + pr2serr_lk("thread=%d: seed=%ld\n", rep->id, rep->seed); +- srand48_r(rep->seed, &rep->drand); ++ srand48(rep->seed); + } + if (clp->in_flags.same_fds || clp->out_flags.same_fds) + ; +@@ -1804,7 +1803,7 @@ normal_in_rd(Rq_elem * rep, int blocks) + for (k = 0, bp = rep->buffp; k < blocks; ++k, bp += clp->bs) { + for (j = 0; j < clp->bs; j += jbump) { + /* mrand48 takes uniformly from [-2^31, 2^31) */ +- mrand48_r(&rep->drand, &rn); ++ rn = mrand48(); + *((uint32_t *)(bp + j)) = (uint32_t)rn; + } + } +diff -Naurp sg3_utils-1.46.orig/testing/sg_mrq_dd.cpp sg3_utils-1.46/testing/sg_mrq_dd.cpp +--- sg3_utils-1.46.orig/testing/sg_mrq_dd.cpp 2021-03-28 21:27:17.000000000 -0400 ++++ sg3_utils-1.46/testing/sg_mrq_dd.cpp 2021-08-16 14:06:45.842752108 -0400 +@@ -313,7 +313,6 @@ typedef struct request_element + int out_local_partial; + int in_resid_bytes; + long seed; +- struct drand48_data drand; /* opaque, used by srand48_r and mrand48_r */ + } Rq_elem; + + /* Additional parameters for sg_start_io() and sg_finish_io() */ +@@ -1310,7 +1309,7 @@ read_write_thread(struct global_collecti + #endif + if (vb > 1) + pr2serr_lk("[%d] %s: seed=%ld\n", id, __func__, rep->seed); +- srand48_r(rep->seed, &rep->drand); ++ srand48(rep->seed); + } + + if (in_is_sg && clp->infp) { +@@ -1524,7 +1523,7 @@ normal_in_rd(Rq_elem * rep, int64_t lba, + for (k = 0; k < blocks; ++k, bp += clp->bs) { + for (j = 0; j < clp->bs; j += jbump) { + /* mrand48 takes uniformly from [-2^31, 2^31) */ +- mrand48_r(&rep->drand, &rn); ++ rn = mrand48(); + *((uint32_t *)(bp + j)) = (uint32_t)rn; + } + } diff --git a/sys-apps/sg3_utils/sg3_utils-1.46-r1.ebuild b/sys-apps/sg3_utils/sg3_utils-1.46-r1.ebuild index 9a35e645d320..ef1bff372bc5 100644 --- a/sys-apps/sg3_utils/sg3_utils-1.46-r1.ebuild +++ b/sys-apps/sg3_utils/sg3_utils-1.46-r1.ebuild @@ -1,7 +1,7 @@ # Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI="8" inherit multilib @@ -19,7 +19,8 @@ DEPEND="sys-devel/libtool" RDEPEND="!sys-apps/rescan-scsi-bus" PATCHES=( - "${FILESDIR}"/${PN}-1.26-stdint.patch #580236 + # Bug #808600 + "${FILESDIR}"/${PN}-1.46-musl-drand48-compat.patch ) src_configure() { |