@@ -9,6 +9,7 @@ use crate::shims::alloc::EvalContextExt as _;
99use crate :: shims:: unix:: * ;
1010use crate :: * ;
1111
12+ use shims:: unix:: android:: foreign_items as android;
1213use shims:: unix:: freebsd:: foreign_items as freebsd;
1314use shims:: unix:: linux:: foreign_items as linux;
1415use shims:: unix:: macos:: foreign_items as macos;
@@ -26,6 +27,7 @@ pub fn is_dyn_sym(name: &str, target_os: &str) -> bool {
2627 // Give specific OSes a chance to allow their symbols.
2728 _ =>
2829 match target_os {
30+ "android" => android:: is_dyn_sym ( name) ,
2931 "freebsd" => freebsd:: is_dyn_sym ( name) ,
3032 "linux" => linux:: is_dyn_sym ( name) ,
3133 "macos" => macos:: is_dyn_sym ( name) ,
@@ -267,7 +269,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
267269
268270 "reallocarray" => {
269271 // 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" ) {
271273 throw_unsup_format ! (
272274 "`reallocarray` is not supported on {}" ,
273275 this. tcx. sess. target. os
@@ -593,7 +595,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
593595 "getentropy" => {
594596 // This function is non-standard but exists with the same signature and behavior on
595597 // 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" ) {
597599 throw_unsup_format ! (
598600 "`getentropy` is not supported on {}" ,
599601 this. tcx. sess. target. os
@@ -622,9 +624,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
622624 "getrandom" => {
623625 // This function is non-standard but exists with the same signature and behavior on
624626 // 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" ) {
626628 throw_unsup_format ! (
627- "`getentropy ` is not supported on {}" ,
629+ "`getrandom ` is not supported on {}" ,
628630 this. tcx. sess. target. os
629631 ) ;
630632 }
@@ -748,6 +750,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
748750 _ => {
749751 let target_os = & * this. tcx . sess . target . os ;
750752 return match target_os {
753+ "android" => android:: EvalContextExt :: emulate_foreign_item_inner ( this, link_name, abi, args, dest) ,
751754 "freebsd" => freebsd:: EvalContextExt :: emulate_foreign_item_inner ( this, link_name, abi, args, dest) ,
752755 "linux" => linux:: EvalContextExt :: emulate_foreign_item_inner ( this, link_name, abi, args, dest) ,
753756 "macos" => macos:: EvalContextExt :: emulate_foreign_item_inner ( this, link_name, abi, args, dest) ,
0 commit comments