mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-23 05:31:32 +00:00
Fix compilation on AArch64 Linux.
This commit is contained in:
@ -97,7 +97,7 @@ pub fn ___syscall6(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int
|
||||
pub fn ___syscall12(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
|
||||
debug!("emscripten::___syscall12 (chdir) {}", _which);
|
||||
let path_ptr = varargs.get_str(ctx);
|
||||
let real_path_owned = get_cstr_path(ctx, path_ptr);
|
||||
let real_path_owned = get_cstr_path(ctx, path_ptr as *const _);
|
||||
let real_path = if let Some(ref rp) = real_path_owned {
|
||||
rp.as_c_str().as_ptr()
|
||||
} else {
|
||||
@ -168,13 +168,13 @@ pub fn ___syscall38(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> i32 {
|
||||
debug!("emscripten::___syscall38 (rename)");
|
||||
let old_path = varargs.get_str(ctx);
|
||||
let new_path = varargs.get_str(ctx);
|
||||
let real_old_path_owned = get_cstr_path(ctx, old_path);
|
||||
let real_old_path_owned = get_cstr_path(ctx, old_path as *const _);
|
||||
let real_old_path = if let Some(ref rp) = real_old_path_owned {
|
||||
rp.as_c_str().as_ptr()
|
||||
} else {
|
||||
old_path
|
||||
};
|
||||
let real_new_path_owned = get_cstr_path(ctx, new_path);
|
||||
let real_new_path_owned = get_cstr_path(ctx, new_path as *const _);
|
||||
let real_new_path = if let Some(ref rp) = real_new_path_owned {
|
||||
rp.as_c_str().as_ptr()
|
||||
} else {
|
||||
@ -194,7 +194,7 @@ pub fn ___syscall38(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> i32 {
|
||||
pub fn ___syscall40(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
|
||||
debug!("emscripten::___syscall40 (rmdir)");
|
||||
let pathname_addr = varargs.get_str(ctx);
|
||||
let real_path_owned = get_cstr_path(ctx, pathname_addr);
|
||||
let real_path_owned = get_cstr_path(ctx, pathname_addr as *const _);
|
||||
let real_path = if let Some(ref rp) = real_path_owned {
|
||||
rp.as_c_str().as_ptr()
|
||||
} else {
|
||||
@ -359,7 +359,7 @@ pub fn ___syscall183(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> i32
|
||||
|
||||
let buf_writer = buf_offset.deref(ctx.memory(0), 0, len as u32 + 1).unwrap();
|
||||
for (i, byte) in path_string.bytes().enumerate() {
|
||||
buf_writer[i].set(byte as i8);
|
||||
buf_writer[i].set(byte as _);
|
||||
}
|
||||
buf_writer[len].set(0);
|
||||
buf_offset.offset() as i32
|
||||
@ -535,7 +535,7 @@ pub fn ___syscall195(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
|
||||
let pathname_addr = varargs.get_str(ctx);
|
||||
let buf: u32 = varargs.get(ctx);
|
||||
|
||||
let real_path_owned = get_cstr_path(ctx, pathname_addr);
|
||||
let real_path_owned = get_cstr_path(ctx, pathname_addr as *const _);
|
||||
let real_path = if let Some(ref rp) = real_path_owned {
|
||||
rp.as_c_str().as_ptr()
|
||||
} else {
|
||||
|
@ -146,7 +146,7 @@ pub fn ___syscall5(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int
|
||||
let pathname_addr = varargs.get_str(ctx);
|
||||
let flags: i32 = varargs.get(ctx);
|
||||
let mode: u32 = varargs.get(ctx);
|
||||
let real_path_owned = utils::get_cstr_path(ctx, pathname_addr);
|
||||
let real_path_owned = utils::get_cstr_path(ctx, pathname_addr as *const _);
|
||||
let real_path = if let Some(ref rp) = real_path_owned {
|
||||
rp.as_c_str().as_ptr()
|
||||
} else {
|
||||
@ -198,13 +198,13 @@ pub fn ___syscall83(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int
|
||||
|
||||
let path1 = varargs.get_str(ctx);
|
||||
let path2 = varargs.get_str(ctx);
|
||||
let real_path1_owned = utils::get_cstr_path(ctx, path1);
|
||||
let real_path1_owned = utils::get_cstr_path(ctx, path1 as *const _);
|
||||
let real_path1 = if let Some(ref rp) = real_path1_owned {
|
||||
rp.as_c_str().as_ptr()
|
||||
} else {
|
||||
path1
|
||||
};
|
||||
let real_path2_owned = utils::get_cstr_path(ctx, path2);
|
||||
let real_path2_owned = utils::get_cstr_path(ctx, path2 as *const _);
|
||||
let real_path2 = if let Some(ref rp) = real_path2_owned {
|
||||
rp.as_c_str().as_ptr()
|
||||
} else {
|
||||
@ -227,7 +227,7 @@ pub fn ___syscall85(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> i32 {
|
||||
let buf = varargs.get_str(ctx);
|
||||
// let buf_addr: i32 = varargs.get(ctx);
|
||||
let buf_size: i32 = varargs.get(ctx);
|
||||
let real_path_owned = get_cstr_path(ctx, pathname_addr);
|
||||
let real_path_owned = get_cstr_path(ctx, pathname_addr as *const _);
|
||||
let real_path = if let Some(ref rp) = real_path_owned {
|
||||
rp.as_c_str().as_ptr()
|
||||
} else {
|
||||
@ -266,7 +266,7 @@ pub fn ___syscall194(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
|
||||
pub fn ___syscall198(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
|
||||
debug!("emscripten::___syscall198 (lchown) {}", _which);
|
||||
let path_ptr = varargs.get_str(ctx);
|
||||
let real_path_owned = utils::get_cstr_path(ctx, path_ptr);
|
||||
let real_path_owned = utils::get_cstr_path(ctx, path_ptr as *const _);
|
||||
let real_path = if let Some(ref rp) = real_path_owned {
|
||||
rp.as_c_str().as_ptr()
|
||||
} else {
|
||||
@ -307,7 +307,7 @@ pub fn ___syscall212(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
|
||||
debug!("emscripten::___syscall212 (chown) {}", _which);
|
||||
|
||||
let pathname_addr = varargs.get_str(ctx);
|
||||
let real_path_owned = utils::get_cstr_path(ctx, pathname_addr);
|
||||
let real_path_owned = utils::get_cstr_path(ctx, pathname_addr as *const _);
|
||||
let real_path = if let Some(ref rp) = real_path_owned {
|
||||
rp.as_c_str().as_ptr()
|
||||
} else {
|
||||
@ -336,7 +336,7 @@ pub fn ___syscall219(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
|
||||
pub fn ___syscall33(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
|
||||
debug!("emscripten::___syscall33 (access) {}", _which);
|
||||
let path = varargs.get_str(ctx);
|
||||
let real_path_owned = utils::get_cstr_path(ctx, path);
|
||||
let real_path_owned = utils::get_cstr_path(ctx, path as *const _);
|
||||
let real_path = if let Some(ref rp) = real_path_owned {
|
||||
rp.as_c_str().as_ptr()
|
||||
} else {
|
||||
@ -364,7 +364,7 @@ pub fn ___syscall34(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int
|
||||
pub fn ___syscall39(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
|
||||
debug!("emscripten::___syscall39 (mkdir) {}", _which);
|
||||
let pathname_addr = varargs.get_str(ctx);
|
||||
let real_path_owned = utils::get_cstr_path(ctx, pathname_addr);
|
||||
let real_path_owned = utils::get_cstr_path(ctx, pathname_addr as *const _);
|
||||
let real_path = if let Some(ref rp) = real_path_owned {
|
||||
rp.as_c_str().as_ptr()
|
||||
} else {
|
||||
@ -986,7 +986,7 @@ pub fn ___syscall122(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
|
||||
pub fn ___syscall196(ctx: &mut Ctx, _which: i32, mut varargs: VarArgs) -> i32 {
|
||||
debug!("emscripten::___syscall196 (lstat64) {}", _which);
|
||||
let path = varargs.get_str(ctx);
|
||||
let real_path_owned = utils::get_cstr_path(ctx, path);
|
||||
let real_path_owned = utils::get_cstr_path(ctx, path as *const _);
|
||||
let real_path = if let Some(ref rp) = real_path_owned {
|
||||
rp.as_c_str().as_ptr()
|
||||
} else {
|
||||
@ -1063,7 +1063,7 @@ pub fn ___syscall220(ctx: &mut Ctx, _which: i32, mut varargs: VarArgs) -> i32 {
|
||||
let upper_bound = std::cmp::min((*dirent).d_reclen, 255) as usize;
|
||||
let mut i = 0;
|
||||
while i < upper_bound {
|
||||
*(dirp.add(pos + 11 + i) as *mut i8) = (*dirent).d_name[i];
|
||||
*(dirp.add(pos + 11 + i) as *mut i8) = (*dirent).d_name[i] as _;
|
||||
i += 1;
|
||||
}
|
||||
// We set the termination string char
|
||||
|
Reference in New Issue
Block a user