Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] scanmem: fix cross-build
@ 2021-01-01  2:26 ndowens
  2021-01-01  2:30 ` ndowens
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: ndowens @ 2021-01-01  2:26 UTC (permalink / raw)
  To: ml

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

There is a new 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: 2122 bytes --]

From 9618c93ef4923855e3da3e1256e0d984e8791935 Mon Sep 17 00:00:00 2001
From: Nathan Owens <ndowens@artixlinux.org>
Date: Thu, 31 Dec 2020 20:27:21 -0600
Subject: [PATCH] scanmem: fix cross-build

---
 srcpkgs/scanmem/patches/0001-fix-cross.patch | 32 ++++++++++++++++++++
 srcpkgs/scanmem/template                     |  2 --
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scanmem/patches/0001-fix-cross.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..a131f9a45fb
--- /dev/null
+++ b/srcpkgs/scanmem/patches/0001-fix-cross.patch
@@ -0,0 +1,32 @@
+From af8bcb8e21ac7f9b97508d6326acd7b1f12982b0 Mon Sep 17 00:00:00 2001
+From: Nathan Owens <ndowens@artixlinux.org>
+Date: Thu, 31 Dec 2020 20:25:35 -0600
+Subject: [PATCH] fix cross
+
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git configure.ac configure.ac
+index 5b8bac3..6cca18f 100644
+--- configure.ac
++++ configure.ac
+@@ -60,13 +60,13 @@ esac
+ 
+ AS_IF([test "x$android" = "xno"], [
+   # also need to check if the file is zero'ed (some hardened systems)
+-  AC_CHECK_FILE([/proc/self/maps], [], [
++  AS_IF([test -f/proc/self/maps], [], [
+     echo "This system does not seem to have /proc/pid/maps files."
+     exit 1
+   ])
+ 
+   # also need to check this file works
+-  AC_CHECK_FILE([/proc/self/mem], [
++  AS_IF([test -f /proc/self/mem], [
+     # LARGEFILE support required for this to work
+     AC_SYS_LARGEFILE
+     AC_DEFINE(HAVE_PROCMEM, [1], [Enable /proc/pid/mem support])
+-- 
+2.30.0
+
diff --git a/srcpkgs/scanmem/template b/srcpkgs/scanmem/template
index d694f33d372..2db4f01e297 100644
--- a/srcpkgs/scanmem/template
+++ b/srcpkgs/scanmem/template
@@ -14,8 +14,6 @@ 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"
-
 pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh
 }

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

* Re: scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
@ 2021-01-01  2:30 ` ndowens
  2021-01-01  2:37 ` [PR PATCH] [Updated] " ndowens
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ndowens @ 2021-01-01  2:30 UTC (permalink / raw)
  To: ml

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

New comment by ndowens on void-packages repository

https://github.com/void-linux/void-packages/pull/27590#issuecomment-753243194

Comment:
Will look at fixing musl check ASAP

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

* Re: [PR PATCH] [Updated] scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
  2021-01-01  2:30 ` ndowens
@ 2021-01-01  2:37 ` ndowens
  2021-01-01  6:32 ` [PR REVIEW] " sgn
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ndowens @ 2021-01-01  2:37 UTC (permalink / raw)
  To: ml

[-- 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: 3104 bytes --]

From 8bb5d074ad6a8eff02990375010acef6a4051641 Mon Sep 17 00:00:00 2001
From: Nathan Owens <ndowens@artixlinux.org>
Date: Thu, 31 Dec 2020 20:27:21 -0600
Subject: [PATCH] scanmem: fix cross-build

---
 srcpkgs/scanmem/patches/0001-fix-cross.patch  | 32 +++++++++++++++++++
 srcpkgs/scanmem/patches/0003--musl-test.patch | 25 +++++++++++++++
 srcpkgs/scanmem/template                      |  2 --
 3 files changed, 57 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scanmem/patches/0001-fix-cross.patch
 create mode 100644 srcpkgs/scanmem/patches/0003--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..a131f9a45fb
