Haiku

By Roland007

Rookie (29)

Roland007's picture

06-10-2018, 20:47

So I had a stupid idea. Download and try to compile OpenMSX on Haiku. It has SDL, GCC, Python, different sound systems, so it might actually work. Of course it does not: "unknown platform: Haiku", Target processor not set, target operating system not set.

Is it actually possible to compile on Haiku? It runs on intel and has 32 bit and 64 bit kernels. Any advice is welcome.

Cheers

Login or register to post comments

By mth

Champion (475)

mth's picture

06-10-2018, 21:34

It shouldn't be hard to teach the build system enough about Haiku so you can at least attempt a compile.

We get system information from Python. To see what Python reports, run it interactively:

$ python
Python 2.7.14 (default, Oct 12 2017, 15:50:02) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.system()
'Linux'
>>> platform.machine()
'x86_64'
>>> platform.architecture()
('64bit', '')
>>>

Now open build/detectsys.py in a text editor and in detectCPU(), add code that maps the value that Python reports to a name that openMSX recognises, which is 'x86' or 'x86_64' for Intel/AMD CPUs. Then in detectOS() add code that returns 'haiku' as the OS name for Haiku. Then test whether system detection works:

$ python build/detectsys.py
x86_64 linux

Next step is to create build/platform-haiku.mk which will contain Haiku-specific compile flags. You can probably start by copying the file of a straightforward platform, such as platform-freebsd.mk and then add stuff as you fix build problems later.

Now you can run "make probe" and let openMSX attempt to find libraries. If it doesn't find them, look in the probe log (the path is printed when you run "make probe") to see why the detection failed.

If you want live help, join us on #openmsx on freenode IRC. Or you can just ask questions here.

By Roland007

Rookie (29)

Roland007's picture

07-10-2018, 15:21

Thanks for the information. The python output looks the same as the example in the post above, except that platform writes 'haiku'.
I added haiku as a build platform in the detectOS() routine, copied platform-linux.mk to platform-haiku.mk and verified the content. The system support ln, libraries end with .so and executables have no extension.

running ./configure or make probe dumps an error indicating that the build script can't find libreadline.so.7.
Normally I would look for a place where I could say that all libraries to include live in /boot/system/lib but in the build system used, that's more complicated because I can't pinpoint where to add this because the build script seams to create directories and files on the fly.

By Manuel

Ascended (14680)

Manuel's picture

07-10-2018, 15:55

Please post the probe.log in a paste bin, so we can take a look.

By Roland007

Rookie (29)

Roland007's picture

07-10-2018, 16:34

Hi,

There is no probe.log file so I can't post anything on paste.bin. Error is:

Using Python: python
runtime_loader: Cannot open file libreadline.so.7: No such file or directory
build/main.mk:440: recipe for target 'derived/x86_64-haiku-opt/config/probed_defs.ml' failed
make: *** [derived/x86_64-haiku-opt/config/probed_defs.mk] Error 3

Haiku has its libraries /boot/system/lib and the referred library is called libreadline.so.7 so that specific file exists.
Thanks

By Manuel

Ascended (14680)

Manuel's picture

07-10-2018, 17:42

This looks like a problem with the Python installation on your system.

By Manuel

Ascended (14680)

Manuel's picture

07-10-2018, 19:12

Is libreadline7 installed? Apparently there's a dependency to it from python or the python libraries that are being used in the script.

By Roland007

Rookie (29)

Roland007's picture

07-10-2018, 21:26

Yes, that library is installed in /boot/system/lib. I will ask the Haiku devs whether this is a python issue.

By mth

Champion (475)

mth's picture

08-10-2018, 00:46

Does it really say "probed_defs.ml"? It should be ".mk".

If all libs live in /boot/system/lib, then I'd expect GCC to be configured to search for them there, in which case openMSX doesn't need any additional options to find libraries.

I agree with Manuel that the readline error is probably an installation issue on your system: openMSX doesn't use readline.

By Roland007

Rookie (29)

Roland007's picture

08-10-2018, 18:32

I installed all kinds of headline related packages that didn't solve the issue. So I consider it a flaw in the python build on Haiku. Most ports on Haiku suffer from a form feature degradation caused by cutting out parts that wouldn't compile.

By mth

Champion (475)

mth's picture

09-10-2018, 04:39

I don't think it's a problem with a disabled feature, since then it wouldn't try to load the readline library at all, it just would have less advanced interactive line editing features, which doesn't matter when scripting.

Are we sure it is Python that is triggering it though? It could be GNU Make itself. Does Haiku have "strace"? That's a tool that prints all system call use from programs run under it, which is useful in figuring out what a program is doing before it fails.

You can also try running "make V=1", which will tell the openMSX build to be more verbose and echo what it is doing.

My MSX profile