diff options
author | 2025-01-07 01:45:14 +0000 | |
---|---|---|
committer | 2025-01-07 17:42:42 +0000 | |
commit | f67d211c0b948787f0897ff0964011ddd7cab9a3 (patch) | |
tree | 276c341d5f60362418fdb35b49b560b5a79d5002 /rust/library_test.go | |
parent | 5a4f022c9d8fed286e891fb77b3ab2d59138aafa (diff) |
rust: Force all dependencies to be linked, used or not
`rustc` added an unstable feature that makes `--extern` do what we
originally wanted - it links the provided library, *even* if the source
code does not reference it.
The primary use case for this is that it makes it possible for us to
build dylibs out of `#![no_std]` crates without modifying the source,
because we can pass in `--extern force:path/to/libstd.dylib.so`.
Bug: 168927099
Test: m, TH
Change-Id: Ibc3b75012d54b73e40ae609784cdc74e02e8f008
Diffstat (limited to 'rust/library_test.go')
-rw-r--r-- | rust/library_test.go | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/rust/library_test.go b/rust/library_test.go index 256cb355c..e5fd5e018 100644 --- a/rust/library_test.go +++ b/rust/library_test.go @@ -89,22 +89,6 @@ func TestDylibPreferDynamic(t *testing.T) { } } -// Check that we are passing the android_dylib config flag -func TestAndroidDylib(t *testing.T) { - ctx := testRust(t, ` - rust_library_host_dylib { - name: "libfoo", - srcs: ["foo.rs"], - crate_name: "foo", - }`) - - libfooDylib := ctx.ModuleForTests("libfoo", "linux_glibc_x86_64_dylib").Rule("rustc") - - if !strings.Contains(libfooDylib.Args["rustcFlags"], "--cfg 'android_dylib'") { - t.Errorf("missing android_dylib cfg flag for libfoo dylib, rustcFlags: %#v", libfooDylib.Args["rustcFlags"]) - } -} - func TestValidateLibraryStem(t *testing.T) { testRustError(t, "crate_name must be defined.", ` rust_library_host { |