The goal is to reduce code duplication in loader by creating a separate
instance of crypto library, which can be linked if either zfs or geli
is needed. Incidentally it also resulted in some related changes, such as
geli + zfsboot (totally untested however). Also there is still some
confusion about _STAND and _STANDALONE defines, which probably will need
some attention. Also there seems to be some confusion about bsd.stand.mk
The resulting zfsloader binary is only slightly reduced in size:
-r-xr-xr-x 1 root wheel 446464 Aug 19 08:46 zfsloader
-rw-r--r-- 1 root wheel 438272 Aug 23 00:30 zfsloader.b
in this sample, the zfsloader.b is built based on this work. Since only
sha256/sha512-256 code was duplicated, the result is quite good, I think.
There also seems to be some sort of issue preventing removal of unused
symbols from resulting binaries, the specific case was observed regarding
SHA* functions, eventually I just used preprocessor to exclude unused ones.
Most likely I have missed some related parts, only tested x86 build.