GUI program inside chrootjail (running under QEMU)

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
Virchanza
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Sun Jul 19, 2009 6:12 am

GUI program inside chrootjail (running under QEMU)

Post by Virchanza »

I have a desktop PC at home, it's an x86_64 with 40 cores running Ubuntu Linux.

I've spent the last week or two creating a 'chroot jail' in which I have placed a cross-compiler that builds 32-Bit Big Endian ARM programs.

With the help of "Linux from Scratch" I've built all the libraries I need for my 'Dynamo' program (glib, X11, gtk+2, boost, wxwidgets... and two dozen other dependencies like harfbuzz, freetype, libxml2, etc.).

My chrootjail is very minimal. If a program or library isn't needed then it's out.

In the past half-hour I've finally gotten my Dynamo program built as a 32-Bit Big Endian ARM program. I have QEMU installed, which is a CPU emulator, it allows me to run a 32-Bit Big Endian ARM binary on a 64-Bit x86 computer. I've run Dynamo inside my chrootjail, and the screenshot is below.

As you can see, the letters displayed on the screen are just empty boxes. Anyone know what's likely to cause this? Am I missing some font files or whatever from /usr/share? Because right now there's very little stuff in /usr/share.

(By the way this is related to my thread from 3 weeks ago in which I was exploring other ways of running a Big Endian binary: viewtopic.php?p=210438)


dynamo_arm32eb.png
dynamo_arm32eb.png (9.31 KiB) Viewed 4282 times
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: GUI program inside chrootjail (running under QEMU)

Post by DavidHart »

Hi,
Am I missing some font files or whatever from /usr/share?
That sounds likely. Have a look in the chroot's /usr/share/fonts/ and compare it with ubuntu.

Another other possibility might be the chroot's locale. Try setting it to the default en_US if it isn't already.

Regards,

David
Virchanza
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Sun Jul 19, 2009 6:12 am

Re: GUI program inside chrootjail (running under QEMU)

Post by Virchanza »

DavidHart wrote: Fri Feb 11, 2022 10:31 am That sounds likely. Have a look in the chroot's /usr/share/fonts/ and compare it with ubuntu.


All I had to do was copy the directory "/usr/share/fonts/" across into my chroot jail.


arm32eb_dynamo_fonts.png
arm32eb_dynamo_fonts.png (32.66 KiB) Viewed 4259 times
Virchanza
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Sun Jul 19, 2009 6:12 am

Re: GUI program inside chrootjail (running under QEMU)

Post by Virchanza »

If any of you are interested in testing your wxWidgets program out on a Big Endian CPU then I'll make my chrootjail available as a tarball when I have it just right. A few more days of tweaking.

For example with testing my own program, I read in the contents of capture files produced by Wireshark -- which can be in either big or little endian format -- and so this is definitely something I want to test on a big endian processor.

Also it can help detect a few other problems, for example:

Code: Select all

    short x;
    scanf("%i", &x);
This snippet will mostly work fine on an x86 CPU because if the input number is less than 65536 then a 'short' and an 'int' will read back the same -- you'll probably get away with the two bytes of stack corruption. On a big Endian CPU though, 'x' will always be zero so you'll spot the error sooner in testing.
Virchanza
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Sun Jul 19, 2009 6:12 am

Re: GUI program inside chrootjail (running under QEMU)

Post by Virchanza »

dynamo_endianness.png
dynamo_endianness.png (74 KiB) Viewed 4195 times
Post Reply