Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] memtest86+: fix cross build
@ 2021-03-18 10:50 unspecd
  2021-03-19 18:24 ` [PR REVIEW] " ericonr
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: unspecd @ 2021-03-18 10:50 UTC (permalink / raw)
  To: ml

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

There is a new pull request by unspecd against master on the void-packages repository

https://github.com/unspecd/void-packages pkg/memtest86+
https://github.com/void-linux/void-packages/pull/29562

memtest86+: fix cross build
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [x] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] i686
  - [x] i686-musl
  - [x] x86_64


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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-pkg/memtest86+-29562.patch --]
[-- Type: text/x-diff, Size: 2573 bytes --]

From 169386e4c1545cbe28d5c0344a58e047c017b805 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Mon, 15 Mar 2021 14:53:18 +1100
Subject: [PATCH] memtest86+: fix cross build

---
 .../patches/06.memtest86+-5.01-port-io.patch  | 41 +++++++++++++++++++
 srcpkgs/memtest86+/template                   | 11 ++---
 2 files changed, 45 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/memtest86+/patches/06.memtest86+-5.01-port-io.patch

diff --git a/srcpkgs/memtest86+/patches/06.memtest86+-5.01-port-io.patch b/srcpkgs/memtest86+/patches/06.memtest86+-5.01-port-io.patch
new file mode 100644
index 000000000000..116919ee5f2c
--- /dev/null
+++ b/srcpkgs/memtest86+/patches/06.memtest86+-5.01-port-io.patch
@@ -0,0 +1,41 @@
+--- test.c.orig
++++ test.c
+@@ -14,7 +14,6 @@
+ #include "stdint.h"
+ #include "cpuid.h"
+ #include "smp.h"
+-#include <sys/io.h>
+
+ extern struct cpu_ident cpu_id;
+ extern volatile int    mstr_cpu;
+@@ -29,6 +29,30 @@
+ ulong rand(int me);
+ void poll_errors();
+ 
++static inline unsigned char inb(unsigned short port)
++{
++	unsigned char val;
++	asm volatile ("inb %1,%0" : "=a" (val) : "dN" (port));
++	return val;
++}
++
++static inline unsigned char inb_p(unsigned short int port)
++{
++	unsigned char val;
++	asm volatile ("inb %w1,%0\noutb %%al,$0x80":"=a" (val):"Nd" (port));
++	return val;
++}
++
++static inline void outb(unsigned char val, unsigned short port)
++{
++	asm volatile ("outb %0,%1" : : "a" (val), "dN" (port));
++}
++
++static inline void outb_p(unsigned char val, unsigned short int port)
++{
++	asm volatile ("outb %b0,%w1\noutb %%al,$0x80": :"a" (val),"Nd" (port));
++}
++
+ static inline ulong roundup(ulong value, ulong mask)
+ {
+ 	return (value + mask) & ~mask;
diff --git a/srcpkgs/memtest86+/template b/srcpkgs/memtest86+/template
index c4850769d62e..844f6e9114d7 100644
--- a/srcpkgs/memtest86+/template
+++ b/srcpkgs/memtest86+/template
@@ -1,8 +1,8 @@
 # Template file for 'memtest86+'
 pkgname=memtest86+
 version=5.01
-revision=5
-archs="i686 x86_64"
+revision=6
+archs="i686* x86_64*"
 short_desc="Advanced Memory Diagnostic Tool"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
@@ -13,13 +13,10 @@ checksum=142127b7953fbd829b1057fb64a78d3340c2b771484230a7347e94530a0d9039
 nostrip=yes
 noverifyrdeps=yes
 
-if [ "$XBPS_MACHINE" = "x86_64" ]; then
-	makedepends="gcc-multilib"
-fi
-
 do_build() {
-	make
+	make CC="$CC" LD="$LD"
 }
+
 do_install() {
 	vinstall memtest.bin 755 boot memtest86+
 	vinstall ${FILESDIR}/20_memtest86+ 755 etc/grub.d

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

* Re: [PR REVIEW] memtest86+: fix cross build
  2021-03-18 10:50 [PR PATCH] memtest86+: fix cross build unspecd
@ 2021-03-19 18:24 ` ericonr
  2021-03-19 18:24 ` ericonr
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ericonr @ 2021-03-19 18:24 UTC (permalink / raw)
  To: ml

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

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29562#discussion_r597891313

Comment:
I think instead of cross build you meant musl build?

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

* Re: [PR REVIEW] memtest86+: fix cross build
  2021-03-18 10:50 [PR PATCH] memtest86+: fix cross build unspecd
  2021-03-19 18:24 ` [PR REVIEW] " ericonr
