@@ -9,6 +9,7 @@ use crate::shims::alloc::EvalContextExt as _;
9
9
use crate :: shims:: unix:: * ;
10
10
use crate :: * ;
11
11
12
+ use shims:: unix:: android:: foreign_items as android;
12
13
use shims:: unix:: freebsd:: foreign_items as freebsd;
13
14
use shims:: unix:: linux:: foreign_items as linux;
14
15
use shims:: unix:: macos:: foreign_items as macos;
@@ -26,6 +27,7 @@ pub fn is_dyn_sym(name: &str, target_os: &str) -> bool {
26
27
// Give specific OSes a chance to allow their symbols.
27
28
_ =>
28
29
match target_os {
30
+ "android" => android:: is_dyn_sym ( name) ,
29
31
"freebsd" => freebsd:: is_dyn_sym ( name) ,
30
32
"linux" => linux:: is_dyn_sym ( name) ,
31
33
"macos" => macos:: is_dyn_sym ( name) ,
@@ -267,7 +269,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
267
269
268
270
"reallocarray" => {
269
271
// Currently this function does not exist on all Unixes, e.g. on macOS.
270
- if !matches ! ( & * this. tcx. sess. target. os, "linux" | "freebsd" ) {
272
+ if !matches ! ( & * this. tcx. sess. target. os, "linux" | "freebsd" | "android" ) {
271
273
throw_unsup_format ! (
272
274
"`reallocarray` is not supported on {}" ,
273
275
this. tcx. sess. target. os
@@ -593,7 +595,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
593
595
"getentropy" => {
594
596
// This function is non-standard but exists with the same signature and behavior on
595
597
// Linux, macOS, FreeBSD and Solaris/Illumos.
596
- if !matches ! ( & * this. tcx. sess. target. os, "linux" | "macos" | "freebsd" | "illumos" | "solaris" ) {
598
+ if !matches ! ( & * this. tcx. sess. target. os, "linux" | "macos" | "freebsd" | "illumos" | "solaris" | "android" ) {
597
599
throw_unsup_format ! (
598
600
"`getentropy` is not supported on {}" ,
599
601
this. tcx. sess. target. os
@@ -622,9 +624,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
622
624
"getrandom" => {
623
625
// This function is non-standard but exists with the same signature and behavior on
624
626
// Linux, FreeBSD and Solaris/Illumos.
625
- if !matches ! ( & * this. tcx. sess. target. os, "linux" | "freebsd" | "illumos" | "solaris" ) {
627
+ if !matches ! ( & * this. tcx. sess. target. os, "linux" | "freebsd" | "illumos" | "solaris" | "android" ) {
626
628
throw_unsup_format ! (
627
- "`getentropy ` is not supported on {}" ,
629
+ "`getrandom ` is not supported on {}" ,
628
630
this. tcx. sess. target. os
629
631
) ;
630
632
}
@@ -748,6 +750,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
748
750
_ => {
749
751
let target_os = & * this. tcx . sess . target . os ;
750
752
return match target_os {
753
+ "android" => android:: EvalContextExt :: emulate_foreign_item_inner ( this, link_name, abi, args, dest) ,
751
754
"freebsd" => freebsd:: EvalContextExt :: emulate_foreign_item_inner ( this, link_name, abi, args, dest) ,
752
755
"linux" => linux:: EvalContextExt :: emulate_foreign_item_inner ( this, link_name, abi, args, dest) ,
753
756
"macos" => macos:: EvalContextExt :: emulate_foreign_item_inner ( this, link_name, abi, args, dest) ,
0 commit comments