73 Commits

Author SHA1 Message Date
Brian Smith
8b026c93f2 Replace C code for serializing Elems with Rust code. 2017-03-19 11:48:57 -10:00
Brian Smith
819ad75b4e Disable bn_test.cc on macOS/iOS to avoid worrying about libc++ vs libstdc++. 2017-03-18 22:56:36 -10:00
Brian Smith
16ad542987 Restore some MSVC flags that were used in the MSBuild-based builds.
"/Ox" implies a lot of the other flags that were passed explicitly.
2017-03-18 17:37:53 -10:00
Brian Smith
ad39dd1623 Enable debug assertions based on $DEBUG, not $PROFILE. 2017-03-18 17:37:51 -10:00
Brian Smith
f7f1fb7773 Remove unused crypto/perlasm/x86masm.pl. 2017-03-18 15:31:16 -10:00
Brian Smith
dd659d2994 Improve Perlasm machinery for SHA-2 on X86-64 and ARMv8.
Rename sha-{x86_64, armv8}.pl back to sha512-{x86_64, armv8}.pl. This
will simplify copmarisons between BoringSSL and *ring*.

Replace the *ring*-specific hacky logic done in Perl with hacky logic
done in Rust. The purpose of this hack is to deal with the fact that
sha512-{x86_64, armv8}.pl need to be run twice, once with "512" in the
output file path to generate
`GFp_sha512_block_data_order`, and again with "256" in the output file
path to generate `GFp_sha256_block_data_order`.
2017-03-18 15:31:15 -10:00
Brian Smith
2dddb44ff0 Pregenerate assembly language object files for Windows on crates.io. 2017-03-18 15:31:14 -10:00
Brian Smith
e757460bed Generalize some library-building logic in buid.rs. 2017-03-18 15:31:14 -10:00
Brian Smith
3cbb4ece26 Simplify asm_path() in build.rs. 2017-03-18 15:31:13 -10:00
Brian Smith
c4698ae457 Use Path instead of PathBuf in build.rs's compile(). 2017-03-18 15:31:13 -10:00
Brian Smith
25add85a54 Use pregenerated asm files when not building from Git. 2017-03-18 15:31:12 -10:00
Brian Smith
495d25f930 Incorporate perlasm format into generated assembly source file names.
This is a step towards supporting builds from crates.io without needing
Perl, by pregenerating the assembly language as part of the packaging
process.
2017-03-18 14:55:01 -10:00
Brian Smith
3ed9cd8f0f Abstract mapping of OS and architecture to PerlAsm target.
This is a step towards pregenerating PerlAsm outputs for use in
crates.io builds.
2017-03-18 14:54:59 -10:00
Brian Smith
ac8999da4d Remove currently-unused crypto/perlasm/ppc-xlate.pl. 2017-03-17 14:29:08 -10:00
Brian Smith
d73b4768e3 Sort file lists in build.rs. 2017-03-17 14:29:07 -10:00
Brian Smith
37ecc31659 Simplify the tracking of #includes in buid.rs. 2017-03-17 14:29:07 -10:00
Brian Smith
acd422c4ce Refactor mapping of source files to architectures in build.rs.
Have one list of source files, instead of a bunch of separate
architecture-specific lists that need to be combined together. This
will simplify the work on pregenerating assembly language sources.
2017-03-17 14:29:06 -10:00
Brian Smith
805c8db797 Remove currently-unused PowerPC source files imported from BoringSSL. 2017-03-16 15:45:40 -10:00
Brian Smith
70e8d3473d Build ring-core and ring-test in parallel instead of sequentially. 2017-03-16 11:25:54 -10:00
Brian Smith
1166b3e19d Use weight_max() for include file modification checking.
I'm not sure this helps but it is consistent with other uses of
parallel iterators in build.rs.
2017-03-16 11:23:53 -10:00
Brian Smith
a69b5198d0 Remove the "cargo:rerun-if-changed" logic from build.rs.
I don't see a significant difference with or without this. If running
the build script is slow at all then we should speed it up.
2017-03-16 10:24:52 -10:00
Brian Smith
f6b58c61ca Always pass ring-core and ring-test to linker, even if only one changed.
Previously build.rs was relying on gcc.rs to output the link metadata
to link ring-core and ring-test. But, if only one of the libraries
changed, then we won't run gcc.rs on the one that didn't change, and
the linker metadata for that unchanged library wouldn't be output,
causing linking to fail due to missing symbols. Fix that by having
build.rs output the linker metadata itself.
2017-03-16 10:16:34 -10:00
Brian Smith
4c1d224821 Improve include file modification checks.
Treat a missing source file as an error, whereas before we were
treating it as indicating that the target needs to be rebuilt. Because
we do dependency checking bottom-up, not top-down, the source file
always exists. If it doesn't, then that's an error. In particular, it
probably means that build.rs lists some source files that have been
removed. (See the previous commit.)

Also, the original purpose of this commit is to memoize the
modification time of the most recently modified include file, instead
of `stat()`ing each include file over and over again for each source
file. So do that too.