@ 2021-03-19 18:24 ` ericonr
  2021-03-19 18:46 ` unspecd
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ericonr @ 2021-03-19 18:24 UTC (permalink / raw)
  To: ml

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

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29562#discussion_r597891753

Comment:
Why is this patch necessary? Because musl lacks `outb_p` and `inb_p`?

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

* Re: [PR REVIEW] memtest86+: fix cross build
  2021-03-18 10:50 [PR PATCH] memtest86+: fix cross build unspecd
  2021-03-19 18:24 ` [PR REVIEW] " ericonr
  2021-03-19 18:24 ` ericonr
@ 2021-03-19 18:46 ` unspecd
  2021-03-19 18:49 ` unspecd
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: unspecd @ 2021-03-19 18:46 UTC (permalink / raw)
  To: ml

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

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29562#discussion_r597904184

Comment:
Yes, that's right.

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

* Re: [PR REVIEW] memtest86+: fix cross build
  2021-03-18 10:50 [PR PATCH] memtest86+: fix cross build unspecd
                   ` (2 preceding siblings ...)
  2021-03-19 18:46 ` unspecd
@ 2021-03-19 18:49 ` unspecd
  2021-04-04 23:39 ` ericonr
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: unspecd @ 2021-03-19 18:49 UTC (permalink / raw)
  To: ml

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

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29562#discussion_r597905667

Comment:
Yes, well, actually yes...

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

* Re: [PR REVIEW] memtest86+: fix cross build
  2021-03-18 10:50 [PR PATCH] memtest86+: fix cross build unspecd
                   ` (3 preceding siblings ...)
  2021-03-19 18:49 ` unspecd
@ 2021-04-04 23:39 ` ericonr
  2021-04-08  7:49 ` [PR PATCH] [Updated] " unspecd
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ericonr @ 2021-04-04 23:39 UTC (permalink / raw)
  To: ml

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

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29562#discussion_r606867802

Comment:
I'd rather you copy the whole thing from `glibc`, instead of using partly glibc's style and partly musl's.

Please add a comment at the top of the patch explaining that musl doesn't have the `_p` functions.

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

* Re: [PR PATCH] [Updated] memtest86+: fix cross build
  2021-03-18 10:50 [PR PATCH] memtest86+: fix cross build unspecd
                   ` (4 preceding siblings ...)
  2021-04-04 23:39 ` ericonr
@ 2021-04-08  7:49 ` unspecd
  2021-04-08  7:52 ` [PR REVIEW] " unspecd
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: unspecd @ 2021-04-08  7:49 UTC (permalink / raw)
  To: ml

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

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

https://github.com/unspecd/void-packages pkg/memtest86+
https://github.com/void-linux/void-packages/pull/29562

memtest86+: fix cross build
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [x] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] i686
  - [x] i686-musl
  - [x] x86_64


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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-pkg/memtest86+-29562.patch --]
[-- Type: text/x-diff, Size: 2741 bytes --]

From 569a1e4a188433967fcf1ff515d496c051109bc0 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Mon, 15 Mar 2021 14:53:18 +1100
Subject: [PATCH] memtest86+: fix musl build

---
 .../patches/06.memtest86+-5.01-port-io.patch  | 50 +++++++++++++++++++
 srcpkgs/memtest86+/template                   | 11 ++--
 2 files changed, 54 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/memtest86+/patches/06.memtest86+-5.01-port-io.patch

diff --git a/srcpkgs/memtest86+/patches/06.memtest86+-5.01-port-io.patch b/srcpkgs/memtest86+/patches/06.memtest86+-5.01-port-io.patch
new file mode 100644
index 000000000000..f6cf989c6afa
--- /dev/null
+++ b/srcpkgs/memtest86+/patches/06.memtest86+-5.01-port-io.patch
@@ -0,0 +1,50 @@
+musl does not have the `_p` functions, so copy them from glibc.
+
+--- test.c.orig
++++ test.c
+@@ -14,7 +14,6 @@
+ #include "stdint.h"
+ #include "cpuid.h"
+ #include "smp.h"
+-#include <sys/io.h>
+
+ extern struct cpu_ident cpu_id;
+ extern volatile int    mstr_cpu;
+@@ -29,6 +29,37 @@
+ ulong rand(int me);
+ void poll_errors();
+ 
++static __inline unsigned char
++inb (unsigned short int __port)
++{
++  unsigned char _v;
++
++  __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (__port));
++  return _v;
++}
++
++static __inline unsigned char
++inb_p (unsigned short int __port)
++{
++  unsigned char _v;
++
++  __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port));
++  return _v;
++}
++
++static __inline void
++outb (unsigned char __value, unsigned short int __port)
++{
++  __asm__ __volatile__ ("outb %b0,%w1": :"a" (__value), "Nd" (__port));
++}
++
++static __inline void
++outb_p (unsigned char __value, unsigned short int __port)
++{
++  __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (__value),
++			"Nd" (__port));
++}
++
+ static inline ulong roundup(ulong value, ulong mask)
+ {
+ 	return (value + mask) & ~mask;
diff --git a/srcpkgs/memtest86+/template b/srcpkgs/memtest86+/template
index c4850769d62e..844f6e9114d7 100644
--- a/srcpkgs/memtest86+/template
+++ b/srcpkgs/memtest86+/template
@@ -1,8 +1,8 @@
 # Template file for 'memtest86+'
 pkgname=memtest86+
 version=5.01
-revision=5
-archs="i686 x86_64"
+revision=6
+archs="i686* x86_64*"
 short_desc="Advanced Memory Diagnostic Tool"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
@@ -13,13 +13,10 @@ checksum=142127b7953fbd829b1057fb64a78d3340c2b771484230a7347e94530a0d9039
 nostrip=yes
 noverifyrdeps=yes
 
-if [ "$XBPS_MACHINE" = "x86_64" ]; then
-	makedepends="gcc-multilib"
-fi
-
 do_build() {
-	make
+	make CC="$CC" LD="$LD"
 }
+
 do_install() {
 	vinstall memtest.bin 755 boot memtest86+
 	vinstall ${FILESDIR}/20_memtest86+ 755 etc/grub.d

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

* Re: [PR REVIEW] memtest86+: fix cross build
  2021-03-18 10:50 [PR PATCH] memtest86+: fix cross build unspecd
                   ` (5 preceding siblings ...)
  2021-04-08  7:49 ` [PR PATCH] [Updated] " unspecd
@ 2021-04-08  7:52 ` unspecd
  2021-04-09  2:21 ` memtest86+: fix musl build ericonr
  2021-04-14  3:40 ` unspecd
  8 siblings, 0 replies; 10+ messages in thread
From: unspecd @ 2021-04-08  7:52 UTC (permalink / raw)
  To: ml

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

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29562#discussion_r609416237

Comment:
Please check if everything is correct now.

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

* Re: memtest86+: fix musl build
  2021-03-18 10:50 [PR PATCH] memtest86+: fix cross build unspecd
                   ` (6 preceding siblings ...)
  2021-04-08  7:52 ` [PR REVIEW] " unspecd
@ 2021-04-09  2:21 ` ericonr
  2021-04-14  3:40 ` unspecd
  8 siblings, 0 replies; 10+ messages in thread
From: ericonr @ 2021-04-09  2:21 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29562#issuecomment-816354302

Comment:
LGTM, I will try to test the resulting executable. I think it doesn't work on UEFI, right?

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

* Re: memtest86+: fix musl build
  2021-03-18 10:50 [PR PATCH] memtest86+: fix cross build unspecd
                   ` (7 preceding siblings ...)
  2021-04-09  2:21 ` memtest86+: fix musl build ericonr
@ 2021-04-14  3:40 ` unspecd
  8 siblings, 0 replies; 10+ messages in thread
From: unspecd @ 2021-04-14  3:40 UTC (permalink / raw)
  To: ml

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

New comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29562#issuecomment-819205623

Comment:
> I think it doesn't work on UEFI, right?

Yeah... But we can test it with qemu.

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

end of thread, other threads:[~2021-04-14  3:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 10:50 [PR PATCH] memtest86+: fix cross build unspecd
2021-03-19 18:24 ` [PR REVIEW] " ericonr
2021-03-19 18:24 ` ericonr
2021-03-19 18:46 ` unspecd
2021-03-19 18:49 ` unspecd
2021-04-04 23:39 ` ericonr
2021-04-08  7:49 ` [PR PATCH] [Updated] " unspecd
2021-04-08  7:52 ` [PR REVIEW] " unspecd
2021-04-09  2:21 ` memtest86+: fix musl build ericonr
2021-04-14  3:40 ` unspecd

Github messages for voidlinux

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/voidlinux-github

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 voidlinux-github voidlinux-github/ http://inbox.vuxu.org/voidlinux-github \
		voidlinux-github@inbox.vuxu.org
	public-inbox-index voidlinux-github

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.github.voidlinux


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git