Minimal Build For Linux

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Loxy618
Posts: 21
Joined: Wed Apr 24, 2019 2:01 am

Minimal Build For Linux

Post by Loxy618 » Wed Jul 29, 2020 12:56 pm

Hi All-
I'm trying to build the minimal build for an embedded linux platform. Eventually I'll want to make a static library but for now just trying to get it to compile. In the make file I changed CROSS=0 and left all else the same. I can build and generate the static lib correctly if CROSS=1

It starts off okay and then I get a lot of errors following and it's unclear where to go from here. I'm a little new to this so any help would be appreciated (and also suggestions when I need to build the static lib)

Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
mkdir -p build/genhdr
GEN build/genhdr/mpversion.h
GEN build/genhdr/moduledefs.h
GEN build/genhdr/qstr.i.last
In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h:9:0,
from ../../py/mpstate.h:29,
from ../../py/mpstate.c:27:
/usr/include/stdint.h:26:10: fatal error: bits/libc-header-start.h: No such file or directory
#include <bits/libc-header-start.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from ../../py/malloc.c:27:0:
/usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
#include <bits/libc-header-start.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/assert.h:35:0,
from ../../py/gc.c:28:
/usr/include/features.h:424:12: fatal error: sys/cdefs.h: No such file or directory
# include <sys/cdefs.h>
^~~~~~~~~~~~~
compilation terminated.
In file included from ../../py/pystack.c:27:0:
/usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
#include <bits/libc-header-start.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Minimal Build For Linux

Post by jimmo » Wed Jul 29, 2020 11:58 pm

Loxy618 wrote:
Wed Jul 29, 2020 12:56 pm
I'm trying to build the minimal build for an embedded linux platform.
Are you compiling on the embedded device, or on your main PC?
Loxy618 wrote:
Wed Jul 29, 2020 12:56 pm
Eventually I'll want to make a static library but for now just trying to get it to compile.
FYI you might find https://github.com/micropython/micropython/pull/5964 interesting (I need to finish off a couple of things here but the approach in general is likely to be what's merged).
Loxy618 wrote:
Wed Jul 29, 2020 12:56 pm
/usr/include/stdint.h:26:10: fatal error: bits/libc-header-start.h: No such file or directory
Can you try removing the "-m32" from CFLAGS and LDFLAGS?

Post Reply