shithub: scc

Download patch

ref: 34c14097cb90fb2deccc3f2ab41b79ca3d7a33d2
parent: 04eaa4bdf25f5d142a47eed13dff69a5cf4497e1
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Sep 18 02:35:54 EDT 2019

[ld] Add basic skeleton for powerpc

This skeleton helps to build poerpc but it acutally does
nothing.

diff: cannot open b/src/cmd/as/target/powerpc//null: file does not exist: 'b/src/cmd/as/target/powerpc//null'
--- a/src/cmd/as/Makefile
+++ b/src/cmd/as/Makefile
@@ -11,10 +11,12 @@
        parser.o \
        expr.o \
 
-TARGET = $(LIBEXEC)/as-amd64 \
-         $(LIBEXEC)/as-i386 \
-         $(LIBEXEC)/as-i286 \
-         $(LIBEXEC)/as-z80 \
+TARGET =\
+	$(LIBEXEC)/as-powerpc\
+	$(LIBEXEC)/as-amd64\
+	$(LIBEXEC)/as-i386\
+	$(LIBEXEC)/as-i286\
+	$(LIBEXEC)/as-z80 \
 
 all: $(TARGET)
 
@@ -25,6 +27,7 @@
 clean:
 	rm -f target/*/*.o target/*/*tbl.c
 
+include target/powerpc.mk
 include target/amd64.mk
 include target/i386.mk
 include target/i286.mk
--- a/src/cmd/as/deps.mk
+++ b/src/cmd/as/deps.mk
@@ -11,6 +11,14 @@
 ./parser.o: ./as.h
 ./symbol.o: $(INCDIR)/scc/scc/scc.h
 ./symbol.o: ./as.h
+./target/powerpc/ins.o: $(INCDIR)/scc/scc/scc.h
+./target/powerpc/ins.o: ./target/powerpc/../../as.h
+./target/powerpc/powerpc.o: $(INCDIR)/scc/scc/scc.h
+./target/powerpc/powerpc.o: ./target/powerpc/../../as.h
+./target/powerpc/powerpc.o: ./target/powerpc/proc.h
+./target/powerpc/powerpctbl.o: $(INCDIR)/scc/scc/scc.h
+./target/powerpc/powerpctbl.o: ./target/powerpc/../../as.h
+./target/powerpc/powerpctbl.o: ./target/powerpc/../powerpc/proc.h
 ./target/x80/ins.o: $(INCDIR)/scc/scc/scc.h
 ./target/x80/ins.o: ./target/x80/../../as.h
 ./target/x80/ins.o: ./target/x80/proc.h
--- /dev/null
+++ b/src/cmd/as/target/powerpc.mk
@@ -1,0 +1,10 @@
+POWERPC_OBJ = $(OBJS) \
+           target/powerpc/powerpctbl.o \
+           target/powerpc/powerpc.o \
+           target/powerpc/ins.o \
+
+target/powerpc/powerpctbl.c: target/powerpc/powerpc.dat target/powerpc/rules.dat
+	./mktbl -f powerpc -c powerpc
+
+$(LIBEXEC)/as-powerpc: $(POWERPC_OBJ)
+	$(CC) $(SCC_LDFLAGS) $(POWERPC_OBJ) -lscc -o $@
--- /dev/null
+++ b/src/cmd/as/target/powerpc/ins.c
@@ -1,0 +1,14 @@
+#include <scc/scc.h>
+
+#include "../../as.h"
+
+int
+match(Op *op, Node **args)
+{
+	return 0;
+}
+
+Node *
+moperand(void)
+{
+}
--- /dev/null
+++ b/src/cmd/as/target/powerpc/powerpc.c
@@ -1,0 +1,15 @@
+#include <stdlib.h>
+
+#include <scc/scc.h>
+
+#include "../../as.h"
+
+TUINT maxaddr = 0xFFFF;
+int endian = LITTLE_ENDIAN;
+int left2right = 0;
+#include "proc.h"
+
+void
+iarch(void)
+{
+}