Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More wrapped functions are required to run xterm #1990

Open
jserv opened this issue Nov 1, 2024 · 7 comments
Open

More wrapped functions are required to run xterm #1990

jserv opened this issue Nov 1, 2024 · 7 comments

Comments

@jserv
Copy link
Contributor

jserv commented Nov 1, 2024

When attempting to run xterm on a Debian unstable system with x86-64 architecture using box64, the emulation encountered multiple symbol resolution issues in the Xaw library. Specifically, box64 failed to find and correctly map several global symbols required by libXaw.so.7, including:

Error: Global Symbol XmuCvtStringToShapeStyle not found, cannot apply R_X86_64_GLOB_DAT @0x3f00268dc0 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuCvtStringToBackingStore not found, cannot apply R_X86_64_GLOB_DAT @0x3f00268dd8 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuCvtStringToBitmap not found, cannot apply R_X86_64_GLOB_DAT @0x3f00268de8 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol _XA_COMPOUND_TEXT not found, cannot apply R_X86_64_GLOB_DAT @0x3f00268df8 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol constraintWidgetClass not found, cannot apply R_X86_64_GLOB_DAT @0x3f00268e10 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol constraintWidgetClass not found, cannot apply R_X86_64_64 @0x3f00269cd0 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol _XA_CHARACTER_POSITION not found, cannot apply R_X86_64_GLOB_DAT @0x3f00268e20 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
...

To successfully emulate the Xaw library, box64 requires additional function wrappers to be implemented, ensuring comprehensive symbol resolution and compatibility across different architectural environments.

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 1, 2024

Maybe it would be easier to just wrap libXaw.so.7 instead?

@jserv
Copy link
Contributor Author

jserv commented Nov 1, 2024

Maybe it would be easier to just wrap libXaw.so.7 instead?

I am interested in developing wrappers for libXaw.so.7 to resolve the symbol mapping issues preventing xterm from running under box64, but I am uncertain about how to identify the required symbols and implement the necessary wrapping process.

Could you provide a detailed guide to approach this library wrapping challenge?

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 1, 2024

Youc an start with https://box86.org/2024/02/how-to-create-a-wrapping/

There is also the new wrapperhelper that can help a lot.

@ksco
Copy link
Collaborator

ksco commented Nov 1, 2024

Out of curiosity, what's the use case to run xterm with box64 on an x86_64 machine?

@StefanW1357
Copy link

I came across this while trying to run xclock which also depends on libXaw.so.7 While I can't speak for @jserv my use case for running the x86_64 build of xclock was I thought it would be easier to run than steam and would help check my box64 is was able to run code ok. Turns out it wasn't easier! xclock has even more symbols missing than xterm!

Not sure it'll help progress this issue any further but here is the output from xclock:

stefan@Rock5B-Gentoo ~/Downloads/native_x86_64_progs $ ./xclock 
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 PageSize:4096 Running on Cortex-A55 Cortex-A76 with 8 Cores
Will use Hardware counter measured at 24.0 MHz emulating 3.0 GHz
Params database has 95 entries
Box64 with Dynarec v0.3.1  built on Nov  9 2024 11:29:52
BOX64: Detected 48bits at least of address space
Counted 83 Env var
BOX64 LIB PATH: BOX64 BIN PATH: ./:bin/:/usr/local/sbin/:/usr/local/bin/:/usr/bin/:/opt/bin/:/usr/lib/llvm/18/bin/
Looking for ./xclock
Rename process to "xclock"
Using emulated /lib/x86_64-linux-gnu/libXaw.so.7
Using native(wrapped) libXmu.so.6
Using native(wrapped) libX11.so.6
Using native(wrapped) libxcb.so.1
Using native(wrapped) libXau.so.6
Using native(wrapped) libXdmcp.so.6
Using native(wrapped) libXext.so.6
Using native(wrapped) libdl.so.2
Using native(wrapped) libXt.so.6
Using native(wrapped) libXrender.so.1
Using native(wrapped) libXft.so.2
Using native(wrapped) libfontconfig.so.1
Using native(wrapped) libexpat.so.1
Using native(wrapped) libfreetype.so.6
Using emulated /lib/x86_64-linux-gnu/libxkbfile.so.1
Using native(wrapped) libm.so.6
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libutil.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
Using native(wrapped) libXpm.so.4
Error: Global Symbol XmuCvtStringToShapeStyle not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069db0 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuCvtStringToBackingStore not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069dc8 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuCvtStringToBitmap not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069dd8 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol _XA_COMPOUND_TEXT not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069de8 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol constraintWidgetClass not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069e08 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol constraintWidgetClass not found, cannot apply R_X86_64_64 @0x7fff0006a370 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol _XA_CHARACTER_POSITION not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069e18 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuCvtStringToOrientation not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069e38 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuCvtStringToJustify not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069e48 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol _XA_TEXT not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069e50 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol constraintClassRec not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069e60 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol constraintClassRec not found, cannot apply R_X86_64_64 @0x7fff0006c640 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol constraintClassRec not found, cannot apply R_X86_64_64 @0x7fff0006dca0 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol constraintClassRec not found, cannot apply R_X86_64_64 @0x7fff000724a0 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuCvtGravityToString not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069e68 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuCvtWidgetToString not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069e78 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol transientShellWidgetClass not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069e88 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol transientShellWidgetClass not found, cannot apply R_X86_64_64 @0x7fff0006b180 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuCvtOrientationToString not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069ea8 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol wmShellClassRec not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069eb8 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol wmShellClassRec not found, cannot apply R_X86_64_64 @0x7fff000729e0 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuCvtStringToColorCursor not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069ed0 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuRegisterExternalAgent not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069ed8 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuCvtJustifyToString not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069ee0 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol widgetClass not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069ef0 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol _XA_NULL not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069f08 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol _XA_TARGETS not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069f10 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol _XA_LENGTH not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069f18 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol wmShellWidgetClass not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069f20 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol wmShellWidgetClass not found, cannot apply R_X86_64_64 @0x7fff0006b360 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuCvtBackingStoreToString not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069f28 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuNewCvtStringToWidget not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069f38 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuCvtShapeStyleToString not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069f40 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol _XEditResCheckMessages not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069f48 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol _XA_DELETE not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069f68 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol _XA_LIST_LENGTH not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069f88 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol _XA_SPAN not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069f90 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol _XA_UTF8_STRING not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069f98 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuCvtStringToCursor not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069fd8 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Global Symbol XmuCvtStringToGravity not found, cannot apply R_X86_64_GLOB_DAT @0x7fff00069ff8 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol applicationShellWidgetClass not found, cannot apply R_X86_64_64 @0x7fff0006a028 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol compositeWidgetClass not found, cannot apply R_X86_64_64 @0x7fff0006a2f8 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol coreWidgetClass not found, cannot apply R_X86_64_64 @0x7fff0006a3e8 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol objectClass not found, cannot apply R_X86_64_64 @0x7fff0006a820 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol overrideShellWidgetClass not found, cannot apply R_X86_64_64 @0x7fff0006a898 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol rectObjClass not found, cannot apply R_X86_64_64 @0x7fff0006aa78 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol shellWidgetClass not found, cannot apply R_X86_64_64 @0x7fff0006abe0 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol topLevelShellWidgetClass not found, cannot apply R_X86_64_64 @0x7fff0006b108 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol _XtInheritTranslations not found, cannot apply R_X86_64_64 @0x7fff0006b940 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol compositeClassRec not found, cannot apply R_X86_64_64 @0x7fff0006b9a0 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol compositeClassRec not found, cannot apply R_X86_64_64 @0x7fff0006ea20 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol widgetClassRec not found, cannot apply R_X86_64_64 @0x7fff0006f500 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol widgetClassRec not found, cannot apply R_X86_64_64 @0x7fff00072f60 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol rectObjClassRec not found, cannot apply R_X86_64_64 @0x7fff0006fcc0 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol objectClassRec not found, cannot apply R_X86_64_64 @0x7fff00070be0 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol objectClassRec not found, cannot apply R_X86_64_64 @0x7fff00070e40 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: Symbol objectClassRec not found, cannot apply R_X86_64_64 @0x7fff00072800 ((nil)) in /lib/x86_64-linux-gnu/libXaw.so.7
Error: relocating symbols in elf libXaw.so.7
Error initializing needed lib libc.so.6
Error loading one of needed lib
Error: Loading needed libs in elf ./xclock

