From 169386e4c1545cbe28d5c0344a58e047c017b805 Mon Sep 17 00:00:00 2001 From: Evgeny Ermakov 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 + + 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 " 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