From e43939bcc6123e02314aa403eef94d5ace441f7f Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sun, 27 Aug 2023 02:06:32 +0200 Subject: ports: qbe, cproc :^) --- ports/cproc/files/config.h | 26 ++++++++++++++++++++++++++ ports/cproc/files/config.mk | 5 +++++ ports/cproc/patches/0-cloexec.patch | 17 +++++++++++++++++ ports/cproc/port | 13 +++++++++++++ ports/cproc/sha256sums | 1 + 5 files changed, 62 insertions(+) create mode 100644 ports/cproc/files/config.h create mode 100644 ports/cproc/files/config.mk create mode 100644 ports/cproc/patches/0-cloexec.patch create mode 100755 ports/cproc/port create mode 100644 ports/cproc/sha256sums (limited to 'ports/cproc') diff --git a/ports/cproc/files/config.h b/ports/cproc/files/config.h new file mode 100644 index 0000000..18b2b1e --- /dev/null +++ b/ports/cproc/files/config.h @@ -0,0 +1,26 @@ +static const char target[] = "x86_64-camellia"; +static const char *const startfiles[] = {"-l", ":crt0.o"}; +static const char *const endfiles[] = {"-l", "c"}; +static const char *const preprocesscmd[] = { + "cpp", + + /* clear preprocessor GNU C version */ + "-U", "__GNUC__", + "-U", "__GNUC_MINOR__", + + /* we don't yet support these optional features */ + "-D", "__STDC_NO_ATOMICS__", + "-D", "__STDC_NO_COMPLEX__", + "-D", "__STDC_NO_VLA__", + "-U", "__SIZEOF_INT128__", + + /* we don't generate position-independent code */ + "-U", "__PIC__", + + /* ignore attributes and extension markers */ + "-D", "__attribute__(x)=", + "-D", "__extension__=", +}; +static const char *const codegencmd[] = {"qbe"}; +static const char *const assemblecmd[] = {"as"}; +static const char *const linkcmd[] = {"ld", "-no-dynamic-linker", "-pie"}; diff --git a/ports/cproc/files/config.mk b/ports/cproc/files/config.mk new file mode 100644 index 0000000..b58d14f --- /dev/null +++ b/ports/cproc/files/config.mk @@ -0,0 +1,5 @@ +PREFIX=/usr/ +BINDIR=$(PREFIX)/bin +CC=cc +CFLAGS=-std=c99 -Wall -Wpedantic -Wno-parentheses -Wno-switch -g -pipe +LDFLAGS= diff --git a/ports/cproc/patches/0-cloexec.patch b/ports/cproc/patches/0-cloexec.patch new file mode 100644 index 0000000..4102e05 --- /dev/null +++ b/ports/cproc/patches/0-cloexec.patch @@ -0,0 +1,17 @@ +--- driver.c.orig ++++ driver.c +@@ -165,12 +165,10 @@ spawnphase(struct stageinfo *phase, int *fd, char *input, char *output, bool las + goto err1; + } + if (fcntl(pipefd[0], F_SETFD, FD_CLOEXEC) < 0) { +- ret = errno; +- goto err2; ++ warn("fcntl(..., F_SETFD, FD_CLOEXEC):"); + } + if (fcntl(pipefd[1], F_SETFD, FD_CLOEXEC) < 0) { +- ret = errno; +- goto err2; ++ warn("fcntl(..., F_SETFD, FD_CLOEXEC):"); + } + ret = posix_spawn_file_actions_adddup2(&actions, pipefd[1], 1); + if (ret) diff --git a/ports/cproc/port b/ports/cproc/port new file mode 100755 index 0000000..54f649e --- /dev/null +++ b/ports/cproc/port @@ -0,0 +1,13 @@ +#!/bin/sh +. ports/pre + +pkg=cproc +tarball=michaelforney-cproc-0985a78.tar.gz +tarball_dir=michaelforney-cproc-0985a78 +url=https://github.com/michaelforney/cproc/tarball/0985a7893a4b5de63a67ebab445892d9fffe275b + +relink() { + rm $tarball_dir/cproc +} + +. ports/post diff --git a/ports/cproc/sha256sums b/ports/cproc/sha256sums new file mode 100644 index 0000000..568912f --- /dev/null +++ b/ports/cproc/sha256sums @@ -0,0 +1 @@ +cf9a4de550303eedcc8b8ee22f11b085a9387b911fa16a6fa7551382a3d7a1ea michaelforney-cproc-0985a78.tar.gz -- cgit v1.2.3