Newsgroup: tilde.python

Back to Article List


Warning: Undefined array key 1 in /home/deepend/public_html/netnews/view_article.php on line 26

From: yeti <yeti@tilde.institute>

Subject: MicroPython && OpenBSD

Date: Mon, 10 Aug 2026 10:11:25 +0042

References: N/A

-----------------------------------8<-----------------------------------~$ cat ~/opt/micropython/src/openbsd.diff
diff --git a/mpy-cross/mpconfigport.h b/mpy-cross/mpconfigport.h
index ee7f98e..53536dc 100644
--- a/mpy-cross/mpconfigport.h
+++ b/mpy-cross/mpconfigport.h
@@ -110,7 +110,7 @@ typedef long mp_off_t;
#define MP_PLAT_PRINT_STRN(str,  len) (void)0

// We need to provide a declaration/definition of alloca()
-#if defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include 
#elif defined(_WIN32)
#include 
diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h
index 0f4ee97..4d93b91 100644
--- a/ports/unix/mpconfigport.h
+++ b/ports/unix/mpconfigport.h
@@ -96,7 +96,7 @@ typedef long mp_off_t;
// We need to provide a declaration/definition of alloca()
// unless support for it is disabled.  
#if !defined(MICROPY_NO_ALLOCA) || MICROPY_NO_ALLOCA == 0
-#if defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include 
#else
#include ~$ micropython                                                             
MicroPython 5f2181f938-dirty on 2026-08-09; linux [GCC 11.2.0] version
Type "help()" for more information.  
>>>
~$ █
----------------------------------->8-----------------------------------

I've not massively tested it yet on ~institute,  but I think the changes
to just get 'alloca.h' located like on the other BSDs does not look like
a too crazy idea.  

Fingers crossed.  
--
Garbage
Only Happy When It Rains