Commit Graph
6 Commits
Author SHA1 Message Date
milner b3a2340a22 fix(build): handle assembly and reject sources meowc cannot compile 2022-07-25 11:49:47 +00:00
milner 84fae96b16 refactor(lib): delete the code nothing reaches 2022-07-24 18:55:09 +00:00
milner 7d6aaeb5eb feat(exec): spill long command lines into response files 2022-07-20 17:50:41 +00:00
milner b8d3b7ebb1 feat(link): drive output names and link flags from the object format 2022-07-18 07:56:15 +00:00
milner 2a2f8d976d feat(toolchain): cross compile through target triples and sysroots
A triple is set with --target or a target field in the toolchain block, and
everything derived from it follows: platform, arch and the conditionals built
on them come from the triple rather than uname, so a build file can branch on
the platform it is building for instead of the one it is running on.

Tools are taken from the triple prefix when a matching toolchain is installed
(x86_64-w64-mingw32-gcc, -ar, -ranlib) and otherwise the host compiler is
invoked with --target, which covers clang without a prefixed toolchain. An
explicit cc, cxx, ar or ranlib in the build file always wins over the derived
one. --sysroot adds --sysroot to both the compile and link lines.

Each triple gets its own build directory and probe cache under builddir, so a
host tree and a cross tree do not invalidate each other and neither reruns the
other's checks. Probes never execute what they compile, sizeof included, so the
configure stage needed no changes to work against a foreign target.

Executables and shared libraries now take the extension the target platform
uses. Without that the graph expected bin/app while mingw wrote bin/app.exe,
and the link step repeated on every build.

Verified against x86_64-w64-mingw32, which produces a PE32+ binary, and
aarch64-linux-gnu through clang, which produces AArch64 objects.
2022-07-16 01:16:10 +00:00
milner 9097815563 feat(build): lower resolved targets into graph actions
Emits compile, archive, shared-link and link actions per target, and applies
-fPIC to anything reachable from a shared target.
2022-06-13 08:04:17 +00:00