@@ -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
@@ -585,7 +587,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
585587 "getentropy" => {
586588 // This function is non-standard but exists with the same signature and behavior on
587589 // Linux, macOS, FreeBSD and Solaris/Illumos.
588- if !matches ! ( & * this. tcx. sess. target. os, "linux" | "macos" | "freebsd" | "illumos" | "solaris" ) {
590+ if !matches ! ( & * this. tcx. sess. target. os, "linux" | "macos" | "freebsd" | "illumos" | "solaris" | "android" ) {
589591 throw_unsup_format ! (
590592 "`getentropy` is not supported on {}" ,
591593 this. tcx. sess. target. os
@@ -614,9 +616,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
614616 "getrandom" => {
615617 // This function is non-standard but exists with the same signature and behavior on
616618 // Linux, FreeBSD and Solaris/Illumos.
617- if !matches ! ( & * this. tcx. sess. target. os, "linux" | "freebsd" | "illumos" | "solaris" ) {
619+ if !matches ! ( & * this. tcx. sess. target. os, "linux" | "freebsd" | "illumos" | "solaris" | "android" ) {
618620 throw_unsup_format ! (
619- "`getentropy ` is not supported on {}" ,
621+ "`getrandom ` is not supported on {}" ,
620622 this. tcx. sess. target. os
621623 ) ;
622624 }
@@ -740,6 +742,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
740742 _ => {
741743 let target_os = & * this. tcx . sess . target . os ;
742744 return match target_os {
745+ "android" => android:: EvalContextExt :: emulate_foreign_item_inner ( this, link_name, abi, args, dest) ,
743746 "freebsd" => freebsd:: EvalContextExt :: emulate_foreign_item_inner ( this, link_name, abi, args, dest) ,
744747 "linux" => linux:: EvalContextExt :: emulate_foreign_item_inner ( this, link_name, abi, args, dest) ,
745748 "macos" => macos:: EvalContextExt :: emulate_foreign_item_inner ( this, link_name, abi, args, dest) ,
0 commit comments