50 Commits

Author SHA1 Message Date
Brian Smith
38b9bb7de0 Reorganize, simplify, and clarify BUILDING.md. 2023-10-03 14:23:46 -07:00
Brian Smith
32e007fc88 Use Android NDK 25 and work around Rust/Android incompatibilities.
Use Android NDK 25 since that's GitHub Actions is moving to. SDK level
is the minimum supported, and there are no longer target-specific
allases for `llvm-ar`; update cargo.sh accordingly.

Use the environment variables recommended by the Android documentation.

Work around compatibility issue with Rust and Android NDKs.

Remove out-of-date documentation aboud building for Android.
2022-10-19 23:49:17 -07:00
Alexander Ovchinnikov
ceb5b90f6e Enable building and running on Windows ARM64
I agree to license my contributions to each file under the terms given at the top of each file I changed.

Co-authored-by: Marc-André Moreau <marcandre.moreau@gmail.com>
2021-08-16 12:28:42 -07:00
Brian Smith
508f5a3293 CI/CD: Use a GitHub-hosted copy of nasm instead of downloading it from nasm.us.
Downloading from nasm.us frequently fails. Avoid depending on it.

Change the expected location of nasm in build.rs.
2021-04-29 15:10:32 -07:00
Brian Smith
7514f7a417 Remove the internal_benches feature.
The benchmarks need to be rewritten to use a new benchmark framework.
Remove them in the interim. This makes `internal_benches` a no-op.

This enables using `--all-features` on stable channels. Do so for some
non-test things in CI. `--all-features` isn't added for tests because of
the `slow_tests` feature.
2020-11-26 16:25:34 -08:00
Brian Smith
15c823a571 Build: Replace use of Yasm with use of Nasm for Windows assembly.
Match BoringSSL. According to the Chromium discussion about nasm, it
is also substantially faster.
2020-11-25 16:32:53 -08:00
Pietro Monteiro
98e25317b3 Add cross-compiling documentation. 2020-06-19 14:04:38 -05:00
Brian Smith
bc22053bdf Make std a non-default feature.
Dont enable `std`-based functionality unless requested. This requires removing
the `std` feature dependency from `dev_urandom_fallback` and `test_logging`.
Tweak the meaning of `test_logging` to keep this tractable.
2019-07-15 22:03:17 -10:00
Brian Smith
7071dda618 Replace use_heap feature with alloc and std features; use alloc crate. 2019-07-09 21:15:18 -10:00
Brian Smith
d8ec880a4e Revert "Revert "Clarify wording of __ANDROID_API__ build documentation.""
Reland commit b98f61f9718df0fdf291541c1ca4d0ae45baedf3.
2018-05-22 08:19:09 -10:00
Brian Smith
08ec4f374c Revert "Revert "Check __ANDROID_API__ instead of defining it""
Reland commit b2fd4fabee20e321c4f327f15e6de76dfb21eea2.
2018-05-22 08:18:53 -10:00
Brian Smith
b2fd4fabee Revert "Check __ANDROID_API__ instead of defining it"
This reverts commit f934a0ba45a53812bd04694c0e1781ffd9d01671.
2018-05-14 17:00:48 -10:00
Brian Smith
b98f61f971 Revert "Clarify wording of __ANDROID_API__ build documentation."
This reverts commit df1ee1191583552e89a6939c8738393044937bae.
2018-05-14 17:00:40 -10:00
Brian Smith
df1ee11915 Clarify wording of __ANDROID_API__ build documentation. 2018-05-14 15:53:38 -10:00
Pierre Krieger
f934a0ba45 Check __ANDROID_API__ instead of defining it 2018-05-14 15:51:31 -10:00
Brian Smith
0c4b60048f Update BUILDING.md to account for recent changes. 2017-03-19 09:24:14 -10:00
Brian Smith
e45ee6e08d Update documentation in BUILDING.md. 2016-11-07 15:22:18 -10:00
Tatsuya Kawano
4102ae7cc5 Issue #287 - Support building on *BSD
- build.rs
  * Default to `gmake` on BSD systems
  * Support `MAKE` variable for pointing to correct `make`
