sysutils/memtest86+ fails to build with clang.  That can be hacked
around, but the resulting memtest crashes. (For the curious, I'll
append the required changes below.)

memtest86+ builds with gcc4.9, but again, the resulting executable
crashes.

We could use CC=/usr/bin/gcc, but that will likely go away.


Index: patches/patch-Makefile
===================================================================
RCS file: /cvs/ports/sysutils/memtest86+/patches/patch-Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 patch-Makefile
--- patches/patch-Makefile      31 Mar 2015 18:29:51 -0000      1.6
+++ patches/patch-Makefile      27 Jul 2017 18:15:00 -0000
@@ -1,7 +1,8 @@
 $OpenBSD: patch-Makefile,v 1.6 2015/03/31 18:29:51 pascal Exp $
 $RuOBSD: patch-Makefile,v 1.3 2009/02/07 10:28:03 form Exp $
---- Makefile.orig      Sun Jan 23 19:11:04 2011
-+++ Makefile   Tue Mar 31 17:06:38 2015
+Index: Makefile
+--- Makefile.orig
++++ Makefile
 @@ -6,33 +6,47 @@
  #
  # Path for the floppy disk device
@@ -72,7 +73,7 @@ $RuOBSD: patch-Makefile,v 1.3 2009/02/07
  
  test.o: test.c
 -      $(CC) -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin 
-ffreestanding test.c
-+      $(CC) -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin 
-ffreestanding -fno-pie test.c
++      $(CC) -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin 
-ffreestanding -fno-stack-protector -fno-pie test.c
  
  clean:
        rm -f *.o *.s *.iso memtest.bin memtest memtest_shared 
memtest_shared.bin
Index: patches/patch-io_h
===================================================================
RCS file: patches/patch-io_h
diff -N patches/patch-io_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-io_h  27 Jul 2017 18:15:00 -0000
@@ -0,0 +1,32 @@
+$OpenBSD$
+
+Index: io.h
+--- io.h.orig
++++ io.h
+@@ -31,7 +31,7 @@
+  */
+ 
+ #define __OUT1(s,x) \
+-extern inline void __out##s(unsigned x value, unsigned short port) {
++static inline void __out##s(unsigned x value, unsigned short port) {
+ 
+ #define __OUT2(s,s1,s2) \
+ __asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"
+@@ -43,7 +43,7 @@ __OUT1(s##_p,x) __OUT2(s,s1,"w") : : "a" (value), "d" 
+ __OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "id" (port)); SLOW_DOWN_IO; 
}
+ 
+ #define __IN1(s) \
+-extern inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
++static inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
+ 
+ #define __IN2(s,s1,s2) \
+ __asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"
+@@ -55,7 +55,7 @@ __IN1(s##_p) __IN2(s,s1,"w") : "=a" (_v) : "d" (port) 
+ __IN1(s##c_p) __IN2(s,s1,"") : "=a" (_v) : "id" (port) ,##i ); SLOW_DOWN_IO; 
return _v; }
+ 
+ #define __OUTS(s) \
+-extern inline void outs##s(unsigned short port, const void * addr, unsigned 
long count) \
++static inline void outs##s(unsigned short port, const void * addr, unsigned 
long count) \
+ { __asm__ __volatile__ ("cld ; rep ; outs" #s \
+ : "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }
+ 
Index: patches/patch-main_c
===================================================================
RCS file: patches/patch-main_c
diff -N patches/patch-main_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-main_c        27 Jul 2017 18:15:00 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+Index: main.c
+--- main.c.orig
++++ main.c
+@@ -111,6 +111,7 @@ static void __run_at(unsigned long addr)
+       /* Copy memtest86+ code */
+       memmove((void *)addr, &_start, _end - _start);
+       /* Jump to the start address */
++dummy:        p = &&dummy;
+       p = (ulong *)(addr + startup_32 - _start);
+       goto *p;
+ }
-- 
Christian "naddy" Weisgerber                          [email protected]

Reply via email to