Also begin to start work on cross compilation, though that will have to
be finished later.
The patches are based on the first version of
https://reviews.llvm.org/D99484. It's very annoying to do the
back-porting but the review has uncovered nothing super major so I'm
fine sticking with what I've got.
Beyond making the outputs work, I also strove to re-sync the packages,
as they have been drifting pointlessly apart for some time.
----
Other misc notes, highly incomplete
- lvm-config-native and llvm-config are put in `dev` because they are
tools just for build time.
- Clang no longer has an lld dep. That was introduced in
db29857eb3, but if clang needs help
finding lld when it is used we should just pass it flags / put in the
resource dir. Providing it at build time increases critical path
length for no good reason.
----
A note on `nativeCC`:
`stdenv` takes tools from the previous stage, so:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)`
while:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)`
3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)`
symlinks like `tpm2_createprimary -> tpm2` were wrapped, causing argv0
issues due to double wrapping:
$ tpm2_ptool init
[..]
RuntimeError: Could not execute tpm2_createprimary: b'ERROR:
/nix/store/[..]/bin/.tpm2_createprimary-wrapped: unknown tool.
This patch only wraps the `tpm2` and `tss2` executables, and not the
symlinks to them `tpm2_*` and `tss2_*`
The nsjail build has been broken since the 3.7.5 bison bump:
/nix/store/(...)/bin/ld: kafel/libkafel.a(libkafel.o):
in function `kafel_yyerror':
arm_syscalls.c:(.text+0x6833): undefined reference to `YYUSE'
The issue is coming from kafel and has been fixed upstream. More infos
at: https://github.com/google/kafel/pull/28.
Kafel being distributed through a git submodule in the nsjail repo, we
can't directly fetchpatch the fix from Github. We had to manually
modify the said patch to add a /kafel prefix.
We'll need to remove this patch for the next nsjail version bump.