- mk/top_of_makefile.mk
  * Allow target triple on BSD* not to have abi (e.g. x86_64-unknown-freebsd)
- BUILDING.md
  * Add descriptions about `MAKE` variable.

I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2016-10-12 18:16:31 +08:00
pravic
a6aa30189a Fix strawberryperl link in BUILDING.md. 2016-08-24 09:50:17 -10:00
Brian Smith
aab196aba9 Enable P-384 even when use_heap is not enabled. 2016-07-23 16:39:04 -10:00
Brian Smith
50e3bf2bc3 Move the documentation for the use_heap feature to BUILDING.md. 2016-07-03 08:35:25 -10:00
Brian Smith
636f7dc47f Move documentation of contributor-only features to BUILDING.md. 2016-07-03 08:35:21 -10:00
Brian Smith
6c37f8a972 Update documentation w.r.t. the dropping of MSVS 2013 support. 2016-05-31 11:15:27 -10:00
Brian Smith
38b86a7711 Update documentation regarding supported Clang versions.
Clang 3.4 isn't "supported" (but probably still works). Clang 3.8 was
released so it isn't the trunk any more.
2016-04-14 17:30:42 -10:00
Brian Smith
4db5f88f61 Enable asm implementations for Windows; drop NO_ASM mode. 2016-04-14 11:37:37 -10:00
Brian Smith
68abf981e3 Merge BoringSSL 35be688: Enable upstream's ChaCha20 assembly for x86 and ARM (32- and 64-bit). 2016-02-28 20:02:44 -10:00
David Benjamin
35be688078 Enable upstream's ChaCha20 assembly for x86 and ARM (32- and 64-bit).
This removes chacha_vec_arm.S and chacha_vec.c in favor of unifying on
upstream's code. Upstream's is faster and this cuts down on the number of
distinct codepaths. Our old scheme also didn't give vectorized code on
Windows or aarch64.

BoringSSL-specific modifications made to the assembly:

- As usual, the shelling out to $CC is replaced with hardcoding $avx. I've
  tested up to the AVX2 codepath, so enable it all.

- I've removed the AMD XOP code as I have not tested it.

- As usual, the ARM file need the arm_arch.h include tweaked.

Speed numbers follow. We can hope for further wins on these benchmarks after
importing the Poly1305 assembly.

x86
---
Old:
Did 1422000 ChaCha20-Poly1305 (16 bytes) seal operations in 1000433us (1421384.5 ops/sec): 22.7 MB/s
Did 123000 ChaCha20-Poly1305 (1350 bytes) seal operations in 1003803us (122534.0 ops/sec): 165.4 MB/s
Did 22000 ChaCha20-Poly1305 (8192 bytes) seal operations in 1000282us (21993.8 ops/sec): 180.2 MB/s
Did 1428000 ChaCha20-Poly1305-Old (16 bytes) seal operations in 1000214us (1427694.5 ops/sec): 22.8 MB/s
Did 124000 ChaCha20-Poly1305-Old (1350 bytes) seal operations in 1006332us (123219.8 ops/sec): 166.3 MB/s
Did 22000 ChaCha20-Poly1305-Old (8192 bytes) seal operations in 1020771us (21552.3 ops/sec): 176.6 MB/s
New:
Did 1520000 ChaCha20-Poly1305 (16 bytes) seal operations in 1000567us (1519138.6 ops/sec): 24.3 MB/s
Did 152000 ChaCha20-Poly1305 (1350 bytes) seal operations in 1004216us (151361.9 ops/sec): 204.3 MB/s
Did 31000 ChaCha20-Poly1305 (8192 bytes) seal operations in 1009085us (30720.9 ops/sec): 251.7 MB/s
Did 1797000 ChaCha20-Poly1305-Old (16 bytes) seal operations in 1000141us (1796746.7 ops/sec): 28.7 MB/s
Did 171000 ChaCha20-Poly1305-Old (1350 bytes) seal operations in 1003204us (170453.9 ops/sec): 230.1 MB/s
Did 31000 ChaCha20-Poly1305-Old (8192 bytes) seal operations in 1005349us (30835.1 ops/sec): 252.6 MB/s