I seem to have ended up with a x86_64-linux-gnu and box64-x86_64-linux-gnu folders. Box64 seems to be looking at x86_64-linux-gnu and maybe that's breaking things? The output was the same on my Pi5 which has steam running OK, so I'm not sure what the issue is with my Rock5B, other than it not being a Debian based distro and I'm having to manually install a few things or create Gentoo ebuilds where I can.

As aside, is there a simple X86_64 program I can copy from my laptop to test Box64 with?

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 9, 2024

I wrapped libXaw instead.

box64 (and box86) primary target is games. So games are the kind of software that are the most tested. And they tend to use a minimum set of X11 features. And manytime, no X11 feature at all while relying on SDL2 for example.

Anything simple based on SDL1/SDL2 would be better.

Now that libXaw is wrapped, I suppose XClock might work tho.

@StefanW1357
Copy link

Wow that was quick thank you. I should probably try and run the ctest program from box64?

I didn't expect to wrap the library. I started reading the wrapper blog but still a bit over my understanding at the moment. I now just have two errors.

stefan@Rock5B-Gentoo ~/Downloads/native_x86_64_progs $ ./xclock 
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 PageSize:4096 Running on Cortex-A55 Cortex-A76 with 8 Cores
Will use Hardware counter measured at 24.0 MHz emulating 3.0 GHz
Params database has 95 entries
Box64 with Dynarec v0.3.1  built on Nov  9 2024 18:16:01
BOX64: Detected 48bits at least of address space
Counted 83 Env var
BOX64 LIB PATH: BOX64 BIN PATH: ./:bin/:/usr/local/sbin/:/usr/local/bin/:/usr/bin/:/opt/bin/:/usr/lib/llvm/18/bin/
Looking for ./xclock
Rename process to "xclock"
Using native(wrapped) libXaw.so.7
Using native(wrapped) libX11.so.6
Using native(wrapped) libxcb.so.1
Using native(wrapped) libXau.so.6
Using native(wrapped) libXdmcp.so.6
Using native(wrapped) libXext.so.6
Using native(wrapped) libdl.so.2
Using native(wrapped) libXmu.so.6
Using native(wrapped) libXt.so.6
Using native(wrapped) libXrender.so.1
Using native(wrapped) libXft.so.2
Using native(wrapped) libfontconfig.so.1
Using native(wrapped) libexpat.so.1
Using native(wrapped) libfreetype.so.6
Using emulated /usr/lib/box64-x86_64-linux-gnu/libxkbfile.so.1
Using native(wrapped) libm.so.6
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libutil.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
Error: Global Symbol XmuCvtStringToBackingStore not found, cannot apply R_X86_64_GLOB_DAT @0x10000afd8 ((nil)) in /home/stefan/Downloads/native_x86_64_progs/xclock
Error: Symbol simpleClassRec not found, cannot apply R_X86_64_64 @0x10000b080 ((nil)) in /home/stefan/Downloads/native_x86_64_progs/xclock
Error: Relocating symbols in elf ./xclock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants