Fix symbol clash on bunlded static libs
This commit is contained in:
parent
e188591695
commit
2f113b11d1
|
@ -68,7 +68,7 @@ fn build_with_cmake() {
|
|||
let profile = env::var("PROFILE").unwrap();
|
||||
|
||||
if let Some(unicorn_dir) = find_unicorn(&out_dir()) {
|
||||
let rust_build_path = unicorn_dir.join("rust_build");
|
||||
let rust_build_path = unicorn_dir.join("build_rust");
|
||||
println!(
|
||||
"cargo:rustc-link-search={}",
|
||||
rust_build_path.to_str().unwrap()
|
||||
|
@ -89,7 +89,7 @@ fn build_with_cmake() {
|
|||
download_unicorn()
|
||||
};
|
||||
|
||||
let rust_build_path = unicorn_dir.join("rust_build");
|
||||
let rust_build_path = unicorn_dir.join("build_rust");
|
||||
|
||||
let mut cmd = Command::new("cmake");
|
||||
|
||||
|
@ -98,7 +98,7 @@ fn build_with_cmake() {
|
|||
// Windows
|
||||
cmd.current_dir(&unicorn_dir)
|
||||
.arg("-B")
|
||||
.arg("rust_build")
|
||||
.arg("build_rust")
|
||||
.arg("-DBUILD_SHARED_LIBS=OFF")
|
||||
.arg("-G")
|
||||
.arg("Visual Studio 16 2019");
|
||||
|
@ -138,7 +138,7 @@ fn build_with_cmake() {
|
|||
let mut cmd = Command::new("cmake");
|
||||
cmd.current_dir(&unicorn_dir)
|
||||
.arg("-B")
|
||||
.arg("rust_build")
|
||||
.arg("build_rust")
|
||||
.arg("-DBUILD_SHARED_LIBS=OFF");
|
||||
|
||||
if profile == "debug" {
|
||||
|
@ -163,35 +163,8 @@ fn build_with_cmake() {
|
|||
}
|
||||
}
|
||||
|
||||
// This is a workaround for Unicorn static link since libunicorn.a is also linked again lib*-softmmu.a.
|
||||
// Static libs is just a bundle of objects files. The link relation defined in CMakeLists is only
|
||||
// valid within the cmake project scope and cmake would help link again sub static libs automatically.
|
||||
//
|
||||
// Lazymio(@wtdcode): Why do I stick to static link? See: https://github.com/rust-lang/cargo/issues/5077
|
||||
println!("cargo:rustc-link-lib=unicorn");
|
||||
for arch in [
|
||||
"x86_64",
|
||||
"arm",
|
||||
"aarch64",
|
||||
"riscv32",
|
||||
"riscv64",
|
||||
"mips",
|
||||
"mipsel",
|
||||
"mips64",
|
||||
"mips64el",
|
||||
"sparc",
|
||||
"sparc64",
|
||||
"m68k",
|
||||
"ppc",
|
||||
"ppc64",
|
||||
"s390x"
|
||||
]
|
||||
.iter()
|
||||
{
|
||||
println!("cargo:rustc-link-lib={}-softmmu", arch);
|
||||
}
|
||||
println!("cargo:rustc-link-lib=unicorn-common");
|
||||
|
||||
println!("cargo:rustc-link-lib=unicorn-static");
|
||||
println!("cargo:rerun-if-changed=build.rs");
|
||||
println!("cargo:rerun-if-changed=src");
|
||||
}
|
||||
|
|
19
qemu/exec.c
19
qemu/exec.c
|
@ -1439,6 +1439,25 @@ static void tcg_commit(MemoryListener *listener)
|
|||
tlb_flush(cpuas->cpu);
|
||||
}
|
||||
|
||||
static uint64_t unassigned_io_read(struct uc_struct *uc, void* opaque, hwaddr addr, unsigned size)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
return (uint64_t)0xffffffffffffffffULL;
|
||||
#else
|
||||
return (uint64_t)-1ULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void unassigned_io_write(struct uc_struct *uc, void* opaque, hwaddr addr, uint64_t data, unsigned size)
|
||||
{
|
||||
}
|
||||
|
||||
static const MemoryRegionOps unassigned_io_ops = {
|
||||
.read = unassigned_io_read,
|
||||
.write = unassigned_io_write,
|
||||
.endianness = DEVICE_NATIVE_ENDIAN,
|
||||
};
|
||||
|
||||
static void memory_map_init(struct uc_struct *uc)
|
||||
{
|
||||
uc->system_memory = g_malloc(sizeof(*(uc->system_memory)));
|
||||
|
|
|
@ -40,8 +40,6 @@ typedef struct MemoryRegionPortio {
|
|||
|
||||
#define PORTIO_END_OF_LIST() { }
|
||||
|
||||
extern const MemoryRegionOps unassigned_io_ops;
|
||||
|
||||
void cpu_outb(struct uc_struct *uc, uint32_t addr, uint8_t val);
|
||||
void cpu_outw(struct uc_struct *uc, uint32_t addr, uint16_t val);
|
||||
void cpu_outl(struct uc_struct *uc, uint32_t addr, uint32_t val);
|
||||
|
|
|
@ -1278,4 +1278,7 @@
|
|||
#define gen_helper_cpsr_read gen_helper_cpsr_read_s390x
|
||||
#define gen_helper_cpsr_write gen_helper_cpsr_write_s390x
|
||||
#define helper_uc_s390x_exit helper_uc_s390x_exit_s390x
|
||||
#define tcg_s390_tod_updated tcg_s390_tod_updated_s390x
|
||||
#define tcg_s390_program_interrupt tcg_s390_program_interrupt_s390x
|
||||
#define tcg_s390_data_exception tcg_s390_data_exception_s390x
|
||||
#endif
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "exec/exec-all.h"
|
||||
#include "exec/cpu_ldst.h"
|
||||
#include "hw/s390x/ioinst.h"
|
||||
#//include "exec/address-spaces.h"
|
||||
//include "exec/address-spaces.h"
|
||||
#include "tcg_s390x.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
//#include "hw/s390x/s390_flic.h"
|
||||
|
|
|
@ -14,17 +14,3 @@
|
|||
#include "qemu-common.h"
|
||||
#include "cpu.h"
|
||||
#include "tcg_s390x.h"
|
||||
|
||||
void tcg_s390_tod_updated(CPUState *cs, run_on_cpu_data opaque)
|
||||
{
|
||||
}
|
||||
void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XState *env,
|
||||
uint32_t code, uintptr_t ra)
|
||||
{
|
||||
g_assert_not_reached();
|
||||
}
|
||||
void QEMU_NORETURN tcg_s390_data_exception(CPUS390XState *env, uint32_t dxc,
|
||||
uintptr_t ra)
|
||||
{
|
||||
g_assert_not_reached();
|
||||
}
|
||||
|
|
|
@ -6269,6 +6269,9 @@ ppc_irq_reset \
|
|||
ppc64_SYMBOLS=${ppc_SYMBOLS}
|
||||
|
||||
s390x_SYMBOLS="helper_uc_s390x_exit \
|
||||
tcg_s390_tod_updated \
|
||||
tcg_s390_program_interrupt \
|
||||
tcg_s390_data_exception \
|
||||
"
|
||||
|
||||
ARCHS="x86_64 arm aarch64 riscv32 riscv64 mips mipsel mips64 mips64el sparc sparc64 m68k ppc ppc64 s390x"
|
||||
|
|
Loading…
Reference in New Issue