x86_64, no AVX2
---
Old:
Did 1782000 ChaCha20-Poly1305 (16 bytes) seal operations in 1000204us (1781636.5 ops/sec): 28.5 MB/s
Did 317000 ChaCha20-Poly1305 (1350 bytes) seal operations in 1001579us (316500.2 ops/sec): 427.3 MB/s
Did 62000 ChaCha20-Poly1305 (8192 bytes) seal operations in 1012146us (61256.0 ops/sec): 501.8 MB/s
Did 1778000 ChaCha20-Poly1305-Old (16 bytes) seal operations in 1000220us (1777608.9 ops/sec): 28.4 MB/s
Did 315000 ChaCha20-Poly1305-Old (1350 bytes) seal operations in 1002886us (314093.5 ops/sec): 424.0 MB/s
Did 71000 ChaCha20-Poly1305-Old (8192 bytes) seal operations in 1014606us (69977.9 ops/sec): 573.3 MB/s
New:
Did 1866000 ChaCha20-Poly1305 (16 bytes) seal operations in 1000019us (1865964.5 ops/sec): 29.9 MB/s
Did 399000 ChaCha20-Poly1305 (1350 bytes) seal operations in 1001017us (398594.6 ops/sec): 538.1 MB/s
Did 84000 ChaCha20-Poly1305 (8192 bytes) seal operations in 1005645us (83528.5 ops/sec): 684.3 MB/s
Did 1881000 ChaCha20-Poly1305-Old (16 bytes) seal operations in 1000325us (1880388.9 ops/sec): 30.1 MB/s
Did 404000 ChaCha20-Poly1305-Old (1350 bytes) seal operations in 1000004us (403998.4 ops/sec): 545.4 MB/s
Did 85000 ChaCha20-Poly1305-Old (8192 bytes) seal operations in 1010048us (84154.4 ops/sec): 689.4 MB/s

x86_64, AVX2
---
Old:
Did 2375000 ChaCha20-Poly1305 (16 bytes) seal operations in 1000282us (2374330.4 ops/sec): 38.0 MB/s
Did 448000 ChaCha20-Poly1305 (1350 bytes) seal operations in 1001865us (447166.0 ops/sec): 603.7 MB/s
Did 88000 ChaCha20-Poly1305 (8192 bytes) seal operations in 1005217us (87543.3 ops/sec): 717.2 MB/s
Did 2409000 ChaCha20-Poly1305-Old (16 bytes) seal operations in 1000188us (2408547.2 ops/sec): 38.5 MB/s
Did 446000 ChaCha20-Poly1305-Old (1350 bytes) seal operations in 1001003us (445553.1 ops/sec): 601.5 MB/s
Did 90000 ChaCha20-Poly1305-Old (8192 bytes) seal operations in 1006722us (89399.1 ops/sec): 732.4 MB/s
New:
Did 2622000 ChaCha20-Poly1305 (16 bytes) seal operations in 1000266us (2621302.7 ops/sec): 41.9 MB/s
Did 794000 ChaCha20-Poly1305 (1350 bytes) seal operations in 1000783us (793378.8 ops/sec): 1071.1 MB/s
Did 173000 ChaCha20-Poly1305 (8192 bytes) seal operations in 1000176us (172969.6 ops/sec): 1417.0 MB/s
Did 2623000 ChaCha20-Poly1305-Old (16 bytes) seal operations in 1000330us (2622134.7 ops/sec): 42.0 MB/s
Did 783000 ChaCha20-Poly1305-Old (1350 bytes) seal operations in 1000531us (782584.4 ops/sec): 1056.5 MB/s
Did 174000 ChaCha20-Poly1305-Old (8192 bytes) seal operations in 1000840us (173854.0 ops/sec): 1424.2 MB/s

