summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2024-01-26 18:56:18 +0100
committerPiotr Kubaj <pkubaj@FreeBSD.org>2024-01-28 03:32:04 +0100
commit51624c4902617da5d2dee11b390ada2fd61e25b3 (patch)
tree86edfedc75d6d791e1d9f9110334192a08fbb6b4
parentsysutils/rust-coreutils: update to 0.0.24 (diff)
net/drawterm: fix build on powerpc*
arch=`uname -m|sed 's/i.86/386/;s/Power Macintosh/power/; s/x86_64/amd64/'`; (cd posix-$arch && make) cd: posix-powerpc: No such file or directory *** Error code 2
-rw-r--r--net/drawterm/files/patch-Make.freebsd27
-rw-r--r--net/drawterm/files/patch-posix-power_Makefile11
-rw-r--r--net/drawterm/files/patch-posix-power_tas.c27
3 files changed, 45 insertions, 20 deletions
diff --git a/net/drawterm/files/patch-Make.freebsd b/net/drawterm/files/patch-Make.freebsd
index 127a6bbf63bb..245dc6ff6ae1 100644
--- a/net/drawterm/files/patch-Make.freebsd
+++ b/net/drawterm/files/patch-Make.freebsd
@@ -1,22 +1,9 @@
---- Make.freebsd.orig 2023-11-18 06:48:07 UTC
+--- Make.freebsd.orig 2023-09-03 17:22:52 UTC
+++ Make.freebsd
-@@ -1,16 +1,12 @@
- # OpenBSD
- PTHREAD=-pthread
--AR=ar
--AS=as
- RANLIB=ranlib
--X11=/usr/local
--CC=clang
--CFLAGS=-Wall -Wno-missing-braces -ggdb -I$(ROOT) -I$(ROOT)/include -I$(ROOT)/kern -c -I$(X11)/include -D_THREAD_SAFE $(PTHREAD) -O2
-+CFLAGS+=-Wall -Wno-missing-braces -ggdb -I$(ROOT) -I$(ROOT)/include -I$(ROOT)/kern -c -I$(X11)/include -D_THREAD_SAFE $(PTHREAD) -O2
- O=o
- OS=posix
- GUI=x11
--LDADD=-L$(X11)/lib64 -L$(X11)/lib -lX11 -ggdb
--LDFLAGS=$(PTHREAD)
-+LDADD=-lX11 -ggdb
-+LDFLAGS+=$(PTHREAD)
- TARG=drawterm
- AUDIO=unix
+@@ -17,5 +17,5 @@ libmachdep.a:
+ all: default
+ libmachdep.a:
+- arch=`uname -m|sed 's/i.86/386/;s/Power Macintosh/power/; s/x86_64/amd64/'`; \
++ arch=`uname -m|sed 's/i.86/386/;s/powerpc.*/power/; s/x86_64/amd64/'`; \
+ (cd posix-$$arch && make)
diff --git a/net/drawterm/files/patch-posix-power_Makefile b/net/drawterm/files/patch-posix-power_Makefile
new file mode 100644
index 000000000000..b38d8ad01923
--- /dev/null
+++ b/net/drawterm/files/patch-posix-power_Makefile
@@ -0,0 +1,11 @@
+--- posix-power/Makefile.orig 2023-09-03 17:22:52 UTC
++++ posix-power/Makefile
+@@ -2,8 +2,6 @@ LIB=../libmachdep.a
+ include ../Make.config
+ LIB=../libmachdep.a
+
+-CFLAGS+= -Wa,-mregnames
+-
+ OFILES=\
+ getcallerpc.$O\
+ tas.$O
diff --git a/net/drawterm/files/patch-posix-power_tas.c b/net/drawterm/files/patch-posix-power_tas.c
new file mode 100644
index 000000000000..cb51c07bec77
--- /dev/null
+++ b/net/drawterm/files/patch-posix-power_tas.c
@@ -0,0 +1,27 @@
+--- posix-power/tas.c.orig 2024-01-26 17:52:14 UTC
++++ posix-power/tas.c
+@@ -15,16 +15,16 @@ tas(int *x)
+ * r4 (x) and r5 (temp).
+ */
+ __asm__("\n sync\n"
+- " li r0,0\n"
+- " mr r4,%1 /* &l->val */\n"
+- " lis r5,0xdead /* assemble constant 0xdeaddead */\n"
+- " ori r5,r5,0xdead /* \" */\n"
++ " li 0,0\n"
++ " mr 4,%1 /* &l->val */\n"
++ " lis 5,0xdead /* assemble constant 0xdeaddead */\n"
++ " ori 5,5,0xdead /* \" */\n"
+ "tas1:\n"
+- " dcbf r4,r0 /* cache flush; \"fix for 603x bug\" */\n"
+- " lwarx %0,r4,r0 /* v = l->val with reservation */\n"
+- " cmp cr0,0,%0,r0 /* v == 0 */\n"
++ " dcbf 4,0 /* cache flush; \"fix for 603x bug\" */\n"
++ " lwarx %0,4,0 /* v = l->val with reservation */\n"
++ " cmp cr0,0,%0,0 /* v == 0 */\n"
+ " bne tas0\n"
+- " stwcx. r5,r4,r0 /* if (l->val same) l->val = 0xdeaddead */\n"
++ " stwcx. 5,4,0 /* if (l->val same) l->val = 0xdeaddead */\n"
+ " bne tas1\n"
+ "tas0:\n"
+ " sync\n"