--- lib/profile/InstrProfilingPlatformLinux.c.orig 2016-05-23 02:36:03.000000000 +1000 +++ lib/profile/InstrProfilingPlatformLinux.c 2020-05-25 23:13:09.422016000 +1000 @@ -9,7 +9,7 @@ #include "InstrProfiling.h" -#if defined(__linux__) || defined(__FreeBSD__) +#if defined(__linux__) || defined(__FreeBSD__) || defined(__BSDSUniX__) #include #define PROF_DATA_START INSTR_PROF_SECT_START(INSTR_PROF_DATA_SECT_NAME) --- lib/profile/InstrProfilingPlatformOther.c.orig 2016-05-23 02:36:03.000000000 +1000 +++ lib/profile/InstrProfilingPlatformOther.c 2020-05-25 23:15:11.233174000 +1000 @@ -9,7 +9,7 @@ #include "InstrProfiling.h" -#if !defined(__APPLE__) && !defined(__linux__) && !defined(__FreeBSD__) +#if !defined(__APPLE__) && !defined(__linux__) && !defined(__FreeBSD__) && !defined(__BSDSUniX__) #include --- lib/profile/InstrProfilingPort.h.orig 2016-11-30 02:24:00.000000000 +1100 +++ lib/profile/InstrProfilingPort.h 2020-05-25 23:17:32.379863000 +1000 @@ -107,16 +107,16 @@ #define PROF_NOTE(Format, ...) \ fprintf(stderr, "LLVM Profile Note: " Format, __VA_ARGS__); -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__BSDSUniX__) #include #include -#else /* defined(__FreeBSD__) */ +#else /* defined(__FreeBSD__) || defined(__BSDSUniX__) */ #include #include -#endif /* defined(__FreeBSD__) && defined(__i386__) */ +#endif /* (defined(__FreeBSD__) || defined(__BSDSUniX__)) && defined(__i386__) */ #endif /* PROFILE_INSTRPROFILING_PORT_H_ */ --- lib/profile/GCDAProfiling.c.orig 2016-07-26 09:12:53.000000000 +1000 +++ lib/profile/GCDAProfiling.c 2020-05-25 23:20:35.014745000 +1000 @@ -39,13 +39,19 @@ #endif #endif +#if defined(__BSDSUniX__) && defined(__i386__) +#define I386_BSDSUNIX 1 +#else +#define I386_BSDSUNIX 0 +#endif + #if defined(__FreeBSD__) && defined(__i386__) #define I386_FREEBSD 1 #else #define I386_FREEBSD 0 #endif -#if !defined(_MSC_VER) && !I386_FREEBSD +#if !defined(_MSC_VER) && !I386_FREEBSD && !I386_BSDSUNIX #include #endif @@ -53,7 +59,7 @@ typedef unsigned char uint8_t; typedef unsigned int uint32_t; typedef unsigned long long uint64_t; -#elif I386_FREEBSD +#elif I386_FREEBSD || I386_BSDSUNIX /* System headers define 'size_t' incorrectly on x64 FreeBSD (prior to * FreeBSD 10, r232261) when compiled in 32-bit mode. */