diff --git a/Makefile dtc-1.3.0-git/Makefile
index 1169e6c..60077a5 100644
--- a/Makefile
+++ dtc-1.3.0-git/Makefile
@@ -41,6 +41,15 @@ SHAREDLIB_EXT=so
 SHAREDLIB_LINK_OPTIONS=-shared -Wl,--version-script=$(LIBFDT_version) -Wl,-soname,
 endif
 
+ifeq ($(HOSTOS),haiku)
+INSTALL = /bin/install
+endif
+
+ifneq ($(HOSTOS),haiku)
+LIBDL = -ldl
+endif
+
+
 #
 # Overall rules
 #
diff --git a/tests/Makefile.tests dtc-1.3.0-git/tests/Makefile.tests
index 1795466..97b6131 100644
--- a/tests/Makefile.tests
+++ dtc-1.3.0-git/tests/Makefile.tests
@@ -50,7 +50,7 @@ $(LIB_TESTS): %: $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_archive)
 
 $(DL_LIB_TESTS): %: %.o $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_archive)
 	@$(VECHO) LD [libdl] $@
-	$(LINK.c) -o $@ $^ -ldl
+	$(LINK.c) -o $@ $^ $(LIBDL)
 
 $(LIBTREE_TESTS): %: $(TESTS_PREFIX)testutils.o $(TESTS_PREFIX)trees.o \
 		util.o $(LIBFDT_archive)
diff --git a/tests/testutils.c dtc-1.3.0-git/tests/testutils.c
index f185133..66b34df 100644
--- a/tests/testutils.c
+++ dtc-1.3.0-git/tests/testutils.c
@@ -45,16 +45,15 @@ static void sigint_handler(int signum, siginfo_t *si, void *uc)
 {
 	cleanup();
 	fprintf(stderr, "%s: %s (pid=%d)\n", test_name,
-		strsignal(signum), getpid());
+		strsignal(signum), (int)getpid());
 	exit(RC_BUG);
 }
 
 void test_init(int argc, char *argv[])
 {
 	int err;
-	struct sigaction sa_int = {
-		.sa_sigaction = sigint_handler,
-	};
+	struct sigaction sa_int = { };
+	sa_int.sa_sigaction = sigint_handler;
 
 	test_name = argv[0];
 
@@ -66,7 +65,7 @@ void test_init(int argc, char *argv[])
 		verbose_test = 0;
 
 	verbose_printf("Starting testcase \"%s\", pid %d\n",
-		       test_name, getpid());
+		       test_name, (int)getpid());
 }
 
 void check_mem_rsv(void *fdt, int n, uint64_t addr, uint64_t size)
