PCH developer type question

Hello, folks.

Lately I’ve been spending time getting various SDL 1/2 emulators working on Haiku. Generally, it’s just a matter of adding some #ifdef statements for Haiku or removing certain linker flags.

I’ve been trying to get A7800 going (kind of a MESS/MAME offshoot) and I’ve made some progress, but I keep hitting a wall with pre-compiled headers.

In this case:

Compiling src/emu/drivers/empty.cpp…
cc1plus: error: one or more PCH files were found, but they were invalid
cc1plus: error: use -Winvalid-pch for more information
cc1plus: fatal error: …/…/…/…/freebsd/obj/x64/Release/emu.h: No such file or directory
compilation terminated.

Searches on the web generally say to delete the pre-compiled headers and the process will re-make them and all will be good, but that’s not the case here. They appear to be made invalid from the get-go.

For the most part I don’t know what I’m doing, and I really have no experience with pre-compiled headers. I’m hoping someone else does.

One thing I can say is that I had to remove these two flags for anything to happen: -rdynamic and -ldl

I think it’s feasible that either one or both of those flags may be causing the issue. They don’t work with Haiku (or, at least, not in the way they’re called in the makefiles).

If anyone has any ideas, I’d love to hear them.

Thanks!

If this have something to do with mame you can check the mame recipe too, i’ve met with the same problem duting the porting.

It looks like gcc chokes on precompiled headers (PCH) due to address space layout randomization. You can disable it using the following command:
export DISABLE_ASLR=1

I’ll give 'em both a try. Thanks!

this case is same with qxmledit… and i have not found solution yet… please repost again if thereis progress…

The good news, is that the above worked to get me past the pre-compiled header problem. The bad news is that I’m now stuck here:

…/…/…/…/…/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h:877:15: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct ImGuiStyleMod’; use assignment instead [-Werror=class-memaccess]
memset(&new_data[Size], 0, (size_t)(new_capacity - Size) * sizeof(value_type)); // BK - clear garbage so that 0 initialized ImString works properly.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from …/…/…/…/…/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp:620:
…/…/…/…/…/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_internal.h:262:8: note: ‘struct ImGuiStyleMod’ declared here
struct ImGuiStyleMod
^~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

Either check my mame patches and implement them for this mame fork, or just use mame.

I thought we were setting an xattr on the gcc executable so that it is always run with ASLR disabled? Is that not working anymore, and if so, did someone make a bugreport about it?

I did https://github.com/haikuports/haikuports/issues/3875.

1 Like

I’ll see what I can figure out with that the next time I get the chance. Thanks for the help!