Skip to content

Commit b5e1974

Browse files
committed
alif: Add support for building C++ user modules.
This allows alif boards to build and run `examples/usercmodule`. Signed-off-by: Damien George <damien@micropython.org>
1 parent 65399bc commit b5e1974

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

ports/alif/mcu/ensemble.ld.S

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ SECTIONS
7575
. = ALIGN(16);
7676
} > ROM
7777

78+
/* For C++ exception handling */
79+
.ARM :
80+
{
81+
__exidx_start = .;
82+
*(.ARM.exidx*)
83+
__exidx_end = .;
84+
} > ROM
85+
7886
.copy.table : ALIGN(4)
7987
{
8088
__copy_table_start__ = .;

ports/alif/nosys_stubs.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* THE SOFTWARE.
2525
*/
2626
#include <errno.h>
27+
#include <unistd.h>
2728

2829
int _write(int handle, char *buffer, int size) {
2930
errno = ENOSYS;
@@ -44,3 +45,12 @@ int _lseek(int f, int ptr, int dir) {
4445
errno = ENOSYS;
4546
return -1;
4647
}
48+
49+
pid_t _getpid(void) {
50+
return 0;
51+
}
52+
53+
int _kill(pid_t pid, int sig) {
54+
errno = EINVAL;
55+
return -1;
56+
}

0 commit comments

Comments
 (0)