arm, Nexus 4
---
Old:
Did 388550 ChaCha20-Poly1305 (16 bytes) seal operations in 1000580us (388324.8 ops/sec): 6.2 MB/s
Did 90000 ChaCha20-Poly1305 (1350 bytes) seal operations in 1003816us (89657.9 ops/sec): 121.0 MB/s
Did 19000 ChaCha20-Poly1305 (8192 bytes) seal operations in 1045750us (18168.8 ops/sec): 148.8 MB/s
Did 398500 ChaCha20-Poly1305-Old (16 bytes) seal operations in 1000305us (398378.5 ops/sec): 6.4 MB/s
Did 90500 ChaCha20-Poly1305-Old (1350 bytes) seal operations in 1000305us (90472.4 ops/sec): 122.1 MB/s
Did 19000 ChaCha20-Poly1305-Old (8192 bytes) seal operations in 1043278us (18211.8 ops/sec): 149.2 MB/s
New:
Did 424788 ChaCha20-Poly1305 (16 bytes) seal operations in 1000641us (424515.9 ops/sec): 6.8 MB/s
Did 115000 ChaCha20-Poly1305 (1350 bytes) seal operations in 1001526us (114824.8 ops/sec): 155.0 MB/s
Did 27000 ChaCha20-Poly1305 (8192 bytes) seal operations in 1033023us (26136.9 ops/sec): 214.1 MB/s
Did 447750 ChaCha20-Poly1305-Old (16 bytes) seal operations in 1000549us (447504.3 ops/sec): 7.2 MB/s
Did 117500 ChaCha20-Poly1305-Old (1350 bytes) seal operations in 1001923us (117274.5 ops/sec): 158.3 MB/s
Did 27000 ChaCha20-Poly1305-Old (8192 bytes) seal operations in 1025118us (26338.4 ops/sec): 215.8 MB/s

aarch64, Nexus 6p
(Note we didn't have aarch64 assembly before at all, and still don't have it
for Poly1305. Hopefully once that's added this will be faster than the arm
numbers...)
---
Old:
Did 145040 ChaCha20-Poly1305 (16 bytes) seal operations in 1003065us (144596.8 ops/sec): 2.3 MB/s
Did 14000 ChaCha20-Poly1305 (1350 bytes) seal operations in 1042605us (13427.9 ops/sec): 18.1 MB/s
Did 2618 ChaCha20-Poly1305 (8192 bytes) seal operations in 1093241us (2394.7 ops/sec): 19.6 MB/s
Did 148000 ChaCha20-Poly1305-Old (16 bytes) seal operations in 1000709us (147895.1 ops/sec): 2.4 MB/s
Did 14000 ChaCha20-Poly1305-Old (1350 bytes) seal operations in 1047294us (13367.8 ops/sec): 18.0 MB/s
Did 2607 ChaCha20-Poly1305-Old (8192 bytes) seal operations in 1090745us (2390.1 ops/sec): 19.6 MB/s
New:
Did 358000 ChaCha20-Poly1305 (16 bytes) seal operations in 1000769us (357724.9 ops/sec): 5.7 MB/s
Did 45000 ChaCha20-Poly1305 (1350 bytes) seal operations in 1021267us (44062.9 ops/sec): 59.5 MB/s
Did 8591 ChaCha20-Poly1305 (8192 bytes) seal operations in 1047136us (8204.3 ops/sec): 67.2 MB/s
Did 343000 ChaCha20-Poly1305-Old (16 bytes) seal operations in 1000489us (342832.4 ops/sec): 5.5 MB/s
Did 44000 ChaCha20-Poly1305-Old (1350 bytes) seal operations in 1008326us (43636.7 ops/sec): 58.9 MB/s
Did 8866 ChaCha20-Poly1305-Old (8192 bytes) seal operations in 1083341us (8183.9 ops/sec): 67.0 MB/s