--- /dev/null
+++ b/srcpkgs/scanmem/patches/0001-fix-cross.patch
@@ -0,0 +1,32 @@
+From af8bcb8e21ac7f9b97508d6326acd7b1f12982b0 Mon Sep 17 00:00:00 2001
+From: Nathan Owens <ndowens@artixlinux.org>
+Date: Thu, 31 Dec 2020 20:25:35 -0600
+Subject: [PATCH] fix cross
+
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git configure.ac configure.ac
+index 5b8bac3..6cca18f 100644
+--- configure.ac
++++ configure.ac
+@@ -60,13 +60,13 @@ esac
+ 
+ AS_IF([test "x$android" = "xno"], [
+   # also need to check if the file is zero'ed (some hardened systems)
+-  AC_CHECK_FILE([/proc/self/maps], [], [
++  AS_IF([test -f/proc/self/maps], [], [
+     echo "This system does not seem to have /proc/pid/maps files."
+     exit 1
+   ])
+ 
+   # also need to check this file works
+-  AC_CHECK_FILE([/proc/self/mem], [
++  AS_IF([test -f /proc/self/mem], [
+     # LARGEFILE support required for this to work
+     AC_SYS_LARGEFILE
+     AC_DEFINE(HAVE_PROCMEM, [1], [Enable /proc/pid/mem support])
+-- 
+2.30.0
+
diff --git a/srcpkgs/scanmem/patches/0003--musl-test.patch b/srcpkgs/scanmem/patches/0003--musl-test.patch
new file mode 100644
index 00000000000..ceb423d7e0c
--- /dev/null
+++ b/srcpkgs/scanmem/patches/0003--musl-test.patch
@@ -0,0 +1,25 @@
+From 6252f9c2639b6e25af19df7c3b06376fb6e101b6 Mon Sep 17 00:00:00 2001
+From: Nathan Owens <ndowens@artixlinux.org>
+Date: Thu, 31 Dec 2020 20:36:49 -0600
+Subject: [PATCH] musl test
+
+---
+ test/memfake.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git test/memfake.c test/memfake.c
+index 1c4fa94..bf7f319 100644
+--- test/memfake.c
++++ test/memfake.c
+@@ -25,7 +25,7 @@
+ 
+ int main(int argc, char **argv)
+ {
+-    uint MB_to_allocate = 1;
++    int MB_to_allocate = 1;
+     bool add_randomness = false;
+ 
+     if (argc >= 2) MB_to_allocate = atoi(argv[1]);
+-- 
+2.30.0
+
diff --git a/srcpkgs/scanmem/template b/srcpkgs/scanmem/template
index d694f33d372..2db4f01e297 100644
--- a/srcpkgs/scanmem/template
+++ b/srcpkgs/scanmem/template
@@ -14,8 +14,6 @@ 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"
-
 pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh
 }

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

* Re: [PR REVIEW] scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
  2021-01-01  2:30 ` ndowens
  2021-01-01  2:37 ` [PR PATCH] [Updated] " ndowens
@ 2021-01-01  6:32 ` sgn
  2021-01-01  6:53 ` sgn
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: sgn @ 2021-01-01  6:32 UTC (permalink / raw)
  To: ml

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

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/27590#discussion_r550737723

Comment:
This is incorrect.

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

* Re: [PR REVIEW] scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
                   ` (2 preceding siblings ...)
  2021-01-01  6:32 ` [PR REVIEW] " sgn
@ 2021-01-01  6:53 ` sgn
  2021-01-01 17:34 ` [PR PATCH] [Updated] " ndowens
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: sgn @ 2021-01-01  6:53 UTC (permalink / raw)
  To: ml

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

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/27590#discussion_r550737723

Comment:
This is incorrect.

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

* Re: [PR PATCH] [Updated] scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
                   ` (3 preceding siblings ...)
  2021-01-01  6:53 ` sgn
@ 2021-01-01 17:34 ` ndowens
  2021-01-01 21:35 ` ndowens
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ndowens @ 2021-01-01 17:34 UTC (permalink / raw)
  To: ml

[-- 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: 3113 bytes --]

From e8e6a888bd2e640d57114842a4d2eec79bdc3dc6 Mon Sep 17 00:00:00 2001
From: Nathan Owens <ndowens@artixlinux.org>
Date: Thu, 31 Dec 2020 20:27:21 -0600
Subject: [PATCH] scanmem: fix cross-build

---
 srcpkgs/scanmem/patches/0001-fix-cross.patch  | 32 +++++++++++++++++++
 srcpkgs/scanmem/patches/0003--musl-test.patch | 25 +++++++++++++++
 srcpkgs/scanmem/template                      |  2 --
 3 files changed, 57 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scanmem/patches/0001-fix-cross.patch
 create mode 100644 srcpkgs/scanmem/patches/0003--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..a131f9a45fb
--- /dev/null
+++ b/srcpkgs/scanmem/patches/0001-fix-cross.patch
@@ -0,0 +1,32 @@
+From af8bcb8e21ac7f9b97508d6326acd7b1f12982b0 Mon Sep 17 00:00:00 2001
+From: Nathan Owens <ndowens@artixlinux.org>
+Date: Thu, 31 Dec 2020 20:25:35 -0600
+Subject: [PATCH] fix cross
+
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git configure.ac configure.ac
+index 5b8bac3..6cca18f 100644
+--- configure.ac
++++ configure.ac
+@@ -60,13 +60,13 @@ esac
+ 
+ AS_IF([test "x$android" = "xno"], [
+   # also need to check if the file is zero'ed (some hardened systems)
+-  AC_CHECK_FILE([/proc/self/maps], [], [
++  AS_IF([test -f/proc/self/maps], [], [
+     echo "This system does not seem to have /proc/pid/maps files."
+     exit 1
+   ])
+ 
+   # also need to check this file works
+-  AC_CHECK_FILE([/proc/self/mem], [
++  AS_IF([test -f /proc/self/mem], [
+     # LARGEFILE support required for this to work
+     AC_SYS_LARGEFILE
+     AC_DEFINE(HAVE_PROCMEM, [1], [Enable /proc/pid/mem support])
+-- 
+2.30.0
+
diff --git a/srcpkgs/scanmem/patches/0003--musl-test.patch b/srcpkgs/scanmem/patches/0003--musl-test.patch
new file mode 100644
index 00000000000..2187df5cd8a
--- /dev/null
+++ b/srcpkgs/scanmem/patches/0003--musl-test.patch
@@ -0,0 +1,25 @@
+From 6252f9c2639b6e25af19df7c3b06376fb6e101b6 Mon Sep 17 00:00:00 2001
+From: Nathan Owens <ndowens@artixlinux.org>
+Date: Thu, 31 Dec 2020 20:36:49 -0600
+Subject: [PATCH] musl test
+
+---
+ test/memfake.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git test/memfake.c test/memfake.c
+index 1c4fa94..bf7f319 100644
+--- test/memfake.c
++++ test/memfake.c
+@@ -25,7 +25,7 @@
+ 
+ int main(int argc, char **argv)
+ {
+-    uint MB_to_allocate = 1;
++    unsigned int MB_to_allocate = 1;
+     bool add_randomness = false;
+ 
+     if (argc >= 2) MB_to_allocate = atoi(argv[1]);
+-- 
+2.30.0
+
diff --git a/srcpkgs/scanmem/template b/srcpkgs/scanmem/template
index d694f33d372..2db4f01e297 100644
--- a/srcpkgs/scanmem/template
+++ b/srcpkgs/scanmem/template
@@ -14,8 +14,6 @@ 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"
-
 pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh
 }

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

* Re: scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
                   ` (4 preceding siblings ...)
  2021-01-01 17:34 ` [PR PATCH] [Updated] " ndowens
@ 2021-01-01 21:35 ` ndowens
  2021-01-01 21:35 ` [PR PATCH] [Updated] " ndowens
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ndowens @ 2021-01-01 21:35 UTC (permalink / raw)
  To: ml

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

New comment by ndowens on void-packages repository

https://github.com/void-linux/void-packages/pull/27590#issuecomment-753243194

Comment:
Will look at fixing musl check ASAP

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

* Re: [PR PATCH] [Updated] scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
                   ` (5 preceding siblings ...)
  2021-01-01 21:35 ` ndowens
@ 2021-01-01 21:35 ` ndowens
  2021-01-01 21:45 ` ndowens
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ndowens @ 2021-01-01 21:35 UTC (permalink / raw)
  To: ml

[-- 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: 2455 bytes --]

From ac3567dcc9149ebcaed4e1ffba647b775e774b40 Mon Sep 17 00:00:00 2001
From: Nathan Owens <ndowens@artixlinux.org>
Date: Thu, 31 Dec 2020 20:27:21 -0600
Subject: [PATCH] scanmem: fix cross-build

---
 srcpkgs/scanmem/patches/0001-fix-cross.patch | 37 ++++++++++++++++++++
 srcpkgs/scanmem/template                     |  4 ++-
 2 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/scanmem/patches/0001-fix-cross.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..8338537e546
--- /dev/null
+++ b/srcpkgs/scanmem/patches/0001-fix-cross.patch
@@ -0,0 +1,37 @@
+From 42b3c43a88474f818c0d8afa5d4ca2050873b65f Mon Sep 17 00:00:00 2001
+From: Nathan Owens <ndowens@artixlinux.org>
+Date: Fri, 1 Jan 2021 15:32:48 -0600
+Subject: [PATCH] fix cross
+
+---
+ configure.ac | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git configure.ac configure.ac
+index 5b8bac3..740166f 100644
+--- configure.ac
++++ configure.ac
+@@ -57,8 +57,10 @@ case "$host_os" in
+     AC_MSG_NOTICE([Your platform is not currently supported])
+     ;;
+ esac
+-
++AC_ARG_ENABLE([procmem],
++	AS_HELP_STRING([--disable-procmem], [Disable procmem]))		
+ 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."
+@@ -84,7 +86,7 @@ AS_IF([test "x$android" = "xno"], [
+   AC_SYS_LARGEFILE
+   # /proc/pid/mem is there but reading interesting data fails
+   AC_DEFINE(HAVE_PROCMEM, [0], [Enable /proc/pid/mem support])
+-])
++])])
+ 
+ # Check for termcap and readline or bypass checking for the libraries.
+ AC_ARG_WITH([readline], [AS_HELP_STRING([--without-readline],
+-- 
+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

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

* Re: [PR PATCH] [Updated] scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
                   ` (6 preceding siblings ...)
  2021-01-01 21:35 ` [PR PATCH] [Updated] " ndowens
@ 2021-01-01 21:45 ` ndowens
  2021-01-01 23:25 ` ndowens
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ndowens @ 2021-01-01 21:45 UTC (permalink / raw)
  To: ml

[-- 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: 4049 bytes --]

From c2127f55ac70983c62da5c644bcbbfed888d9161 Mon Sep 17 00:00:00 2001
From: Nathan Owens <ndowens@artixlinux.org>
Date: Thu, 31 Dec 2020 20:27:21 -0600
Subject: [PATCH] scanmem: fix cross-build

---
 srcpkgs/scanmem/patches/0001-fix-cross.patch  | 37 +++++++++++++++++
 .../patches/0002-fix-test-for-musl.patch      | 41 +++++++++++++++++++
 srcpkgs/scanmem/template                      |  4 +-
 3 files changed, 81 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/scanmem/patches/0001-fix-cross.patch
 create mode 100644 srcpkgs/scanmem/patches/0002-fix-test-for-musl.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..8338537e546
--- /dev/null
+++ b/srcpkgs/scanmem/patches/0001-fix-cross.patch
@@ -0,0 +1,37 @@
+From 42b3c43a88474f818c0d8afa5d4ca2050873b65f Mon Sep 17 00:00:00 2001
+From: Nathan Owens <ndowens@artixlinux.org>
+Date: Fri, 1 Jan 2021 15:32:48 -0600
+Subject: [PATCH] fix cross
+
+---
+ configure.ac | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git configure.ac configure.ac
+index 5b8bac3..740166f 100644
+--- configure.ac
++++ configure.ac
+@@ -57,8 +57,10 @@ case "$host_os" in
+     AC_MSG_NOTICE([Your platform is not currently supported])
+     ;;
+ esac
+-
++AC_ARG_ENABLE([procmem],
++	AS_HELP_STRING([--disable-procmem], [Disable procmem]))		
+ 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."
+@@ -84,7 +86,7 @@ AS_IF([test "x$android" = "xno"], [
+   AC_SYS_LARGEFILE
+   # /proc/pid/mem is there but reading interesting data fails
+   AC_DEFINE(HAVE_PROCMEM, [0], [Enable /proc/pid/mem support])
+-])
++])])
+ 
+ # Check for termcap and readline or bypass checking for the libraries.
+ AC_ARG_WITH([readline], [AS_HELP_STRING([--without-readline],
+-- 
+2.30.0
+
diff --git a/srcpkgs/scanmem/patches/0002-fix-test-for-musl.patch b/srcpkgs/scanmem/patches/0002-fix-test-for-musl.patch
new file mode 100644
index 00000000000..43f6a338a4c
--- /dev/null
+++ b/srcpkgs/scanmem/patches/0002-fix-test-for-musl.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

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

* Re: [PR PATCH] [Updated] scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
                   ` (7 preceding siblings ...)
  2021-01-01 21:45 ` ndowens
@ 2021-01-01 23:25 ` ndowens
  2021-01-02  0:09 ` ndowens
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ndowens @ 2021-01-01 23:25 UTC (permalink / raw)
  To: ml

[-- 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: 5626 bytes --]

From 6fd1d35880d4a54dab8101acbce39a65e84727bb Mon Sep 17 00:00:00 2001
From: Nathan Owens <ndowens@artixlinux.org>
Date: Thu, 31 Dec 2020 20:27:21 -0600
Subject: [PATCH] scanmem: fix cross-build

Add build option procmem, other than allowing
user to choose if they want to use procmem.
Set to disabled by defaut in case system does not
support procmem.
---
 srcpkgs/scanmem/patches/0001-fix-cross.patch  | 64 +++++++++++++++++++
 .../patches/0002-fix-test-for-musl.patch      | 41 ++++++++++++
 srcpkgs/scanmem/template                      |  7 +-
 3 files changed, 109 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/scanmem/patches/0001-fix-cross.patch
 create mode 100644 srcpkgs/scanmem/patches/0002-fix-test-for-musl.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..3892fae101a
--- /dev/null
+++ b/srcpkgs/scanmem/patches/0001-fix-cross.patch
@@ -0,0 +1,64 @@
+From 74013c948170c6bd13514fe90e7c7937dc422c09 Mon Sep 17 00:00:00 2001
+From: Nathan Owens <ndowens@artixlinux.org>
+Date: Fri, 1 Jan 2021 17:11:02 -0600
+Subject: [PATCH] fix cross
+
+---
+ configure.ac | 41 +++++++++++++----------------------------
+ 1 file changed, 13 insertions(+), 28 deletions(-)
+
+diff --git configure.ac configure.ac
+index 5b8bac3..656d7de 100644
+--- configure.ac
++++ configure.ac
+@@ -57,34 +57,19 @@ case "$host_os" in
+     AC_MSG_NOTICE([Your platform is not currently supported])
+     ;;
+ esac
+-
+-AS_IF([test "x$android" = "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."
+-    exit 1
+-  ])
+-
+-  # also need to check this file works
+-  AC_CHECK_FILE([/proc/self/mem], [
+-    # LARGEFILE support required for this to work
+-    AC_SYS_LARGEFILE
+-    AC_DEFINE(HAVE_PROCMEM, [1], [Enable /proc/pid/mem support])
+-  ],[
+-    # This will hurt performance.
+-    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])
+-  ])
+-  # malloc optimizations without Android
+-  AC_FUNC_MALLOC
+-  AC_FUNC_REALLOC
+-], [
+-  # supported on Android
+-  AC_SYS_LARGEFILE
+-  # /proc/pid/mem is there but reading interesting data fails
+-  AC_DEFINE(HAVE_PROCMEM, [0], [Enable /proc/pid/mem support])
+-])
++AC_ARG_ENABLE(procmem,
++		[AS_HELP_STRING([--enable-procmem], [forcefully enable proc/pid/mem support])])
++
++AS_IF([test "x$android" = "xno"],[
++		AS_IF([test "x$enable_procmem" = "xyes"],[
++					AC_SYS_LARGEFILE
++					AC_DEFINE(HAVE_PROCMEM, [1], [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])],
++				[AC_SYS_LARGEFILE
++				 AC_DEFINE([HAVE_PROCMEM, [0], [Disable /proc/pid/mem support]])])
+ 
+ # Check for termcap and readline or bypass checking for the libraries.
+ AC_ARG_WITH([readline], [AS_HELP_STRING([--without-readline],
+-- 
+2.30.0
+
diff --git a/srcpkgs/scanmem/patches/0002-fix-test-for-musl.patch b/srcpkgs/scanmem/patches/0002-fix-test-for-musl.patch
new file mode 100644
index 00000000000..43f6a338a4c
--- /dev/null
+++ b/srcpkgs/scanmem/patches/0002-fix-test-for-musl.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..8ea73b20c31 100644
--- a/srcpkgs/scanmem/template
+++ b/srcpkgs/scanmem/template
@@ -1,9 +1,9 @@
 # Template file for 'scanmem'
 pkgname=scanmem
 version=0.17
-revision=6
+revision=7
 build_style=gnu-configure
-configure_args="--disable-static --enable-gui"
+configure_args="--disable-static --enable-gui $(vopt_enable procmem)"
 hostmakedepends="automake gettext-devel intltool libtool m4 python"
 makedepends="readline-devel"
 short_desc="Memory scanner designed to isolate the address of an arbitrary var"
@@ -14,7 +14,8 @@ 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"
+build_options="procmem"
+desc_option_procmem="Enable /proc/pid/mem support"
 
 pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh

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

* Re: [PR PATCH] [Updated] scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
                   ` (8 preceding siblings ...)
  2021-01-01 23:25 ` ndowens
@ 2021-01-02  0:09 ` ndowens
  2021-01-02  0:19 ` ndowens
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ndowens @ 2021-01-02  0:09 UTC (permalink / raw)
  To: ml

[-- 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: 5638 bytes --]

From f4b50af4c9bbda43d5396e87f083427f09895965 Mon Sep 17 00:00:00 2001
From: Nathan Owens <ndowens@artixlinux.org>
Date: Thu, 31 Dec 2020 20:27:21 -0600
Subject: [PATCH] scanmem: fix cross-build

Add build option procmem, other than allowing
user to choose if they want to use procmem.
Set to disabled by defaut in case system does not
support procmem.
---
 srcpkgs/scanmem/patches/0001-fix-cross.patch  | 65 +++++++++++++++++++
 .../patches/0002-fix-test-for-musl.patch      | 41 ++++++++++++
 srcpkgs/scanmem/template                      |  7 +-
 3 files changed, 110 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/scanmem/patches/0001-fix-cross.patch
 create mode 100644 srcpkgs/scanmem/patches/0002-fix-test-for-musl.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..f9709415ff1
--- /dev/null
+++ b/srcpkgs/scanmem/patches/0001-fix-cross.patch
@@ -0,0 +1,65 @@
+From 967f6ed071e41a289a49b26ba0f16ee098f13324 Mon Sep 17 00:00:00 2001
+From: Nathan Owens <ndowens@artixlinux.org>
+Date: Fri, 1 Jan 2021 18:08:42 -0600
+Subject: [PATCH] fix cross
+
+---
+ configure.ac | 42 ++++++++++++++----------------------------
+ 1 file changed, 14 insertions(+), 28 deletions(-)
+
+diff --git configure.ac configure.ac
+index 5b8bac3..a82bd00 100644
+--- configure.ac
++++ configure.ac
+@@ -57,34 +57,20 @@ case "$host_os" in
+     AC_MSG_NOTICE([Your platform is not currently supported])
+     ;;
+ esac
+-
+-AS_IF([test "x$android" = "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."
+-    exit 1
+-  ])
+-
+-  # also need to check this file works
+-  AC_CHECK_FILE([/proc/self/mem], [
+-    # LARGEFILE support required for this to work
+-    AC_SYS_LARGEFILE
+-    AC_DEFINE(HAVE_PROCMEM, [1], [Enable /proc/pid/mem support])
+-  ],[
+-    # This will hurt performance.
+-    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])
+-  ])
+-  # malloc optimizations without Android
+-  AC_FUNC_MALLOC
+-  AC_FUNC_REALLOC
+-], [
+-  # supported on Android
+-  AC_SYS_LARGEFILE
+-  # /proc/pid/mem is there but reading interesting data fails
+-  AC_DEFINE(HAVE_PROCMEM, [0], [Enable /proc/pid/mem support])
+-])
++AC_ARG_ENABLE(procmem,
++		[AS_HELP_STRING([--enable-procmem], [forcefully enable proc/pid/mem support])])
++
++AS_IF([test "x$android" = "xno"],[
++		AS_IF([test "x$enable_procmem" = "xyes"],[
++					AC_SYS_LARGEFILE
++					AC_DEFINE(HAVE_PROCMEM, [1], [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],
++				[AC_SYS_LARGEFILE
++				 AC_DEFINE([HAVE_PROCMEM, [0], [Disable /proc/pid/mem support]])])
+ 
+ # Check for termcap and readline or bypass checking for the libraries.
+ AC_ARG_WITH([readline], [AS_HELP_STRING([--without-readline],
+-- 
+2.30.0
+
diff --git a/srcpkgs/scanmem/patches/0002-fix-test-for-musl.patch b/srcpkgs/scanmem/patches/0002-fix-test-for-musl.patch
new file mode 100644
index 00000000000..43f6a338a4c
--- /dev/null
+++ b/srcpkgs/scanmem/patches/0002-fix-test-for-musl.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..8ea73b20c31 100644
--- a/srcpkgs/scanmem/template
+++ b/srcpkgs/scanmem/template
@@ -1,9 +1,9 @@
 # Template file for 'scanmem'
 pkgname=scanmem
 version=0.17
-revision=6
+revision=7
 build_style=gnu-configure
-configure_args="--disable-static --enable-gui"
+configure_args="--disable-static --enable-gui $(vopt_enable procmem)"
 hostmakedepends="automake gettext-devel intltool libtool m4 python"
 makedepends="readline-devel"
 short_desc="Memory scanner designed to isolate the address of an arbitrary var"
@@ -14,7 +14,8 @@ 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"
+build_options="procmem"
+desc_option_procmem="Enable /proc/pid/mem support"
 
 pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh

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

* Re: [PR PATCH] [Updated] scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
                   ` (9 preceding siblings ...)
  2021-01-02  0:09 ` ndowens
@ 2021-01-02  0:19 ` ndowens
  2021-01-02  1:55 ` ndowens
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ndowens @ 2021-01-02  0:19 UTC (permalink / raw)
  To: ml

[-- 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: 4392 bytes --]

From afaba048afc0931512eb50e442ff7e0830b9a5b4 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 | 65 ++++++++++++++++++++
 srcpkgs/scanmem/patches/fix-musl-test.patch  | 41 ++++++++++++
 2 files changed, 106 insertions(+)
 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..f9709415ff1
--- /dev/null
+++ b/srcpkgs/scanmem/patches/0001-fix-cross.patch
@@ -0,0 +1,65 @@
+From 967f6ed071e41a289a49b26ba0f16ee098f13324 Mon Sep 17 00:00:00 2001
+From: Nathan Owens <ndowens@artixlinux.org>
+Date: Fri, 1 Jan 2021 18:08:42 -0600
+Subject: [PATCH] fix cross
+
+---
+ configure.ac | 42 ++++++++++++++----------------------------
+ 1 file changed, 14 insertions(+), 28 deletions(-)
+
+diff --git configure.ac configure.ac
+index 5b8bac3..a82bd00 100644
+--- configure.ac
++++ configure.ac
+@@ -57,34 +57,20 @@ case "$host_os" in
+     AC_MSG_NOTICE([Your platform is not currently supported])
+     ;;
+ esac
+-
+-AS_IF([test "x$android" = "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."
+-    exit 1
+-  ])
+-
+-  # also need to check this file works
+-  AC_CHECK_FILE([/proc/self/mem], [
+-    # LARGEFILE support required for this to work
+-    AC_SYS_LARGEFILE
+-    AC_DEFINE(HAVE_PROCMEM, [1], [Enable /proc/pid/mem support])
+-  ],[
+-    # This will hurt performance.
+-    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])
+-  ])
+-  # malloc optimizations without Android
+-  AC_FUNC_MALLOC
+-  AC_FUNC_REALLOC
+-], [
+-  # supported on Android
+-  AC_SYS_LARGEFILE
+-  # /proc/pid/mem is there but reading interesting data fails
+-  AC_DEFINE(HAVE_PROCMEM, [0], [Enable /proc/pid/mem support])
+-])
++AC_ARG_ENABLE(procmem,
++		[AS_HELP_STRING([--enable-procmem], [forcefully enable proc/pid/mem support])])
++
++AS_IF([test "x$android" = "xno"],[
++		AS_IF([test "x$enable_procmem" = "xyes"],[
++					AC_SYS_LARGEFILE
++					AC_DEFINE(HAVE_PROCMEM, [1], [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],
++				[AC_SYS_LARGEFILE
++				 AC_DEFINE([HAVE_PROCMEM, [0], [Disable /proc/pid/mem support]])])
+ 
+ # Check for termcap and readline or bypass checking for the libraries.
+ AC_ARG_WITH([readline], [AS_HELP_STRING([--without-readline],
+-- 
+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
+

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

* Re: [PR PATCH] [Updated] scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
                   ` (10 preceding siblings ...)
  2021-01-02  0:19 ` ndowens
@ 2021-01-02  1:55 ` ndowens
  2021-01-06 11:55 ` [PR REVIEW] " sgn
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ndowens @ 2021-01-02  1:55 UTC (permalink / raw)
  To: ml

[-- 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

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

* Re: [PR REVIEW] scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
                   ` (11 preceding siblings ...)
  2021-01-02  1:55 ` ndowens
@ 2021-01-06 11:55 ` sgn
  2021-01-06 11:57 ` sgn
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: sgn @ 2021-01-06 11:55 UTC (permalink / raw)
  To: ml

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

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/27590#discussion_r552531212

Comment:
What's wrong with this test?

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

* Re: [PR REVIEW] scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
                   ` (12 preceding siblings ...)
  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
  15 siblings, 0 replies; 17+ messages in thread
From: sgn @ 2021-01-06 11:57 UTC (permalink / raw)
  To: ml

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

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/27590#discussion_r552533516

Comment:
Sorry but I couldn't follow. `/proc/<pid>/mem` is available on all our targets.
I think the correct approach would be add an `AC_CACHE_CHECK` for some value instead https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Caching-Results.html

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

* Re: [PR REVIEW] scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
                   ` (13 preceding siblings ...)
  2021-01-06 11:57 ` sgn
@ 2021-01-06 12:12 ` ndowens
  2021-01-06 12:42 ` sgn
  15 siblings, 0 replies; 17+ messages in thread
From: ndowens @ 2021-01-06 12:12 UTC (permalink / raw)
  To: ml

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

New review comment by ndowens on void-packages repository

https://github.com/void-linux/void-packages/pull/27590#discussion_r552545609

Comment:
Fails on musl because says uint isn’t declared and someone in my Issue upstream recommended it to be written this way, though still waiting for a member of the upstream to comment

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

* Re: [PR REVIEW] scanmem: fix cross-build
  2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build ndowens
                   ` (14 preceding siblings ...)
  2021-01-06 12:12 ` ndowens
@ 2021-01-06 12:42 ` sgn
  15 siblings, 0 replies; 17+ messages in thread
From: sgn @ 2021-01-06 12:42 UTC (permalink / raw)
  To: ml

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

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/27590#discussion_r552570961

Comment:
OK, I see, `atoi(3)` return an `int` instead of `uint`. Change those types to `size_t` is a correct move.
change `add_randomness` to `strtoul` is harmless but not necessary.

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

end of thread, other threads:[~2021-01-06 12:42 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-01  2:26 [PR PATCH] scanmem: fix cross-build 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
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

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).