Github messages for voidlinux
 help / color / mirror / Atom feed
From: ndowens <ndowens@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] scanmem: fix cross-build
Date: Sat, 02 Jan 2021 02:55:07 +0100	[thread overview]
Message-ID: <20210102015507.KoS_-zxwn_QOASiQPhzRsXQ2cOH0nRTBBu1fLvH2toY@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-27590@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

There is an updated pull request by ndowens against master on the void-packages repository

https://github.com/ndowens/void-packages scanmem
https://github.com/void-linux/void-packages/pull/27590

scanmem: fix cross-build


A patch file from https://github.com/void-linux/void-packages/pull/27590.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-scanmem-27590.patch --]
[-- Type: text/x-diff, Size: 4034 bytes --]

From 827a80ee5321a2ad041490a606542b4da1ab6a0a Mon Sep 17 00:00:00 2001
From: Nathan Owens <ndowens@artixlinux.org>
Date: Fri, 1 Jan 2021 18:20:47 -0600
Subject: [PATCH] scanmem: fix cross-build

---
 srcpkgs/scanmem/patches/0001-fix-cross.patch | 40 +++++++++++++++++++
 srcpkgs/scanmem/patches/fix-musl-test.patch  | 41 ++++++++++++++++++++
 srcpkgs/scanmem/template                     |  4 +-
 3 files changed, 84 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/scanmem/patches/0001-fix-cross.patch
 create mode 100644 srcpkgs/scanmem/patches/fix-musl-test.patch

diff --git a/srcpkgs/scanmem/patches/0001-fix-cross.patch b/srcpkgs/scanmem/patches/0001-fix-cross.patch
new file mode 100644
index 00000000000..45928788fe4
--- /dev/null
+++ b/srcpkgs/scanmem/patches/0001-fix-cross.patch
@@ -0,0 +1,40 @@
+From e068785581d8b775e018ecbb000646c8cdeb6063 Mon Sep 17 00:00:00 2001
+From: Nathan Owens <ndowens@artixlinux.org>
+Date: Fri, 1 Jan 2021 19:34:45 -0600
+Subject: [PATCH] fix cross
+
+---
+ configure.ac | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git configure.ac configure.ac
+index 5b8bac3..5d2ce28 100644
+--- configure.ac
++++ configure.ac
+@@ -58,7 +58,12 @@ case "$host_os" in
+     ;;
+ esac
+ 
++AC_ARG_ENABLE([procmem], [AS_HELP_STRING([--disable-procmem],
++	[forcefully disable proc/pid/mem support])])
++
+ AS_IF([test "x$android" = "xno"], [
++  AS_IF([test "x$enable_procmem" != "xno"],
++	[
+   # also need to check if the file is zero'ed (some hardened systems)
+   AC_CHECK_FILE([/proc/self/maps], [], [
+     echo "This system does not seem to have /proc/pid/maps files."
+@@ -75,7 +80,9 @@ AS_IF([test "x$android" = "xno"], [
+     echo "This system does not seem to have /proc/pid/mem files."
+     echo "Falling back to ptrace() only support."
+     AC_DEFINE(HAVE_PROCMEM, [0], [Enable /proc/pid/mem support])
+-  ])
++  ])],
++	[AC_DEFINE(HAVE_PROCMEM, [0], [Disable /proc/pid/mem support])]
++	)
+   # malloc optimizations without Android
+   AC_FUNC_MALLOC
+   AC_FUNC_REALLOC
+-- 
+2.30.0
+
diff --git a/srcpkgs/scanmem/patches/fix-musl-test.patch b/srcpkgs/scanmem/patches/fix-musl-test.patch
new file mode 100644
index 00000000000..43f6a338a4c
--- /dev/null
+++ b/srcpkgs/scanmem/patches/fix-musl-test.patch
@@ -0,0 +1,41 @@
+From e5781feb4403e7f2de19f7c027cda5e5ef092a5c Mon Sep 17 00:00:00 2001
+From: Nathan Owens <ndowens@artixlinux.org>
+Date: Fri, 1 Jan 2021 15:46:05 -0600
+Subject: [PATCH] fix test for musl
+
+---
+ test/memfake.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git test/memfake.c test/memfake.c
+index 1c4fa94..bc2da8e 100644
+--- test/memfake.c
++++ test/memfake.c
+@@ -22,19 +22,21 @@
+ #include <stdlib.h>
+ #include <time.h>
+ #include <unistd.h>
++#include <assert.h>
+ 
+ int main(int argc, char **argv)
+ {
+-    uint MB_to_allocate = 1;
++    size_t MB_to_allocate = 1;
+     bool add_randomness = false;
+ 
+-    if (argc >= 2) MB_to_allocate = atoi(argv[1]);
+-    if (argc >= 3) add_randomness = atoi(argv[2]);
++    if (argc >= 2) MB_to_allocate = strtoul(argv[1], 0, 10);
++    if (argc >= 3) add_randomness = strtoul(argv[2], 0, 10);
+     if (argc >= 4) return 1;
+ 
+     size_t array_size = MB_to_allocate * 1024 * 1024 / sizeof(int);
+ 
+     int* array = calloc(array_size, sizeof(int));
++    assert(array != NULL);
+ 
+     // Fill half with random values and leave an half of zeroes, if asked to
+     if (add_randomness) {
+-- 
+2.30.0
+
diff --git a/srcpkgs/scanmem/template b/srcpkgs/scanmem/template
index d694f33d372..c8f6f4fe431 100644
--- a/srcpkgs/scanmem/template
+++ b/srcpkgs/scanmem/template
@@ -14,7 +14,9 @@ distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
 checksum=f02054b91322cf41517506158fcb74554e9fc6644e696f8aa25e5acf162d374b
 CFLAGS="-D__NEED_pid_t"
 
-nocross="checking for /proc/self/maps... configure: error"
+if [ "$CROSS_BUILD" ]; then
+	configure_args+=" --disable-procmem"
+fi
 
 pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh

  parent reply	other threads:[~2021-01-02  1:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-01  2:26 [PR PATCH] " ndowens
2021-01-01  2:30 ` ndowens
2021-01-01  2:37 ` [PR PATCH] [Updated] " ndowens
2021-01-01  6:32 ` [PR REVIEW] " sgn
2021-01-01  6:53 ` sgn
2021-01-01 17:34 ` [PR PATCH] [Updated] " ndowens
2021-01-01 21:35 ` ndowens
2021-01-01 21:35 ` [PR PATCH] [Updated] " ndowens
2021-01-01 21:45 ` ndowens
2021-01-01 23:25 ` ndowens
2021-01-02  0:09 ` ndowens
2021-01-02  0:19 ` ndowens
2021-01-02  1:55 ` ndowens [this message]
2021-01-06 11:55 ` [PR REVIEW] " sgn
2021-01-06 11:57 ` sgn
2021-01-06 12:12 ` ndowens
2021-01-06 12:42 ` sgn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210102015507.KoS_-zxwn_QOASiQPhzRsXQ2cOH0nRTBBu1fLvH2toY@z \
    --to=ndowens@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).