Change-Id: I629fe195d072f2c99e8f947578fad6d70823c4c8
Reviewed-on: https://boringssl-review.googlesource.com/7202
Reviewed-by: Adam Langley <agl@google.com>
2016-02-23 17:19:45 +00:00
nmittler
042e8f721a Updating BUILDING.md for windows.
Updating the Perl docs to describe behavior of Strawberry Perl and possible
interaction with CMake on Windows.

Also adding a few other links and instructions for using CMake/Ninja to build
release mode with position independent code, since this seems generally useful.

Change-Id: I616c0d267da749fe90673bc9e8bde9ec181fec25
Reviewed-on: https://boringssl-review.googlesource.com/7113
Reviewed-by: David Benjamin <davidben@google.com>
2016-02-10 17:42:36 +00:00
David Benjamin
2c71ce135c Update some URLs in BUILDING.md.
Change-Id: Ic7aa22b10d2d69bdc3a548273640574203e93012
Reviewed-on: https://boringssl-review.googlesource.com/7071
Reviewed-by: Adam Langley <agl@google.com>
2016-02-08 18:12:56 +00:00
Brian Smith
3f7ec62b38 Update BUILDING.md. 2015-12-06 10:33:52 -10:00
Brian Smith
0f56792db9 Merge BoringSSL dff504d: Make the instructions for downloading the ARM compiler easier to copy. 2015-11-07 16:42:35 -10:00
Adam Langley
dff504d39a Make the instructions for downloading the ARM compiler easier to copy and paste.
Change-Id: If78cba6abc36999488981db2a12b039024c757df
Reviewed-on: https://boringssl-review.googlesource.com/6391
Reviewed-by: Brian Smith <brian@briansmith.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
2015-10-30 20:47:08 +00:00
Brian Smith
a7f1480027 Merge BoringSSL 953cfc8: Document how to regenerate crypto/chacha/chacha_vec_arm.S. 2015-10-27 20:50:24 -10:00
Adam Langley
2e3c978d14 Add OPENSSL_SMALL.
Intel's P-256 code has very large tables and things like Chromium just
don't need that extra size. However, servers generally do so this change
adds an OPENSSL_SMALL define that currently just drops the 64-bit P-224
but will gate Intel's P-256 in the future too.

Change-Id: I2e55c6e06327fafabef9b96d875069d95c0eea81
Reviewed-on: https://boringssl-review.googlesource.com/6362
Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-27 16:40:20 +00:00
Brian Smith
953cfc837f Document how to regenerate crypto/chacha/chacha_vec_arm.S.
Also, organize the links in BUILDING.md sensibly.

Change-Id: Ie9c65750849fcdab7a6a6bf11d1c9cdafb53bc00
Reviewed-on: https://boringssl-review.googlesource.com/6140
Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-26 23:29:57 +00:00
David Benjamin
301afaf223 Add a run_tests target to run all tests.
It's very annoying having to remember the right incant every time I want
to switch around between my build, build-release, build-asan, etc.,
output directories.

Unfortunately, this target is pretty unfriendly without CMake 3.2+ (and
Ninja 1.5+). This combination gives a USES_TERMINAL flag to
add_custom_target which uses Ninja's "console" pool, otherwise the
output buffering gets in the way. Ubuntu LTS is still on an older CMake,
so do a version check in the meantime.

CMake also has its own test mechanism (CTest), but this doesn't use it.
It seems to prefer knowing what all the tests are and then tries to do
its own output management and parallelizing and such. We already have
our own runners. all_tests.go could actually be converted tidily, but
generate_build_files.py also needs to read it, and runner.go has very
specific needs.

Naming the target ninja -C build test would be nice, but CTest squats
that name and CMake grumps when you use a reserved name, so I've gone
with run_tests.

Change-Id: Ibd20ebd50febe1b4e91bb19921f3bbbd9fbcf66c
Reviewed-on: https://boringssl-review.googlesource.com/6270
Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-26 20:33:44 +00:00
Adam Langley
6a7cfbe06a Allow ARM capabilities to be set at compile time.
Some ARM environments don't support |getauxval| or signals and need to
configure the capabilities of the chip at compile time. This change adds
defines that allow them to do so.

