Comments (16)
and this is same for box86
i don't think i should open issue on both side since is basically same thing
from box64.
Also, keep in mind that clang or gcc optimisation will affect only box64 (/box86) code, and not the generated Dynarec by box64. Don't expect too much difference between optimized build unless you use the Interpreter intensly. In normal use case, most of the time is spent in generated dynarec code...
from box64.
i got some errors in clang
/home/leonpano/box64/src/custommem.c:1289:40: warning: passing 'int *' to parameter of type 'uint32_t *' (aka 'unsigned int *') converts between pointers to integer types with different sign [-Wpointer-sign] 1289 | if(!rb_get_end(mapallmem, cur, &prot, &bend)) { | ^~~~~ /home/leonpano/box64/src/include/rbtree.h:12:56: note: passing argument to parameter 'val' here 12 | int rb_get_end(rbtree* tree, uintptr_t add[ 13%] Building C object CMakeFiles/box64.dir/src/elfs/elfloader.c.o r, uint32_t* val, uintptr_t* end); | ^ /home/leonpano/box64/src/custommem.c:1322:40: warning: passing 'int *' to parameter of type 'uint32_t *' (aka 'unsigned int *') converts between pointers to integer types with different sign [-Wpointer-sign] 1322 | if(!rb_get_end(mapallmem, cur, &prot, &bend)) { | ^~~~~ /home/leonpano/box64/src/include/rbtree.h:12:56: note: passing argument to parameter 'val' here 12 | int rb_get_end(rbtree* tree, uintptr_t addr, uint32_t* val, uintptr_t* end); | ^ /home/leonpano/box64/src/custommem.c:1353:36: warning: passing 'int *' to parameter of type 'uint32_t *' (aka 'unsigned int *') converts between pointers to integer types with different sign [-Wpointer-sign] 1353 | if(!rb_get_end(mapallmem, cur, &prot, &bend)) { | ^~~~~ /home/leonpano/box64/src/include/rbtree.h:12:56: note: passing argument to parameter 'val' here 12 | int rb_get_end(rbtree* tree, uintptr_t addr, uint32_t* val, uintptr_t* end); | ^ /home/leonpano/box64/src/custommem.c:1430:40: warning: passing 'int *' to parameter of type 'uint32_t *' (aka 'unsigned int *') converts between pointers to integer types with different sign [-Wpointer-sign] 1430 | if(!rb_get_end(mapallmem, cur, &prot, &bend)) { | ^~~~~ /home/leonpano/box64/src/include/rbtree.h:12:56: note: passing argument to parameter 'val' here 12 | int rb_get_end(rbtree* tree, uintptr_t addr, uint32_t* val, uintptr_t* end);
and
/home/leonpano/box64/src/emu/x64emu.c:195:13: error: call to undeclared function 'internal_munmap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 195 | if(!internal_munmap(emu->stack2free, emu->size_stack)) | ^ /home/leonpano/box64/src/emu/x64emu.c:196:13: error: call to undeclared function 'freeProtection'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 196 | freeProtection((uintptr_t)emu->stack2free, emu->size_stack); | ^ [ 15%] Building C object CMakeFiles/box64.dir/src/emu/x64primop.c.o /home/leonpano/box64/src/emu/x64emu.c:619:21: error: use of unknown builtin '__builtin_aarch64_get_fpcr' [-Wimplicit-function-declaration] 619 | uint64_t fpcr = __builtin_aarch64_get_fpcr(); | ^ /home/leonpano/box64/src/emu/x64emu.c:627:5: error: use of unknown builtin '__builtin_aarch64_set_fpcr' [-Wimplicit-function-declaration] 627 | __builtin_aarch64_set_fpcr(fpcr); | ^
from box64.
the 1st block is probably easy to fix, but the second part, it will need to be disable to build...
from box64.
1st part is not fatal
but 2nd part is problem to cause compile fail
from box64.
/home/leonpano/box64/src/emu/x64emu.c:195:13: error: call to undeclared function 'internal_munmap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
195 | if(!internal_munmap(emu->stack2free, emu->size_stack))
| ^
/home/leonpano/box64/src/emu/x64emu.c:196:13: error: call to undeclared function 'freeProtection'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
196 | freeProtection((uintptr_t)emu->stack2free, emu->size_stack);
| ^
idk these
/home/leonpano/box64/src/emu/x64emu.c:619:21: error: use of unknown builtin '__builtin_aarch64_get_fpcr' [-Wimplicit-function-declaration]
619 | uint64_t fpcr = __builtin_aarch64_get_fpcr();
| ^
/home/leonpano/box64/src/emu/x64emu.c:627:5: error: use of unknown builtin '__builtin_aarch64_set_fpcr' [-Wimplicit-function-declaration]
627 | __builtin_aarch64_set_fpcr(fpcr);
| ^
these macros are doesn't exists in clang
from box64.
so yeah if ur linux ur stuck with gcc
from box64.
@leonpano2006 about the second blocks of error: it seems you are building box64 without dynarec! Is that on purpose?
from box64.
@leonpano2006 about the second blocks of error: it seems you are building box64 without dynarec! Is that on purpose?
Build with dynarec
from box64.
@leonpano2006 about the second blocks of error: it seems you are building box64 without dynarec! Is that on purpose?
Build with dynarec
Those warning/error:
/home/leonpano/box64/src/emu/x64emu.c:195:13: error: call to undeclared function 'internal_munmap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
195 | if(!internal_munmap(emu->stack2free, emu->size_stack))
| ^
/home/leonpano/box64/src/emu/x64emu.c:196:13: error: call to undeclared function 'freeProtection'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
196 | freeProtection((uintptr_t)emu->stack2free, emu->size_stack);
| ^
Only appeared on non-dynarec build. I have just pushed a fix to it, the #include "custommem.h"
was behind a #ifdef DYNAREC
from box64.
[ 44%] Building C object CMakeFiles/box64.dir/src/emu/x87emu_private.c.o /home/leonpano/box64/src/emu/x64emu.c:619:21: error: use of unknown builtin '__builtin_aarch64_get_fpcr' [-Wimplicit-function-declaration] 619 | uint64_t fpcr = __builtin_aarch64_get_fpcr(); | ^ /home/leonpano/box64/src/emu/x64emu.c:627:5: error: use of unknown builtin '__builtin_aarch64_set_fpcr' [-Wimplicit-function-declaration] 627 | __builtin_aarch64_set_fpcr(fpcr); | ^ 2 errors generated. make[2]: *** [CMakeFiles/box64.dir/build.make:527: CMakeFiles/box64.dir/src/emu/x64emu.c.o] Error 1
build with cmake .. -D TEGRA_T194=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=/usr/bin/clang-19 -D ARM_DYNAREC=ON
but i find sometimes i have to rm build then mkdir build again or it may have such issue like this
leonpano@leonpano-desktop:~/box64/build$ cmake .. -D TEGRA_T194=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=/usr/bin/clang-19 -D ARM_DYNAREC=ON -- The C compiler identification is Clang 19.0.0 -- The ASM compiler identification is Clang with GNU-like command-line -- Found assembler: /usr/bin/clang-18 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/clang-19 - skipped -- Detecting C compile features -- Detecting C compile features - done -- Configuring done (1.8s) -- Generating done (0.2s) -- Build files have been written to: /home/leonpano/box64/build
from box64.
and after i do this to make it use right version
leonpano@leonpano-desktop:~/box64/build$ cd .. leonpano@leonpano-desktop:~/box64$ rm -rf build;mkdir build; cd build/ leonpano@leonpano-desktop:~/box64/build$ cmake .. -D TEGRA_T194=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=/usr/bin/clang-19 -D ARM_DYNAREC=ON -- Found Python3: /usr/bin/python3.9 (found version "3.9.5") found components: Interpreter -- The C compiler identification is Clang 19.0.0 -- The ASM compiler identification is Clang with GNU-like command-line -- Found assembler: /usr/bin/clang-19 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/clang-19 - skipped -- Detecting C compile features -- Detecting C compile features - done -- Configuring done (3.4s) -- Generating done (0.2s) -- Build files have been written to: /home/leonpano/box64/build
from box64.
and part you said i build without ARM dynarec just because of error build
but appears issue is not cause by ARM dynarec
from box64.
i think for now clang is not possible
unfortunately or someone have to fix code for clang to work
i tried clang-16 and 17 and 18 and 19
all clang are the same
build log form clang-19
https://gist.github.com/leonpano2006/72f2a340a8fd3edb42f8a4e5bda80c16
build log form gcc-13
https://gist.github.com/leonpano2006/a85fd3856b5188628f728a1e45e13b8b
from box64.
it's easy to fix, but I don't want to have to maintain clang build. If someone do a PR about it, I'll merge it, but I don't want to it myself as I have too many other things to maintain already.
from box64.
@leonpano2006 after this gets pulled u can build in clang
from box64.
Related Issues (20)
- Viber not opening in Asahi Linux
- geekbench6 jemalloc crash on M1 (Asahi) HOT 2
- heroic launcher memory map creation crash on M1 (Asahi)
- space engine on wine: can't initialise opengl HOT 7
- Symbol _Unwind_GetRegionStart not found (and others) on Raspberry Pi OS x64 HOT 3
- Segmentation Fault on start - Stardew Valley on Asahi Linux HOT 2
- Loading x64 libraries from arm64 code HOT 4
- Error loading `libjack.so.0` when registering wineasio.dll file HOT 23
- Werid warning while using native(wrapped) libEGL.so.1 HOT 1
- GtaIV does not open HOT 4
- Gta San Andreas does not open
- Unknown architecture :- add "DEC Alpha" HOT 2
- Unofficial Arcanum Patch freeze when launching wine -cmd (wow64 mode)
- Newest git version unuseable - high cpu usage on RPI 5 ARM64 HOT 6
- Box64 doesn't install all libraries in /lib64/ on Asahi Linux HOT 4
- Steam broken as of 2/28/2024 HOT 19
- MiniMetro (unity game) no longer works HOT 9
- [LA64] Elf loading error: Cannot create memory map
- A Snake's Tale - Unimplemented Opcode (48 0F 6E C0) HOT 2
- Slow NosTale performance on Mobox (Wine + box64 bundled for Android) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from box64.