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
This commit is contained in:
Piotr Kubaj 2024-01-26 18:56:18 +01:00
parent 1fff8db259
commit 51624c4902
3 changed files with 45 additions and 20 deletions

View File

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

View File

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

View File

@ -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"