commit: 6cf13a16c62f000d12ff0489f5d882322fdc97b1
parent 6a53276dfbf915cda27720920ce30bae9472fd16
Author: Michael Forney <mforney@mforney.org>
Date: Wed, 16 Aug 2017 22:38:34 -0700
scc: Update to latest git
Diffstat:
8 files changed, 168 insertions(+), 84 deletions(-)
diff --git a/pkg/scc/gen.rc b/pkg/scc/gen.rc
@@ -2,8 +2,10 @@ archs=(qbe amd64-sysv)
std=c99
cflags\
'-std=c99' \
+ -D 'SYS=''"linux"''' \
-D 'PREFIX=' \
-D NDEBUG\
+ -I '$dir'/inc\
-I '$srcdir'/inc/$std\
-I '$outdir'/inc
@@ -11,7 +13,6 @@ lib libcc.a lib/^(debug.c die.c newitem.c xcalloc.c xmalloc.c xrealloc.c xstrdup
build '$outdir'/inc/error.h awk '$srcdir'/cc2/cc2.h '|' '$srcdir'/cc2/generror.awk ; with\
expr '-f $srcdir/cc2/generror.awk'
-build '$outdir'/inc/sysincludes.h copy '$srcdir'/inc/sysincludes.def.h
set baseoutdir '$outdir'
hdrs=(\
@@ -23,7 +24,7 @@ for(arch in $archs) {
set outdir '$outdir'/$arch
cflags -D 'ARCH=''"'^$arch^'"'''
- exe cc1-$arch -d '$baseoutdir'/inc/sysincludes.h cc1/^(\
+ exe cc1-$arch cc1/^(\
types.c decl.c lex.c error.c symbol.c main.c expr.c\
code.c stmt.c cpp.c fold.c init.c builtin.c\
arch/$arch/arch.c\
diff --git a/pkg/scc/inc/ldflags.h b/pkg/scc/inc/ldflags.h
@@ -0,0 +1,4 @@
+char *ldflags[] = {
+ "-static",
+ NULL
+};
diff --git a/pkg/scc/inc/sysincludes.h b/pkg/scc/inc/sysincludes.h
@@ -0,0 +1,4 @@
+char *sysincludes[] = {
+ PREFIX "/include/",
+ NULL
+};
diff --git a/pkg/scc/inc/syslibs.h b/pkg/scc/inc/syslibs.h
@@ -0,0 +1,4 @@
+char *syslibs[] = {
+ PREFIX "/lib/",
+ NULL
+};
diff --git a/pkg/scc/patch/0001-Allow-generated-headers-in-separate-directory.patch b/pkg/scc/patch/0001-Allow-generated-headers-in-separate-directory.patch
@@ -0,0 +1,111 @@
+From 5ee9b6dbb259fd0ca6024c27e9af1730f01db2d4 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Thu, 9 Feb 2017 13:01:13 -0800
+Subject: [PATCH] Allow generated headers in separate directory
+
+---
+ cc1/Makefile | 2 +-
+ cc1/arch/amd64-sysv/arch.c | 2 +-
+ cc1/arch/i386-sysv/arch.c | 2 +-
+ cc1/arch/qbe/arch.c | 2 +-
+ cc1/arch/z80/arch.c | 2 +-
+ driver/posix/Makefile | 2 ++
+ driver/posix/scc.c | 4 ++--
+ 7 files changed, 9 insertions(+), 7 deletions(-)
+
+diff --git a/cc1/Makefile b/cc1/Makefile
+index bd37547..3881eae 100644
+--- a/cc1/Makefile
++++ b/cc1/Makefile
+@@ -1,7 +1,7 @@
+ # See LICENSE file for copyright and license details.
+ .POSIX:
+
+-CSTDINC = -I../inc/$(STD)
++CSTDINC = -I../inc -I../inc/$(STD)
+
+ include ../config.mk
+
+diff --git a/cc1/arch/amd64-sysv/arch.c b/cc1/arch/amd64-sysv/arch.c
+index ba5d7ea..692a288 100644
+--- a/cc1/arch/amd64-sysv/arch.c
++++ b/cc1/arch/amd64-sysv/arch.c
+@@ -2,7 +2,7 @@
+ static char sccsid[] = "@(#) ./cc1/arch/amd64-sysv/arch.c";
+ #include <stdio.h>
+
+-#include "../../../inc/sysincludes.h"
++#include <sysincludes.h>
+ #include "../../../inc/cc.h"
+ #include "../../cc1.h"
+
+diff --git a/cc1/arch/i386-sysv/arch.c b/cc1/arch/i386-sysv/arch.c
+index fd73eba..36d6366 100644
+--- a/cc1/arch/i386-sysv/arch.c
++++ b/cc1/arch/i386-sysv/arch.c
+@@ -2,7 +2,7 @@
+ static char sccsid[] = "@(#) ./cc1/arch/i386-sysv/arch.c";
+ #include <stdio.h>
+
+-#include "../../../inc/sysincludes.h"
++#include <sysincludes.h>
+ #include "../../../inc/cc.h"
+ #include "../../cc1.h"
+
+diff --git a/cc1/arch/qbe/arch.c b/cc1/arch/qbe/arch.c
+index 01e2410..ab718c7 100644
+--- a/cc1/arch/qbe/arch.c
++++ b/cc1/arch/qbe/arch.c
+@@ -2,7 +2,7 @@
+ static char sccsid[] = "@(#) ./cc1/arch/qbe/arch.c";
+ #include <stdio.h>
+
+-#include "../../../inc/sysincludes.h"
++#include <sysincludes.h>
+ #include "../../../inc/cc.h"
+ #include "../../cc1.h"
+
+diff --git a/cc1/arch/z80/arch.c b/cc1/arch/z80/arch.c
+index b5e31f3..a686c90 100644
+--- a/cc1/arch/z80/arch.c
++++ b/cc1/arch/z80/arch.c
+@@ -2,7 +2,7 @@
+ static char sccsid[] = "@(#) ./cc1/arch/z80/arch.c";
+ #include <stdio.h>
+
+-#include "../../../inc/sysincludes.h"
++#include <sysincludes.h>
+ #include "../../../inc/cc.h"
+ #include "../../cc1.h"
+
+diff --git a/driver/posix/Makefile b/driver/posix/Makefile
+index 782a0a2..458b32b 100644
+--- a/driver/posix/Makefile
++++ b/driver/posix/Makefile
+@@ -1,6 +1,8 @@
+ # See LICENSE file for copyright and license details.
+ .POSIX:
+
++CSTDINC = -I../../inc
++
+ include ../../config.mk
+
+ OBJS = scc.o
+diff --git a/driver/posix/scc.c b/driver/posix/scc.c
+index dd74e26..26f4f8c 100644
+--- a/driver/posix/scc.c
++++ b/driver/posix/scc.c
+@@ -16,8 +16,8 @@ static char sccsid[] = "@(#) ./driver/posix/scc.c";
+
+ #include "../../inc/arg.h"
+ #include "../../inc/cc.h"
+-#include "../../inc/syslibs.h"
+-#include "../../inc/ldflags.h"
++#include <syslibs.h>
++#include <ldflags.h>
+
+ enum {
+ CC1,
+--
+2.14.1
+
diff --git a/pkg/scc/patch/0001-Allow-generated-sysincludes.h-in-separate-directory.patch b/pkg/scc/patch/0001-Allow-generated-sysincludes.h-in-separate-directory.patch
@@ -1,81 +0,0 @@
-From e44ceb42cf228e57264e657ea1fa3767811e68cf Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Thu, 9 Feb 2017 13:01:13 -0800
-Subject: [PATCH] Allow generated sysincludes.h in separate directory
-
----
- cc1/Makefile | 2 +-
- cc1/arch/amd64-sysv/arch.c | 2 +-
- cc1/arch/i386-sysv/arch.c | 2 +-
- cc1/arch/qbe/arch.c | 2 +-
- cc1/arch/z80/arch.c | 2 +-
- 5 files changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/cc1/Makefile b/cc1/Makefile
-index b9f73ce..3ec023b 100644
---- a/cc1/Makefile
-+++ b/cc1/Makefile
-@@ -1,7 +1,7 @@
- # See LICENSE file for copyright and license details.
- .POSIX:
-
--CSTDINC = -I../inc/$(STD)
-+CSTDINC = -I../inc -I../inc/$(STD)
-
- include ../config.mk
-
-diff --git a/cc1/arch/amd64-sysv/arch.c b/cc1/arch/amd64-sysv/arch.c
-index f4492b4..f72d275 100644
---- a/cc1/arch/amd64-sysv/arch.c
-+++ b/cc1/arch/amd64-sysv/arch.c
-@@ -2,7 +2,7 @@
- static char sccsid[] = "@(#) ./cc1/arch/amd64-sysv/arch.c";
- #include <stdio.h>
-
--#include "../../../inc/sysincludes.h"
-+#include <sysincludes.h>
- #include "../../../inc/cc.h"
- #include "../../cc1.h"
-
-diff --git a/cc1/arch/i386-sysv/arch.c b/cc1/arch/i386-sysv/arch.c
-index f72f889..3672acd 100644
---- a/cc1/arch/i386-sysv/arch.c
-+++ b/cc1/arch/i386-sysv/arch.c
-@@ -2,7 +2,7 @@
- static char sccsid[] = "@(#) ./cc1/arch/i386-sysv/arch.c";
- #include <stdio.h>
-
--#include "../../../inc/sysincludes.h"
-+#include <sysincludes.h>
- #include "../../../inc/cc.h"
- #include "../../cc1.h"
-
-diff --git a/cc1/arch/qbe/arch.c b/cc1/arch/qbe/arch.c
-index 233a390..e633a40 100644
---- a/cc1/arch/qbe/arch.c
-+++ b/cc1/arch/qbe/arch.c
-@@ -2,7 +2,7 @@
- static char sccsid[] = "@(#) ./cc1/arch/qbe/arch.c";
- #include <stdio.h>
-
--#include "../../../inc/sysincludes.h"
-+#include <sysincludes.h>
- #include "../../../inc/cc.h"
- #include "../../cc1.h"
-
-diff --git a/cc1/arch/z80/arch.c b/cc1/arch/z80/arch.c
-index 0c603f6..e709bfb 100644
---- a/cc1/arch/z80/arch.c
-+++ b/cc1/arch/z80/arch.c
-@@ -2,7 +2,7 @@
- static char sccsid[] = "@(#) ./cc1/arch/z80/arch.c";
- #include <stdio.h>
-
--#include "../../../inc/sysincludes.h"
-+#include <sysincludes.h>
- #include "../../../inc/cc.h"
- #include "../../cc1.h"
-
---
-2.11.1
-
diff --git a/pkg/scc/patch/0002-Build-with-musl-CRT-files.patch b/pkg/scc/patch/0002-Build-with-musl-CRT-files.patch
@@ -0,0 +1,41 @@
+From a67e93d3e3353aeba7eb4b1a94ae98fa54f76b49 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Wed, 16 Aug 2017 22:34:28 -0700
+Subject: [PATCH] Build with musl CRT files
+
+---
+ driver/posix/scc.c | 11 ++---------
+ 1 file changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/driver/posix/scc.c b/driver/posix/scc.c
+index 26f4f8c..aa61827 100644
+--- a/driver/posix/scc.c
++++ b/driver/posix/scc.c
+@@ -99,7 +99,6 @@ static int
+ inittool(int tool)
+ {
+ struct tool *t = &tools[tool];
+- char *crt;
+ int n;
+
+ if (t->init)
+@@ -126,14 +125,8 @@ inittool(int tool)
+ addarg(tool, "-L");
+ addarg(tool, syslibs[n]);
+ }
+- n = snprintf(NULL, 0, "%s-%s-%s.o",
+- PREFIX "/lib/scc/crt", arch, sys);
+- if (n < 0)
+- die("scc: wrong crt file name");
+- crt = xmalloc(++n);
+- n = snprintf(crt, n, "%s-%s-%s.o",
+- PREFIX "/lib/scc/crt", arch, sys);
+- addarg(tool, crt);
++ addarg(tool, PREFIX "/lib/crt1.o");
++ addarg(tool, PREFIX "/lib/crtn.o");
+ break;
+ case AS:
+ addarg(tool, "-o");
+--
+2.14.1
+
diff --git a/pkg/scc/rev b/pkg/scc/rev
@@ -1 +1 @@
-6
+7