about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorYang Liu <liuyang22@iscas.ac.cn>2025-07-22 20:37:20 +0800
committerGitHub <noreply@github.com>2025-07-22 14:37:20 +0200
commit7b755bb6a2a07a2f5c73fd8b35468f7d4172531c (patch)
treed4bbfadd12bde0302baaee1f279b7442b2fda93d
parent5f7da532c4ea35e56b2a5839d776e2cd75f34db1 (diff)
downloadbox64-7b755bb6a2a07a2f5c73fd8b35468f7d4172531c.tar.gz
box64-7b755bb6a2a07a2f5c73fd8b35468f7d4172531c.zip
[BOX32] Enable personality setting for RV64 and LA64 (#2841)
-rw-r--r--.github/workflows/release.yml6
-rw-r--r--src/core.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index d6b55699..e2471cb2 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -249,6 +249,9 @@ jobs:
             export INTERPRETER=qemu-riscv64-static
             export QEMU_LD_PREFIX=/usr/riscv64-linux-gnu/
 
+            if [[ ${{ env.BOX64_BOX32 }} == '1' ]]; then
+              export BOX32_PERSONA32BITS=1 # hack to disable personality setting
+            fi
             ctest $CTEST_OPTIONS
             QEMU_CPU=rv64,v=false BOX64_DYNAREC=0 ctest $CTEST_OPTIONS
             QEMU_CPU=rv64,v=false,zba=true,zbb=true,zbc=true,zbs=true ctest $CTEST_OPTIONS
@@ -269,6 +272,9 @@ jobs:
             export INTERPRETER=qemu-loongarch64-static
             export QEMU_LD_PREFIX=/usr/loongarch64-linux-gnu/
 
+            if [[ ${{ env.BOX64_BOX32 }} == '1' ]]; then
+              export BOX32_PERSONA32BITS=1 # hack to disable personality setting
+            fi
             ctest $CTEST_OPTIONS -E nocosim
             BOX64_DYNAREC_LA64NOEXT=1 ctest $CTEST_OPTIONS -E nocosim
             BOX64_DYNAREC=0 ctest $CTEST_OPTIONS -E nocosim
diff --git a/src/core.c b/src/core.c
index b8a85d0c..0d5b0367 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1153,7 +1153,6 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf
     }
     #ifdef BOX32
     box64_is32bits = FileIsX86ELF(my_context->fullpath);
-    #if !defined(RV64) && !defined(LA64)
     // try to switch personality, but only if not already tried
     if(box64_is32bits) {
         int tried = getenv("BOX32_PERSONA32BITS")?1:0;
@@ -1180,7 +1179,6 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf
             }
         }
     }
-    #endif
     if(box64_is32bits) {
         printf_log(LOG_INFO, "Using Box32 to load 32bits elf\n");
         loadProtectionFromMap();