257 Commits

Author SHA1 Message Date
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
Brian Smith
c28c11a4b7 Allow unused_qualifications to work around libstd bug. 2016-10-25 20:54:21 -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
Vadim Petrochenkov
5a2c0a2006 Remove use of lint match_of_unit_variant_via_paren_dotdot.
Rust is removing this lint.
2016-10-05 11:23:18 -10:00
Brian Smith
5212701f46 Fix build breakage with Rust Nightly.
`drop_with_repr_extern` was removed when Drop flags were removed.
2016-08-26 23:15:24 -10:00
Brian Smith
8fcfeb315e Windows: Copy pregenerated asm lib to lib dir.
Cargo/rustc wasn't resolving "pregenerated" to an absolute path, so
while the previous scheme for finding the pregenerated libraries worked
for "sh mk/package.sh", it didn't work when building other libraries,
when the current working directory isn't the *ring* source directory.
2016-08-15 15:24:09 -10:00
Brian Smith
d59b70cec3 Windows: Don't require msbuild.exe to be in %PATH%. 2016-08-15 13:27:43 -10:00
Brian Smith
caa4df6e68 Prepare for publishing on crates.io. 2016-08-15 12:38:08 -10:00
Brian Smith
f8bb8677e9 Windows: Split assembly language components into seperate static lib. 2016-08-14 20:24:43 -10:00
Brian Smith
cf6dfad269 Remove the dependency on the num crate.
Now we don't have to trust that `num` is doing the math correctly. The
code generator is going away anyway. It's a good idea in theory but in
practice it wasn't worth its complexity.
2016-07-03 10:38:08 -10:00
Brian Smith
887f9f028a Move ec_build submodule to be under ring::ec::suite_b.
It is Suite-B-curve-specific, so it belongs there.
2016-06-02 11:18:09 -10:00
Brian Smith
528777b088 Fold src/ec/curves.rs into src/ec/ec_build.rs.
Originally it was thought that curves.rs might be reused by *ring*
proper, as well as by the build system. Also, we thought that curves.rs
might be generated by some too. However, now we know that niether will
happen any time soon, so there's no reason for curves.rs to be
separate.
2016-06-02 11:16:08 -10:00
Brian Smith
180ef8a7d9 Move ECC code generation to src/ec/ with the other Rust ECC code. 2016-05-23 17:11:25 -10:00
Brian Smith
4165289b36 Use one process for all tests.
Instead of building the test suites inherited from BoringSSL as
seperate executables, link them all together into one executable,
giving all their `main` functions unique names.

This allows all the tests to be run, even on platforms that don't have
traditional process spawning, and avoids the need to keep track of
directory names even on platforms that do support process spawning.

This also makes it easier to integrate new BoringSSL test suites on
Windows, because we don't need to create a new `vcxproj` file for each
one.

Having one test executable may also make code coverage easier.
2016-04-16 18:55:05 -10:00
Brian Smith
57ebe5d225 Put #[path] attributes on same line. 2016-02-25 18:26:03 -10:00
Brian Smith
338d2d0796 Build C code in debug mode when not using --release.
In particular, enable C assertions in debug builds.
2016-02-25 12:00:32 -10:00
Brian Smith
17393444ef Enable more lints and make them fatal.
Basically, all the lints output by `rustc -W help` were added to
`#![deny(...)]` lists in build.rs and lib.rs. Lints that currently
fail because we do not want to follow the pattern they advise were
added to `#![allow(...)]` lists. Lints that currently fail due to
(minor) problems with the code were also added to the `#![allow(...)]`
lists with `// TODO` comments. Each of those TODOs will be addressed in
the following commits.
2016-02-04 21:54:20 -10:00