From 9b385153b69a2e76bf8e678ab2ecd0554cb794d0 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 6 Aug 2016 22:27:19 +0200 Subject: [PATCH 1/3] Import changes from 1.55.0: buildtools --- tools/build/src/engine/boehm_gc/include/gc_config_macros.h | 2 +- tools/build/src/engine/boehm_gc/include/private/gcconfig.h | 13 +++++++++++++ tools/build/src/engine/boehm_gc/os_dep.c | 11 ++++++++++- tools/build/src/engine/jam.h | 5 +++++ tools/build/src/engine/jambase.c | 12 ++++++++++++ tools/build/src/tools/builtin.py | 2 +- 6 files changed, 42 insertions(+), 3 deletions(-) diff --git a/tools/build/src/engine/boehm_gc/include/gc_config_macros.h b/tools/build/src/engine/boehm_gc/include/gc_config_macros.h index 762162a..723b4c3 100644 --- a/tools/build/src/engine/boehm_gc/include/gc_config_macros.h +++ b/tools/build/src/engine/boehm_gc/include/gc_config_macros.h @@ -62,7 +62,7 @@ # if defined(GC_SOLARIS_THREADS) || defined(GC_FREEBSD_THREADS) || \ defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) || \ - defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \ + defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || defined(GC_HAIKU_THREADS) || \ defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \ defined(GC_AIX_THREADS) || defined(GC_NETBSD_THREADS) || \ (defined(GC_WIN32_THREADS) && defined(__CYGWIN32__)) || \ diff --git a/tools/build/src/engine/boehm_gc/include/private/gcconfig.h b/tools/build/src/engine/boehm_gc/include/private/gcconfig.h index 61cf9eac..427a9be 100644 --- a/tools/build/src/engine/boehm_gc/include/private/gcconfig.h +++ b/tools/build/src/engine/boehm_gc/include/private/gcconfig.h @@ -219,6 +219,12 @@ # define I386 # define HAIKU # define mach_type_known +# endif +# if defined(__HAIKU__) && defined(__x86_64__) +# define X86_64 +# define HAIKU +# define mach_type_known +# endif # if defined(LINUX) && (defined(i386) || defined(__i386__)) # define I386 # define mach_type_known @@ -1025,6 +1031,13 @@ # extern int etext[]; # define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff)) # endif +# ifdef HAIKU +# define OS_TYPE "HAIKU" +# include +# define GETPAGESIZE() B_PAGE_SIZE + extern int etext[]; +# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff)) +# endif # ifdef SOLARIS # define OS_TYPE "SOLARIS" extern int _etext[], _end[]; diff --git a/tools/build/src/engine/boehm_gc/os_dep.c b/tools/build/src/engine/boehm_gc/os_dep.c index 2dd087f..8be17f8 100644 --- a/tools/build/src/engine/boehm_gc/os_dep.c +++ b/tools/build/src/engine/boehm_gc/os_dep.c @@ -776,6 +776,15 @@ ptr_t GC_get_main_stack_base(void){ } # endif /* BEOS */ +# ifdef HAIKU +# include +ptr_t GC_get_main_stack_base(void){ + thread_info th; + get_thread_info(find_thread(NULL),&th); + return th.stack_end; +} +# endif /* HAIKU */ + # ifdef HAIKU # include @@ -1106,7 +1115,7 @@ ptr_t GC_get_main_stack_base(void) #endif /* FREEBSD_STACKBOTTOM */ -#if !defined(BEOS) && !defined(AMIGA) && !defined(MSWIN32) \ +#if !defined(BEOS) && !defined(__HAIKU__) && !defined(AMIGA) && !defined(MSWIN32) \ && !defined(MSWINCE) && !defined(OS2) && !defined(NOSYS) && !defined(ECOS) \ && !defined(CYGWIN32) && !defined(HAIKU) diff --git a/tools/build/src/engine/jam.h b/tools/build/src/engine/jam.h index ec56fe2..4ed4935 100644 --- a/tools/build/src/engine/jam.h +++ b/tools/build/src/engine/jam.h @@ -162,6 +162,11 @@ #define OS_BEOS #define NO_VFORK #endif +#ifdef __HAIKU__ + #define unix + #define OSMINOR "OS=HAIKU" + #define OS_HAIKU +#endif #ifdef __bsdi__ #define OSMINOR "OS=BSDI" #define OS_BSDI diff --git a/tools/build/src/engine/jambase.c b/tools/build/src/engine/jambase.c index 80a7e12..93f05e5 100644 --- a/tools/build/src/engine/jambase.c +++ b/tools/build/src/engine/jambase.c @@ -548,6 +548,18 @@ char *jambase[] = { "NOARSCAN ?= true ;\n", "STDHDRS ?= /boot/develop/headers/posix ;\n", "}\n", +"else if $(OS) = HAIKU\n", +"{\n", +"BINDIR ?= /boot/system/bin ;\n", +"CC ?= gcc ;\n", +"C++ ?= $(CC) ;\n", +"FORTRAN ?= \"\" ;\n", +"LIBDIR ?= /boot/system/lib ;\n", +"LINK ?= gcc ;\n", +"LINKLIBS ?= -lnetwork ;\n", +"NOARSCAN ?= true ;\n", +"STDHDRS ?= /boot/develop/headers/posix ;\n", +"}\n", "else if $(OS) = BEOS\n", "{\n", "BINDIR ?= /boot/apps ;\n", diff --git a/tools/build/src/tools/builtin.py b/tools/build/src/tools/builtin.py index ee6474b..d2bc86d 100644 --- a/tools/build/src/tools/builtin.py +++ b/tools/build/src/tools/builtin.py @@ -82,7 +82,7 @@ def variant (name, parents_or_properties, explicit_properties = []): feature.compose ("" + name, explicit_properties.all()) __os_names = """ - amiga aix appletv bsd cygwin darwin dos emx freebsd hpux iphone linux netbsd + amiga aix appletv bsd cygwin darwin dos emx freebsd haiku hpux iphone linux netbsd openbsd osf qnx qnxnto sgi solaris sun sunos svr4 sysv ultrix unix unixware vms windows """.split() -- 2.7.4 From 4590512a658de907d6c9e85da35a285fbfa12b54 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 6 Aug 2016 22:27:41 +0200 Subject: [PATCH 2/3] Import changes from 1.55.0: sourcecode --- boost/thread/detail/platform.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boost/thread/detail/platform.hpp b/boost/thread/detail/platform.hpp index 1f33b1a..3670ffa 100644 --- a/boost/thread/detail/platform.hpp +++ b/boost/thread/detail/platform.hpp @@ -32,7 +32,7 @@ # define BOOST_THREAD_CYGWIN #elif (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(BOOST_DISABLE_WIN32) # define BOOST_THREAD_WIN32 -#elif defined(__BEOS__) +#elif defined(__BEOS__) || defined(__HAIKU__) # define BOOST_THREAD_BEOS #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) # define BOOST_THREAD_MACOS -- 2.7.4 From 48e79f3fd52d96c0527e376d1261d10d79942706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 31 Dec 2016 11:23:58 +0100 Subject: [PATCH 3/3] replace wait4 by waitpid for Haiku --- tools/build/src/engine/execunix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/build/src/engine/execunix.c b/tools/build/src/engine/execunix.c index 21a223d..c6ec622 100644 --- a/tools/build/src/engine/execunix.c +++ b/tools/build/src/engine/execunix.c @@ -515,7 +515,11 @@ void exec_wait() close_streams( i, ERR ); /* Reap the child and release resources. */ +#ifdef __HAIKU__ + while ( ( pid = waitpid( cmdtab[ i ].pid, &status, 0 ) ) == -1 ) +#else while ( ( pid = wait4( cmdtab[ i ].pid, &status, 0, &cmd_usage ) ) == -1 ) +#endif if ( errno != EINTR ) break; if ( pid != cmdtab[ i ].pid ) -- 2.7.4