From b9d1f4933751cdf31271b6effc1db9d017d54a62 Mon Sep 17 00:00:00 2001 From: kub Date: Thu, 31 May 2018 23:24:21 +0200 Subject: [PATCH] fixes for building on 32 bit host systems --- configure | 1 + linux-user/elfload.c | 6 ++++++ linux-user/syscall_defs.h | 14 +++++++------- tcg/i386/tcg-target.inc.c | 9 +++++++++ 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/configure b/configure index c1be5f3508..bbf8956db2 100755 --- a/configure +++ b/configure @@ -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) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index a8b3962f06..7a670f05b0 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -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 @@ -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; diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index eae23e8ad7..b2c09405f2 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -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]; }; @@ -1631,14 +1631,14 @@ 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; @@ -1646,7 +1646,7 @@ struct target_stat64 { 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]; }; @@ -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; @@ -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; /* @@ -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]; diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c index fc05909d1d..d7e59e79c5 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/tcg-target.inc.c @@ -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) { @@ -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: