aboutsummaryrefslogtreecommitdiff
path: root/build.json
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2024-03-18 15:37:24 +1000
committerBoringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-03-22 05:15:56 +0000
commitfe0c91e74481e335f434dd6403eeb7ce160fe18d (patch)
treefa575ae782d0c46e9733017c7b57a14cc33c0d01 /build.json
parent36e85b6a05fe185f6b3a1b7e609e8b775c9b5a81 (diff)
downloadboringssl-fe0c91e74481e335f434dd6403eeb7ce160fe18d.zip
boringssl-fe0c91e74481e335f434dd6403eeb7ce160fe18d.tar.gz
boringssl-fe0c91e74481e335f434dd6403eeb7ce160fe18d.tar.bz2
Check in pre-generated perlasm and error data files
This adds a tool for managing pre-generated files, aligning our CMake and non-CMake builds. The plan is roughly: The source of truth for the file lists will (eventually) be build.json. This describes the build in terms of the files that we directly edit. However, we have a two-phase build. First a pregeneration step transforms some of the less convenient inputs into checked in files. Notably perlasm files get expanded. This produces an equivalent JSON structure with fewer inputs. The same tool then outputs that structure into whatever build systems we want. This initial version pre-generates err_data.c and perlasm files. I've not wired up the various build formats, except for CMake (for the CMake build to consume) and JSON (for generate_build_files.py to parse). build.json is also, for now, only a subset of the build. Later changes The upshot of all this is we no longer have a Perl build dependency! Perl is now only needed when working on BoringSSL. It nearly removes the Go one, but Go is still needed to run and (for now) build the tests. To keep the generated files up-to-date, once this lands, I'll update our CI to run `go run ./util/pregenerate -check` which asserts that all generated files are correct. From there we can land the later changes in this patch series that uses this more extensively. My eventual goal is to replace generate_build_files.py altogether and the "master-with-bazel" branch. Instead we'll just have sources.bzl, sources.gni, etc. all checked into the tree directly. And then the normal branch will just have both a CMake and Bazel build in it. Update-Note: generate_build_files.py no longer generates assembly files or err_data.c. Those are now checked into the tree directly. Bug: 542 Change-Id: I71f5ff7417be811f8b7888b345279474e6b38ee9 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/67288 Reviewed-by: Bob Beck <bbe@google.com> Commit-Queue: David Benjamin <davidben@google.com>
Diffstat (limited to 'build.json')
-rw-r--r--build.json136
1 files changed, 136 insertions, 0 deletions
diff --git a/build.json b/build.json
new file mode 100644
index 0000000..0bf49a7
--- /dev/null
+++ b/build.json
@@ -0,0 +1,136 @@
+// This file defines BoringSSL's build, expressed in terms of the input source
+// files that BoringSSL developers edit. It is a JSON file with line comments,
+// with line comments removed before parsing. It drives ./util/pregenerate which
+// converts some of those inputs (e.g. perlasm files) into pre-generated
+// outputs. This produces a more simplified build, which is then converted into
+// build files of various syntaxes.
+//
+// When modifying this file, run `go run ./util/pregenerate`. See gen/README.md
+// for more details, and util/pregenerate/build.go for the schema.
+//
+// TODO(crbug.com/boringssl/542): Moving build inputs to this file is still work
+// in progress, so this file is currently incomplete.
+{
+ "bcm": {
+ "perlasm_aarch64": [
+ {"src": "crypto/fipsmodule/aes/asm/aesv8-armx.pl", "dst": "aesv8-armv8"},
+ {"src": "crypto/fipsmodule/modes/asm/aesv8-gcm-armv8.pl"},
+ {"src": "crypto/fipsmodule/bn/asm/armv8-mont.pl"},
+ {"src": "crypto/fipsmodule/bn/asm/bn-armv8.pl"},
+ {"src": "crypto/fipsmodule/modes/asm/ghash-neon-armv8.pl"},
+ {"src": "crypto/fipsmodule/modes/asm/ghashv8-armx.pl", "dst": "ghashv8-armv8"},
+ {"src": "crypto/fipsmodule/ec/asm/p256_beeu-armv8-asm.pl"},
+ {"src": "crypto/fipsmodule/ec/asm/p256-armv8-asm.pl"},
+ {"src": "crypto/fipsmodule/sha/asm/sha1-armv8.pl"},
+ {"src": "crypto/fipsmodule/sha/asm/sha512-armv8.pl", "args": ["sha256"], "dst": "sha256-armv8"},
+ {"src": "crypto/fipsmodule/sha/asm/sha512-armv8.pl", "args": ["sha512"]},
+ {"src": "crypto/fipsmodule/aes/asm/vpaes-armv8.pl"}
+ ],
+ "perlasm_arm": [
+ {"src": "crypto/fipsmodule/aes/asm/aesv8-armx.pl", "dst": "aesv8-armv7"},
+ {"src": "crypto/fipsmodule/bn/asm/armv4-mont.pl"},
+ {"src": "crypto/fipsmodule/aes/asm/bsaes-armv7.pl"},
+ {"src": "crypto/fipsmodule/modes/asm/ghash-armv4.pl"},
+ {"src": "crypto/fipsmodule/modes/asm/ghashv8-armx.pl", "dst": "ghashv8-armv7"},
+ {"src": "crypto/fipsmodule/sha/asm/sha1-armv4-large.pl"},
+ {"src": "crypto/fipsmodule/sha/asm/sha256-armv4.pl"},
+ {"src": "crypto/fipsmodule/sha/asm/sha512-armv4.pl"},
+ {"src": "crypto/fipsmodule/aes/asm/vpaes-armv7.pl"}
+ ],
+ "perlasm_x86": [
+ {"src": "crypto/fipsmodule/aes/asm/aesni-x86.pl"},
+ {"src": "crypto/fipsmodule/bn/asm/bn-586.pl"},
+ {"src": "crypto/fipsmodule/bn/asm/co-586.pl"},
+ {"src": "crypto/fipsmodule/modes/asm/ghash-ssse3-x86.pl"},
+ {"src": "crypto/fipsmodule/modes/asm/ghash-x86.pl"},
+ {"src": "crypto/fipsmodule/md5/asm/md5-586.pl"},
+ {"src": "crypto/fipsmodule/sha/asm/sha1-586.pl"},
+ {"src": "crypto/fipsmodule/sha/asm/sha256-586.pl"},
+ {"src": "crypto/fipsmodule/sha/asm/sha512-586.pl"},
+ {"src": "crypto/fipsmodule/aes/asm/vpaes-x86.pl"},
+ {"src": "crypto/fipsmodule/bn/asm/x86-mont.pl"}
+ ],
+ "perlasm_x86_64": [
+ {"src": "crypto/fipsmodule/modes/asm/aesni-gcm-x86_64.pl"},
+ {"src": "crypto/fipsmodule/aes/asm/aesni-x86_64.pl"},
+ {"src": "crypto/fipsmodule/modes/asm/ghash-ssse3-x86_64.pl"},
+ {"src": "crypto/fipsmodule/modes/asm/ghash-x86_64.pl"},
+ {"src": "crypto/fipsmodule/md5/asm/md5-x86_64.pl"},
+ {"src": "crypto/fipsmodule/ec/asm/p256_beeu-x86_64-asm.pl"},
+ {"src": "crypto/fipsmodule/ec/asm/p256-x86_64-asm.pl"},
+ {"src": "crypto/fipsmodule/rand/asm/rdrand-x86_64.pl"},
+ {"src": "crypto/fipsmodule/bn/asm/rsaz-avx2.pl"},
+ {"src": "crypto/fipsmodule/sha/asm/sha1-x86_64.pl"},
+ {"src": "crypto/fipsmodule/sha/asm/sha512-x86_64.pl", "args": ["sha256"], "dst": "sha256-x86_64"},
+ {"src": "crypto/fipsmodule/sha/asm/sha512-x86_64.pl", "args": ["sha512"]},
+ {"src": "crypto/fipsmodule/aes/asm/vpaes-x86_64.pl"},
+ {"src": "crypto/fipsmodule/bn/asm/x86_64-mont.pl"},
+ {"src": "crypto/fipsmodule/bn/asm/x86_64-mont5.pl"}
+ ]
+ },
+ "crypto": {
+ "err_data": [
+ "crypto/err/asn1.errordata",
+ "crypto/err/bio.errordata",
+ "crypto/err/bn.errordata",
+ "crypto/err/cipher.errordata",
+ "crypto/err/conf.errordata",
+ "crypto/err/dh.errordata",
+ "crypto/err/digest.errordata",
+ "crypto/err/dsa.errordata",
+ "crypto/err/ecdh.errordata",
+ "crypto/err/ecdsa.errordata",
+ "crypto/err/ec.errordata",
+ "crypto/err/engine.errordata",
+ "crypto/err/evp.errordata",
+ "crypto/err/hkdf.errordata",
+ "crypto/err/obj.errordata",
+ "crypto/err/pem.errordata",
+ "crypto/err/pkcs7.errordata",
+ "crypto/err/pkcs8.errordata",
+ "crypto/err/rsa.errordata",
+ "crypto/err/ssl.errordata",
+ "crypto/err/trust_token.errordata",
+ "crypto/err/x509.errordata",
+ "crypto/err/x509v3.errordata"
+ ],
+ "asm": [
+ "crypto/curve25519/asm/x25519-asm-arm.S",
+ "crypto/hrss/asm/poly_rq_mul.S",
+ "crypto/poly1305/poly1305_arm_asm.S",
+ "third_party/fiat/asm/fiat_curve25519_adx_mul.S",
+ "third_party/fiat/asm/fiat_curve25519_adx_square.S",
+ "third_party/fiat/asm/fiat_p256_adx_mul.S",
+ "third_party/fiat/asm/fiat_p256_adx_sqr.S"
+ ],
+ "perlasm_aarch64": [
+ {"src": "crypto/chacha/asm/chacha-armv8.pl"},
+ {"src": "crypto/cipher_extra/asm/chacha20_poly1305_armv8.pl"}
+ ],
+ "perlasm_arm": [
+ {"src": "crypto/chacha/asm/chacha-armv4.pl"}
+ ],
+ "perlasm_x86": [
+ {"src": "crypto/chacha/asm/chacha-x86.pl"}
+ ],
+ "perlasm_x86_64": [
+ {"src": "crypto/chacha/asm/chacha-x86_64.pl"},
+ {"src": "crypto/cipher_extra/asm/aes128gcmsiv-x86_64.pl"},
+ {"src": "crypto/cipher_extra/asm/chacha20_poly1305_x86_64.pl"}
+ ]
+ },
+ "test_support": {
+ "perlasm_aarch64": [
+ {"src": "crypto/test/asm/trampoline-armv8.pl"}
+ ],
+ "perlasm_arm": [
+ {"src": "crypto/test/asm/trampoline-armv4.pl"}
+ ],
+ "perlasm_x86": [
+ {"src": "crypto/test/asm/trampoline-x86.pl"}
+ ],
+ "perlasm_x86_64": [
+ {"src": "crypto/test/asm/trampoline-x86_64.pl"}
+ ]
+ }
+}