commit 54d92d9

hovercats  ·  2024-01-18 20:54:10 +0000 UTC
parent 412901a
cproc: import. bump to latest commit
6 files changed,  +64, -0
+3, -0
1@@ -125,3 +125,6 @@
2 [submodule "pkg/qbe/src"]
3 	path = pkg/qbe/src
4 	url = git://c9x.me/qbe.git
5+[submodule "pkg/cproc/src"]
6+	path = pkg/cproc/src
7+	url = https://git.sr.ht/~mcf/cproc
+26, -0
 1@@ -0,0 +1,26 @@
 2+static const char target[]               = "x86_64-linux-musl";
 3+static const char *const startfiles[]    = {"-l", ":crt1.o", "-l", ":crti.o"};
 4+static const char *const endfiles[]      = {"-l", "c", "-l", ":crtn.o"};
 5+static const char *const preprocesscmd[] = {
 6+	"cpp",
 7+
 8+	/* clear preprocessor GNU C version */
 9+	"-U", "__GNUC__",
10+	"-U", "__GNUC_MINOR__",
11+
12+	/* we don't yet support these optional features */
13+	"-D", "__STDC_NO_ATOMICS__",
14+	"-D", "__STDC_NO_COMPLEX__",
15+	"-D", "__STDC_NO_VLA__",
16+	"-U", "__SIZEOF_INT128__",
17+
18+	/* we don't generate position-independent code */
19+	"-U", "__PIC__",
20+
21+	/* ignore attributes and extension markers */
22+	"-D", "__attribute__(x)=",
23+	"-D", "__extension__=",
24+};
25+static const char *const codegencmd[]    = {"qbe"};
26+static const char *const assemblecmd[]   = {"as"};
27+static const char *const linkcmd[]       = {"ld",  "--dynamic-linker", "/lib/ld-musl-x86_64.so.1"};
+32, -0
 1@@ -0,0 +1,32 @@
 2+cflags{
 3+	'-std=c11', '-Wall', '-Wpedantic', '-Wno-switch', '-Wno-parentheses', '-Wno-maybe-uninitialized',
 4+	'-I $dir',
 5+}
 6+
 7+cc('util.c')
 8+
 9+exe('cproc', {'driver.c', 'util.c.o'})
10+exe('cproc-qbe', {
11+	'decl.c',
12+	'eval.c',
13+	'expr.c',
14+	'init.c',
15+	'main.c',
16+	'map.c',
17+	'pp.c',
18+	'qbe.c',
19+	'scan.c',
20+	'scope.c',
21+	'siphash.c',
22+	'stmt.c',
23+	'targ.c',
24+	'token.c',
25+	'tree.c',
26+	'type.c',
27+	'util.c.o',
28+	'utf.c',
29+})
30+file('bin/cproc', '755', '$outdir/cproc')
31+file('bin/cproc-qbe', '755', '$outdir/cproc-qbe')
32+
33+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 0985a7893a4b5de63a67ebab445892d9fffe275b
+1, -0
1@@ -0,0 +1 @@
2+0985a78 r0
+1, -0
1@@ -8,6 +8,7 @@ subgen 'bzip2'
2 subgen 'cacert'
3 subgen 'catgirl'
4 subgen 'curl'
5+subgen 'cproc'
6 subgen 'dosfstools'
7 subgen 'e2fsprogs'
8 subgen 'elftoolchain'