Change-Id: I4e6987f69dd13444029bc7ac7ed4dbf8fb1faa76
Reviewed-on: https://boringssl-review.googlesource.com/6280
Reviewed-by: Adam Langley <agl@google.com>
2015-10-20 22:40:15 +00:00
Adam Langley
dc7e9c4043 Make the runner tests a go “test”
This change makes the runner tests (in ssl/test/runner) act like a
normal Go test rather than being a Go binary. This better aligns with
some internal tools.

Thus, from this point onwards, one has to run the runner tests with `go
test` rather than `go run` or `go build && ./runner`.

This will break the bots.

Change-Id: Idd72c31e8e0c2b7ed9939dacd3b801dbd31710dd
Reviewed-on: https://boringssl-review.googlesource.com/6009
Reviewed-by: Matt Braithwaite <mab@google.com>
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
2015-09-30 17:10:45 +00:00
Brian Smith
b119df5ffa Improve README.md and BUILDIND.md. 2015-09-17 23:12:53 -07:00
David Benjamin
95aaf4a61c Markdown-ify BUILDING.
Change-Id: Icd3cba6522ce47a4dfe699204982b5b692d3d62e
Reviewed-on: https://boringssl-review.googlesource.com/5811
Reviewed-by: Adam Langley <agl@google.com>
2015-09-03 18:38:21 +00:00
Brian Smith
0b23f8cf9e Rename the C library to "ring-core", rename Rust crate to "ring".
The Rust crate can't be named "ring" if it links to a C library called
"ring".
2015-08-26 21:18:41 -07:00
Brian Smith
20b97a69a9 Rust: Add API for calculating digests (SHA-256, etc.). 2015-08-26 21:18:37 -07:00
Brian Smith
6b4b2ed375 Allow the ABI part of |TARGET| to be omitted for Darwin. 2015-08-26 21:18:36 -07:00
Brian Smith
46dea05fb3 Rename libring.lib to ring.lib on Windows.
Rust's native library integration works best when the library is named
<foo>.lib on Windows and lib<foo>.lib on other platforms.
2015-08-26 21:18:35 -07:00
Brian Smith
eb838e4e93 Get ARM builds working better. 2015-08-26 21:18:34 -07:00
Brian Smith
bec4c9cf5c Make RELWITHDEBINFO the default configuration, instead of DEBUG. 2015-08-26 21:18:33 -07:00
Brian Smith
0b191d69d0 Improve multi-targetting infrastructure.
Make the Makefile require a standard
|TARGET=<arch>-<vendor>-<sys>-<abi>| variable to be set instead of
requiring |TARGET_OS| and |TARGET_ARCH_BASE|.

Also, have the Makefile generate outputs to a subdirectory of build/
that names the target and compiler. This will make it easier and less
error-prone to test multiple configurations using a single source tree,
and will make some future cross-compilation targets easier.
2015-08-26 21:18:33 -07:00
Brian Smith
0c597a4343 Add the |TARGET_OS| build option to facilitate Mac OS X builds.
Carl Mehner reported that the build fails on Mac OS X using its
normal Apple Clang toolchain because that toolchain requires a slightly
different set of perlasm and linker options.

This commit introduces the |TARGET_OS| build option to allow us to make
operating-system-dependent choices during the build. It isn't ideal to
use |TARGET_OS| for this problem because it's really an issue with the
toolchain (a host issue), but this seems to be a reasonable first step
while we figure out a long-term solution.
2015-08-26 21:18:32 -07:00
Brian Smith
2586d07947 Rename the |ARCH| build option to |TARGET_ARCH_BASE|.
This change is being made in preparation for adding a |TARGET_OS| build
option. |TARGET_ARCH_BASE| is used to decide which assembly language
code to compile, and to set |TARGET_ARCH| (the target flags passed to
the compilers and linker) if it isn't already set.
2015-08-26 21:18:31 -07:00
Brian Smith
51618b4e4a Update documentation; fix RING_LDLIBS. 2015-08-26 21:18:24 -07:00