Skip to content

Commit

Permalink
fixes for building on 32 bit host systems
Browse files Browse the repository at this point in the history
  • Loading branch information
irixxxx authored and queueRAM committed Jul 23, 2019
1 parent 4cb644d commit b9d1f49
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
1 change: 1 addition & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -6836,6 +6836,7 @@ case "$target_name" in
solaris)
TARGET_ARCH=sparc
TARGET_ABI_DIR=solaris
TARGET_BASE_ARCH=sparc
echo "TARGET_ABI_SOLARIS=y" >> $config_target_mak
;;
solaris64)
Expand Down
6 changes: 6 additions & 0 deletions linux-user/elfload.c
Original file line number Diff line number Diff line change
Expand Up @@ -2067,6 +2067,8 @@ abi_ulong sgi_map_elf_image(int image_fd, struct elf_phdr *phdr, int phnum)
}
}

mmap_lock();

/* The image indicates that it can be loaded anywhere. Find a
location that can hold the memory space required. If the
image is pre-linked, LOADDR will be non-zero. Since we do
Expand Down Expand Up @@ -2113,9 +2115,13 @@ abi_ulong sgi_map_elf_image(int image_fd, struct elf_phdr *phdr, int phnum)
}
}

mmap_unlock();

return load_bias + phdr[0].p_vaddr;

exit_perror:
mmap_unlock();

errmsg = strerror(errno);
fprintf(stderr, "error in syssgi elfmap: %s\n", errmsg);
return -ENOEXEC;
Expand Down
14 changes: 7 additions & 7 deletions linux-user/syscall_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ struct target_stat {
abi_long target_st_ctime;
abi_ulong __unused3;
abi_int st_blksize;
int64_t st_blocks;
abi_llong st_blocks;
char st_fstype[16];
abi_long __unused4[8];
};
Expand All @@ -1631,22 +1631,22 @@ struct target_stat {
struct target_stat64 {
abi_ulong st_dev;
abi_long st_pad1[3];
uint64_t st_ino;
abi_ullong st_ino;
abi_uint st_mode;
abi_uint st_nlink;
abi_int st_uid;
abi_int st_gid;
abi_ulong st_rdev;
abi_long st_pad2[2];
int64_t st_size;
abi_llong st_size;
abi_long target_st_atime;
abi_ulong __unused1;
abi_long target_st_mtime;
abi_ulong __unused2;
abi_long target_st_ctime;
abi_ulong __unused3;
abi_int st_blksize;
int64_t st_blocks;
abi_llong st_blocks;
char st_fstype[16];
abi_long __unused4[8];
};
Expand Down Expand Up @@ -1977,7 +1977,7 @@ struct target_stat {
struct target_stat64 {
uint32_t st_dev;
abi_long st_pad0[3]; /* Reserved for st_dev expansion */
uint64_t st_ino;
abi_ullong st_ino;

uint32_t st_mode;
uint32_t st_nlink;
Expand All @@ -1987,7 +1987,7 @@ struct target_stat64 {

uint32_t st_rdev;
abi_long st_pad1[2]; /* Reserved for st_rdev expansion */
int64_t st_size;
abi_llong st_size;
abi_long st_pad2;

/*
Expand All @@ -2004,7 +2004,7 @@ struct target_stat64 {
abi_long target_st_ctime_nsec;

abi_long st_blksize;
int64_t st_blocks;
abi_llong st_blocks;
char st_fstype[16];
abi_long st_projid;
abi_long st_pad[7];
Expand Down
9 changes: 9 additions & 0 deletions tcg/i386/tcg-target.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2696,6 +2696,12 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_x86_packus_vec:
insn = packus_insn[vece];
goto gen_simd;
#if TCG_TARGET_REG_BITS == 32
case INDEX_op_dup2_vec:
/* Constraints have already placed both 32-bit inputs in xmm regs. */
insn = OPC_PUNPCKLDQ;
goto gen_simd;
#endif
gen_simd:
tcg_debug_assert(insn != OPC_UD2);
if (type == TCG_TYPE_V256) {
Expand Down Expand Up @@ -3045,6 +3051,9 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode op)
case INDEX_op_x86_vperm2i128_vec:
case INDEX_op_x86_punpckl_vec:
case INDEX_op_x86_punpckh_vec:
#if TCG_TARGET_REG_BITS == 32
case INDEX_op_dup2_vec:
#endif
return &x_x_x;
case INDEX_op_dup_vec:
case INDEX_op_shli_vec:
Expand Down

0 comments on commit b9d1f49

Please sign in to comment.