use qemu_memalign for all cpu structs
Some structs, specically CPUARMState is 16-bytes aligned. This causes segment fault because gcc tends to vectorize the assignment of the struct with infamous movaps tricks. Without this patch, we fail on manylinux with 2.17 glibc in release mode in i686. qemu_memalign will ensure the alignment across platforms.
This commit is contained in:
@@ -517,11 +517,11 @@ SPARCCPU *cpu_sparc_init(struct uc_struct *uc)
|
||||
CPUClass *cc;
|
||||
SPARCCPUClass *scc;
|
||||
|
||||
cpu = malloc(sizeof(*cpu));
|
||||
cpu = qemu_memalign(8, sizeof(*cpu));
|
||||
if (cpu == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
memset(cpu, 0, sizeof(*cpu));
|
||||
memset((void*)cpu, 0, sizeof(*cpu));
|
||||
|
||||
if (uc->cpu_model == INT_MAX) {
|
||||
#ifdef TARGET_SPARC64
|
||||
|
||||
Reference in New Issue
Block a user