This repository was archived by the owner on Mar 26, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path0004-Downstream-only-never-use-pre-generated-object-files.patch
More file actions
63 lines (58 loc) · 2.08 KB
/
0004-Downstream-only-never-use-pre-generated-object-files.patch
File metadata and controls
63 lines (58 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--- a/vendor/ring-0.17.9/build.rs
+++ b/vendor/ring-0.17.9/build.rs
@@ -121,8 +121,6 @@
const RING_TEST_SRCS: &[&str] = &[("crypto/constant_time_test.c")];
-const PREGENERATED: &str = "pregenerated";
-
fn cpp_flags(compiler: &cc::Tool) -> &'static [&'static str] {
if !compiler.is_like_msvc() {
static NON_MSVC_FLAGS: &[&str] = &[
@@ -287,16 +285,7 @@
&core_name_and_version
);
- const RING_PREGENERATE_ASM: &str = "RING_PREGENERATE_ASM";
- match env::var_os(RING_PREGENERATE_ASM).as_deref() {
- Some(s) if s == "1" => {
- pregenerate_asm_main(&c_root_dir, &core_name_and_version);
- }
- None => ring_build_rs_main(&c_root_dir, &core_name_and_version),
- _ => {
- panic!("${} has an invalid value", RING_PREGENERATE_ASM);
- }
- }
+ ring_build_rs_main(&c_root_dir, &core_name_and_version)
}
fn ring_build_rs_main(c_root_dir: &Path, core_name_and_version: &str) {
@@ -344,9 +333,12 @@
// If `.git` doesn't exist then assume that this is a packaged build where
// we want to optimize for minimizing the build tools required: No Perl,
// no nasm, etc.
- let generated_dir = if !is_git {
- c_root_dir.join(PREGENERATED)
- } else {
+
+ // Downstream-only: we do not want to package or use pre-generated object
+ // files, even by rebuilding them ourselves rather than using the ones
+ // shipped in the crate.
+ // let use_pregenerated = !is_git;
+ let generated_dir = {
generate_sources_and_preassemble(
&out_dir,
asm_target.into_iter(),
@@ -367,17 +359,6 @@
emit_rerun_if_changed()
}
-fn pregenerate_asm_main(c_root_dir: &Path, core_name_and_version: &str) {
- let pregenerated = c_root_dir.join(PREGENERATED);
- fs::create_dir(&pregenerated).unwrap();
- generate_sources_and_preassemble(
- &pregenerated,
- ASM_TARGETS.iter(),
- c_root_dir,
- core_name_and_version,
- );
-}
-
fn generate_sources_and_preassemble<'a>(
out_dir: &Path,
asm_targets: impl Iterator<Item = &'a AsmTarget>,