Building SIMH for Haiku

One piece of software I enjoy using on most OSes is SIMH, and while I can easily get SIMH for any Linux, or macOS, or BSD, it’s not available in HaikuPorts (or at least not in the default repos), so I figured I could roll builds myself.

I downloaded the source from the 4.x Git repo here and made sure to install the needed prerequisite -devel packages (libpcap, libsdl2, libsdl2-ttf, libpcre). However, my test runs are giving me errors a few seconds into evoking ‘make’.

A Pastebin of the errors I’m getting is here.

What is needed to get SIMH to build correctly in Haiku? The errors I’m seeing mention declaration of ‘uint64’ and ‘t_uint64’ (which are in the linked Pastebin), so I figure something needs to be declared differently?

1 Like

Check haikuports for patches that include SupportDefs.h, that’s where the fix could be found. :slight_smile: (or conflicting types … int types)

EDIT try this in sym_disc.c line 4683

#if defined(__HAIKU__)
#include <SupportDefs.h>
#else
typedef t_uint64    uint64;
typedef t_int64     int64;
#endif
3 Likes

Got HaikuPorter set up now but now SIMH there keeps throwing errors about the architecture being unsupported? I’m unfortunately AFK so I can’t replicate it right now.

For what it’s worth, I’m using the x86_64 version of Haiku here.

Without looking at the recipe you are using it’s hard to know what’s wrong.

Does SIMH or HaikuPorter throws this error?
If HaikuPorter, then you should enable secondary arches in the HaikuPorts config.
If SIMH throws the error, then you should patch the realted files and add Haiku to the list of supported operating systems.

It is definetely possible to build and use SIMH on Haiku, so try harder and also consider to join to the haiku irc channel for real-time support.

He is running 64bit, so no secondary architecture should be needed there. :wink:
Maybe the haikuports.conf file isn’t setup right?

EDIT At least a simular patch is needed for sim_defs.h

Oh wow, I ported this back in 2014 already… but didn’t touch it much since then :smiley:

1 Like

Actually there’s a recipe for 4.0.0_git but it points to a 2018 commit.

1 Like

This error is being thrown by HaikuPorter itself. The error is as follows:

~> haikuporter --get-dependencies simh
Checking if any dependency-infos need to be updated …
Looking for stale dependency-infos …
Warning: skipping simh-4.0.0_git, as it is untested on the target architecture.
Error: No version of simh can be built

I’ll try with secondary dependencies enabled and see if it helps.

Secondary arch (currently) only used on 32 bit, where the primary arch means the ancient GCC2 toolchain and the d secondary means the GCC11 toolchain.

If your OS is 64 bit, then there is no secondary arch.

The error implies you have ?x86_64 or ?all flag in your recipe (notice the question mark), which means it is untested.
There is a setting for enabling untested recipes in the HaikuPorter config, you should enable that.
And consider to post your wip recipe.

Check if you uncommented that line in your conf file: haikuporter/haikuports-sample.conf at master · haikuports/haikuporter · GitHub

EDIT And as @extrowerk mentioned, don’t use ?x86_64 but x86_64

EDIT 2 You might want to create a profile so you could use hp simh instead of haikuporter --get-dependencies simh this is explained in the sample conf file also: haikuporter/haikuports-sample.conf at master · haikuports/haikuporter · GitHub

Actually sim_defs.h is already included in sim_disc.c, and it already has other typedefs so it should all go there and just drop them from sim_disc.c.

1 Like