- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 380
 
Description
Hello, ptitSeb
    Now, By modifying Box64(commit:6f144aa429e67721582bd8f02170ee90fe3fafa9, date:20250908) , WeChat MiniProgram  built for the x86_64 architecture can be run on the Raspberry Pi 5.
BACKGROUND: WeChat is an instant-messaging application with hundreds of millions of users worldwide. Mini-Program is a built-in feature of WeChat, like browser plug-ins. At present, Box64 can run the main process just for sending/receiving messages, but it cannot yet run Mini-Program.
Mini-Program is built on a Web-technology stack, which poses a new challenge for Box64
   Initially, our debugging efforts were blocked by a cryptic error:  cfree(): invalid pointer.
   Further investigation revealed the root cause: Mini-Program ship  own malloc/free function family to manage memory. Consequently, directly mapping these functions to the host libc by the library-wrapping mechanism, causes the error.
Fortunately, Box64 provides the malloc-hook mechanism, which can handle the problem.
However, under the special execution environment of Mini-Program, we have uncovered several issues listed below, and designed a solution:
- Activation strategy of malloc-Hook for the x86_64 ELF
 - Memory management —the malloc-hoock mechainism relies on memory attributes
 - Translated-code-blocks management
Here we share our current achievements. Hope to exchange ideas with you furtherly, making Box64 more prefect.
Thanks.
Aqua.