mkiiskila closed pull request #780: Run sim on FreeBSD.
URL: https://github.com/apache/mynewt-core/pull/780
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/compiler/sim/compiler.yml b/compiler/sim/compiler.yml
index a2e619f53..bbfa3473e 100644
--- a/compiler/sim/compiler.yml
+++ b/compiler/sim/compiler.yml
@@ -49,3 +49,9 @@ compiler.path.objcopy.DARWIN.OVERWRITE: "gobjcopy"
 compiler.flags.base.DARWIN: >
     -DMN_OSX
 compiler.ld.resolve_circular_deps.DARWIN.OVERWRITE: false
+
+compiler.path.cc.FREEBSD.OVERWRITE: "gcc7"
+compiler.path.as.FREEBSD.OVERWRITE: "gcc7"
+compiler.flags.base.FREEBSD: >
+    -DMN_FreeBSD -D_WITH_DPRINTF
+compiler.ld.flags.FREEBSD.OVERWRITE: -L/usr/lib32 -B/usr/lib32 -lutil
diff --git a/hw/mcu/native/src/hal_uart.c b/hw/mcu/native/src/hal_uart.c
index 4b0ab0935..becb093d8 100644
--- a/hw/mcu/native/src/hal_uart.c
+++ b/hw/mcu/native/src/hal_uart.c
@@ -30,6 +30,9 @@
 #ifdef MN_OSX
 #include <util.h>
 #endif
+#ifdef MN_FreeBSD
+#include <libutil.h>
+#endif
 #include <ctype.h>
 #include <stdio.h>
 #include <fcntl.h>
diff --git a/kernel/os/src/arch/sim/os_arch_stack_frame.s 
b/kernel/os/src/arch/sim/os_arch_stack_frame.s
index 90e9b3a83..81e5c066e 100644
--- a/kernel/os/src/arch/sim/os_arch_stack_frame.s
+++ b/kernel/os/src/arch/sim/os_arch_stack_frame.s
@@ -23,6 +23,9 @@
 #elif defined MN_OSX
 #define sigsetjmp   sigsetjmp
 #define CNAME(x)    _ ## x
+#elif defined MN_FreeBSD
+#define sigsetjmp   sigsetjmp
+#define CNAME(x)    x
 #else
 #error "unsupported platform"
 #endif
diff --git a/kernel/sim/src/sim_priv.h b/kernel/sim/src/sim_priv.h
index a866f8a1a..09d580df9 100644
--- a/kernel/sim/src/sim_priv.h
+++ b/kernel/sim/src/sim_priv.h
@@ -20,6 +20,7 @@
 #ifndef H_SIM_PRIV_
 #define H_SIM_PRIV_
 
+#include <sys/types.h>
 #include <os/os.h>
 
 #ifdef __cplusplus


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to