From 80b94a546f027aeef1286643a195c44b6c99b569 Mon Sep 17 00:00:00 2001 From: Alex von Gluck IV Date: Mon, 3 Sep 2018 07:55:43 -0400 Subject: [PATCH] Haiku support patches (#989) * Haiku: fix broken gcc strong stack protector * qemu: Backport minor Haiku fix We need to push this fix upstream to qemu. If we don't get it upstreamed, i'll circle back and patch it if Unicorn updates its qemu version. Backports commit c7be4a2160e15089563f207752fb346a38db18ec from unicorn --- Makefile | 9 +++++++++ qemu/util/oslib-posix.c | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/Makefile b/Makefile index 53ede052..6ca648cd 100644 --- a/Makefile +++ b/Makefile @@ -139,6 +139,15 @@ UNICORN_CFLAGS := $(UNICORN_CFLAGS:-fPIC=) $(LIBNAME)_LDFLAGS += -Wl,--output-def,unicorn.def DO_WINDOWS_EXPORT = 1 +# Haiku +else ifneq ($(filter Haiku%,$(UNAME_S)),) +EXT = so +VERSION_EXT = $(EXT).$(API_MAJOR) +AR_EXT = a +$(LIBNAME)_LDFLAGS += -Wl,-Bsymbolic-functions,-soname,lib$(LIBNAME).$(VERSION_EXT) +UNICORN_CFLAGS := $(UNICORN_CFLAGS:-fPIC=) +UNICORN_QEMU_FLAGS += --disable-stack-protector + # Linux, Darwin else EXT = so diff --git a/qemu/util/oslib-posix.c b/qemu/util/oslib-posix.c index 31e2b397..b97e2aa9 100644 --- a/qemu/util/oslib-posix.c +++ b/qemu/util/oslib-posix.c @@ -51,7 +51,11 @@ #include #include #include +#ifdef __HAIKU__ +#include +#else #include +#endif #include "qemu/cutils.h" #ifdef CONFIG_LINUX