From 45a950571d539fc8819820882f17c9eb158fdad6 Mon Sep 17 00:00:00 2001 From: David Given Date: Thu, 15 Sep 2016 23:12:03 +0200 Subject: [PATCH] Mostly add support for the experimental and largely broken linuxppc platform. (Doesn't quite build.) --HG-- branch : dtrg-experimental-powerpc-branch --- build.lua | 1 + mach/powerpc/libem/build.lua | 14 ++++++++++++++ mach/powerpc/libend/build.lua | 8 ++++++++ plat/linuxppc/build-pkg.lua | 25 +++++++++++++++++++++++++ plat/linuxppc/build-tools.lua | 21 +++++++++++++++++++++ plat/linuxppc/descr | 24 ++++++++++++------------ plat/linuxppc/include/build.lua | 24 ++++++++++++++++++++++++ plat/linuxppc/libsys/build.lua | 16 ++++++++++++++++ 8 files changed, 121 insertions(+), 12 deletions(-) create mode 100644 mach/powerpc/libem/build.lua create mode 100644 mach/powerpc/libend/build.lua create mode 100644 plat/linuxppc/build-pkg.lua create mode 100644 plat/linuxppc/build-tools.lua create mode 100644 plat/linuxppc/include/build.lua create mode 100644 plat/linuxppc/libsys/build.lua diff --git a/build.lua b/build.lua index b5de879c8..05a4eafcd 100644 --- a/build.lua +++ b/build.lua @@ -8,6 +8,7 @@ vars.plats = { "cpm", "linux386", "linux68k", + "linuxppc", "pc86", "rpi", } diff --git a/mach/powerpc/libem/build.lua b/mach/powerpc/libem/build.lua new file mode 100644 index 000000000..d17adcd92 --- /dev/null +++ b/mach/powerpc/libem/build.lua @@ -0,0 +1,14 @@ +for _, plat in ipairs(vars.plats) do + acklibrary { + name = "lib_"..plat, + srcs = { + "./*.s", + "./*.c" + }, + vars = { plat = plat }, + deps = { + "h+emheaders" + } + } +end + diff --git a/mach/powerpc/libend/build.lua b/mach/powerpc/libend/build.lua new file mode 100644 index 000000000..ca5a13c65 --- /dev/null +++ b/mach/powerpc/libend/build.lua @@ -0,0 +1,8 @@ +for _, plat in ipairs(vars.plats) do + acklibrary { + name = "lib_"..plat, + srcs = { "./*.s" }, + vars = { plat = plat }, + } +end + diff --git a/plat/linuxppc/build-pkg.lua b/plat/linuxppc/build-pkg.lua new file mode 100644 index 000000000..cac205ea3 --- /dev/null +++ b/plat/linuxppc/build-pkg.lua @@ -0,0 +1,25 @@ +include("plat/build.lua") + +ackfile { + name = "boot", + srcs = { "./boot.s" }, + vars = { plat = "linuxppc" } +} + +build_plat_libs { + name = "libs", + arch = "powerpc", + plat = "linuxppc", +} + +installable { + name = "pkg", + map = { + "+tools", + "+libs", + "./include+pkg", + ["$(PLATIND)/linuxppc/boot.o"] = "+boot", + ["$(PLATIND)/linuxppc/libsys.a"] = "./libsys+lib", + } +} + diff --git a/plat/linuxppc/build-tools.lua b/plat/linuxppc/build-tools.lua new file mode 100644 index 000000000..4d0f0048d --- /dev/null +++ b/plat/linuxppc/build-tools.lua @@ -0,0 +1,21 @@ +include("plat/build.lua") + +build_as { + name = "as", + arch = "powerpc", +} + +build_ncg { + name = "ncg", + arch = "powerpc", +} + +return installable { + name = "tools", + map = { + ["$(PLATDEP)/linuxppc/as"] = "+as", + ["$(PLATDEP)/linuxppc/ncg"] = "+ncg", + ["$(PLATIND)/descr/linuxppc"] = "./descr", + "util/opt+pkg", + } +} diff --git a/plat/linuxppc/descr b/plat/linuxppc/descr index 69b00fbc5..b70680201 100644 --- a/plat/linuxppc/descr +++ b/plat/linuxppc/descr @@ -35,25 +35,26 @@ var C_INCLUDES=-I{PLATFORMDIR}/include -I{EM}/share/ack/include/ansi name be from .m.g to .s - program {EM}/lib/ack/{ARCH}/ncg + program {EM}/lib/ack/{PLATFORM}/ncg mapflag -gdb GF=-gdb args {GF?} < stdout need .e end -name asopt - from .s - to .so - program {EM}/lib/ack/{ARCH}/top - args - optimizer - stdin - stdout -end +# FIXME(dtrg): not working yet +#name asopt +# from .s +# to .so +# program {EM}/lib/ack/{PLATFORM}/top +# args +# optimizer +# stdin +# stdout +#end name as from .s.so to .o - program {EM}/lib/ack/{ARCH}/as + program {EM}/lib/ack/{PLATFORM}/as args - -o > < prep cond end @@ -74,7 +75,6 @@ name led (.mod:{TAIL}={PLATFORMDIR}/libmodula2.a) \ (.ocm:{TAIL}={PLATFORMDIR}/liboccam.a) \ (.ocm.b.mod.c.p:{TAIL}={PLATFORMDIR}/libc.a) \ - {PLATFORMDIR}/liblinux.a \ {PLATFORMDIR}/libem.a \ {PLATFORMDIR}/libsys.a \ {PLATFORMDIR}/libend.a diff --git a/plat/linuxppc/include/build.lua b/plat/linuxppc/include/build.lua new file mode 100644 index 000000000..27325b43d --- /dev/null +++ b/plat/linuxppc/include/build.lua @@ -0,0 +1,24 @@ +include("plat/build.lua") + +headermap = {} +packagemap = {} + +local function addheader(h) + headermap[h] = "./"..h + packagemap["$(PLATIND)/linuxppc/include/"..h] = "./"..h +end + +addheader("ack/config.h") +addheader("sys/ioctl.h") +addheader("unistd.h") + +acklibrary { + name = "headers", + hdrs = headermap +} + +installable { + name = "pkg", + map = packagemap +} + diff --git a/plat/linuxppc/libsys/build.lua b/plat/linuxppc/libsys/build.lua new file mode 100644 index 000000000..e74f3f416 --- /dev/null +++ b/plat/linuxppc/libsys/build.lua @@ -0,0 +1,16 @@ +acklibrary { + name = "lib", + srcs = { + "./*.s", + "plat/linux/libsys/*.c", + "plat/linux/libsys/*.s", + }, + deps = { + "lang/cem/libcc.ansi/headers+headers", + "plat/linuxppc/include+headers", + }, + vars = { + plat = "linuxppc" + } +} +