Author: Michael Forney <email@example.com>
Date: Thu, 18 Apr 2019 18:48:53 -0700
Add some documentation about building various software
2 files changed, 49 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
@@ -6,8 +6,8 @@ the [ISC] license.
Several GNU C [extensions] are also implemented.
There is still much to do and some parts of the code are a little rough,
-but it currently implements most of the language, is self-hosting,
-and capable of building some useful software.
+but it currently implements most of the language and is capable of
+building some useful [software] including itself, `binutils`, and more.
It was inspired by several other small C compilers including [8cc],
[c], and [scc].
@@ -74,6 +74,7 @@ Please report any issues to https://todo.sr.ht/~mcf/cc-issues.
diff --git a/doc/software.md b/doc/software.md
@@ -0,0 +1,46 @@
+# Software notes
+This document lists some software known to build successfully, and any
+special procedures necessary.
+Builds without issue as of [ef9f6f35].
+QBE must be built with `NPred` (in `all.h` at least 297).
+On glibc systems, you must make sure to include `crtbegin.o` and
+`crtend.o` from gcc at the end of `startfiles` and beginning of `endfiles`
+On musl systems, you must define `long double` to match `double` to
+avoid errors in unused `static inline` functions in musl's `math.h`.
+Requires several patches available here:
+- Fix function pointer subtraction in `bfd/doc/chew.c` (applied upstream).
+- Skip unsupported `LDFLAGS`, only tested to work against `CXX` by
+ configure, but applied to `CC` as well.
+- Disable `long double` support in `_bfd_doprnt`.
+- Alter some ifdefs to avoid statement expressions and VLAs.
+- Implement `pex_unix_exec_child` with `posix_spawn` instead of `vfork`
+ and subtle `volatile` usage.
+- Make `regcomp` and `regexec` match the header declaration in usage of
+- Don't declare `vasprintf` unless it was checked for and not
+ found. Several subdirectories in binutils include `libiberty.h`,
+ but don't use `vasprintf`, causing conflicting declarations with libc
+ in usage of `restrict`.
+- Make sure `config.h` is included in `arlex.c` so that the appropriate
+ feature-test macros get defined to expose `strdup`.
+ ./configure CC=/path/to/cc CFLAGS_FOR_BUILD=-D_GNU_SOURCE \
+ --disable-intl --disable-gdb --disable-plugins --disable-readline