Finally, in the name of simplicity, don't bother tracking test vs.
non-test includes separately. It's rare when any include file changes,
and we don't save much by separating things, so K.I.S.S. to reduce the
chance that things get screwed up.
2017-03-16 10:14:22 -10:00
Brian Smith
7bc92063d5 Remove references to non-existent header files.
These entries would cause recompilation to recompile all the C code,
since an error retrieving the files' metadata would trigger a rebuild
of every file. (See the next commit.)
2017-03-16 10:07:04 -10:00
Brian Smith
63691d4245 Revert "Use clang on android."
This reverts commit de8a1636a13f45aaff159ebf041c08e46fb16fd1 because
switching to clang broke something.
2017-03-14 09:36:15 -10:00
Pietro Monteiro
de8a1636a1 Use clang on android.
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2017-03-09 08:51:08 -08:00
Brian Smith
76761a0f8e Use canonical style to define __ANDROID_API__ in build.rs. 2017-03-08 14:01:31 -10:00
Pietro Monteiro
e5982b3ba3 Use Android NDK Unified Headers. 2017-03-08 14:00:08 -10:00
Brian Smith
fb830c4de0 Work around musl libc's lack of _FORTIFY_SOURCE support.
Thanks to Bruce Adams for the bug report and for providing a PR.
(Bruce's PR was for the old Makefile-based system.)
2017-03-05 19:49:48 -10:00
Brian Smith
75b8fba22a Use instead of in build.rs 2017-03-05 19:49:44 -10:00
Brian Smith
b2ed2666e2 Stop using MSBuild on Windows. 2017-03-05 16:36:01 -10:00
Brian Smith
cfdc44ff79 Generalize new PerlAsm logic in build.rs to work for -msvc, others.
This is a step towards dropping the use of MSBuild on Windows. It also
should allow *ring* to build correctly on BSDs and other platforms that
weren't explicitly mentioned.
2017-03-05 16:31:40 -10:00
Brian Smith
5c77732c82 Stop using target_build_utils.
target_build_utils has too many dependencies, which slows down the
initial download/build. It also seems mostly unnecessary since Cargo
now passes the target info in the environment.
2017-03-05 15:10:56 -10:00
Brian Smith
5b4e29abdb Stop defining BORINGSSL_IMPLEMENTATION.
The part of BoringSSL that used this isn't in *ring* any more.
2017-03-05 15:10:56 -10:00
Brian Smith
f66d641657 Print command line for every command executed in build.rs like gcc-rs. 2017-03-05 15:10:55 -10:00
Brian Smith
5efd2ae442 Pass -stdlib=c++ to Clang for Apple targets. 2017-03-05 15:10:55 -10:00
Brian Smith
65eeba2bc8 Remove redundant -fpic C/C++ compiler option.
gcc-rs automatically passes `-fPIC` by default.
2017-03-05 15:10:54 -10:00
Georg Semmler
f72d7c4a06 Only run the build script if something changed.
I agree to license my contributions to each file under the terms
given at the top of each file I changed.
2017-03-05 15:10:54 -10:00
Georg Semmler
5a50c3c0a4 Remove Makefiles, which are now unused.
I agree to license my contributions to each file under the terms
given at the top of each file I changed.
2017-03-05 15:10:53 -10:00
Georg Semmler
f5fc35a7e0 Build native libraries in parallel.
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2017-03-05 15:10:53 -10:00
Brian Smith
55ac79c5d9 Fix Windows build. 2017-03-05 15:10:52 -10:00
Brian Smith
fa55e87b31 Pass out_dir by moving it in build.rs. 2017-03-05 15:10:52 -10:00
Georg Semmler
86c24b9e6b Use only build.rs to build the native libraries for non-Windows builds.
I agree to license my contributions to each file under the terms
given at the top of each file I changed.
2017-03-05 15:10:51 -10:00
Brian Smith
c97bce7ec8 Clean up unnecessary #![allow(...)] in build.rs. 2017-03-04 12:04:43 -10:00
pe@pijul.org
5beeff7e00 Fix build failure caused by breaking change in Nightly rustc. 2017-01-26 09:36:46 -10:00
Evaldas Auryla
095d1076d5 Clang is default on FreeBSD, link with libc++. 2017-01-06 15:47:15 -10:00
Brian Smith
522a78fdc8 Use libc++, not libstdc++, on Mac OS X. 2016-12-22 13:08:01 -10:00
Georg Semmler
a0ee4b5763 Move MSVC build logic to own function.
I agree to license my contributions to each file under the terms given
at the top of each file I changed.

[Tweaked slightly by Brian.]
2016-10-26 14:15:24 -10:00
Brian Smith
f62c2e7dc1 Use std::path::{Path, PathBuf} in build.rs. 2016-10-26 09:58:25 -10:00
Brian Smith
61e6afc87b Reformat build.rs.
Tweak some things that would be poorly reformatted by rustfmt,
then rustfmt.
2016-10-26 09:27:09 -10:00