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.
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.
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.
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.)
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.
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.
- 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.
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.
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.
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.
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.
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.