Error while I try to make UNix port

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
zaord
Posts: 96
Joined: Fri Jan 31, 2020 3:56 pm

Error while I try to make UNix port

Post by zaord » Fri Jul 17, 2020 12:54 pm

Hi here ;)

I have an error while I try to build micropython unix port :

Code: Select all

CC ../../extmod/modussl_axtls.c
In file included from ../../lib/axtls/ssl/tls1.h:46,
                 from ../../lib/axtls/ssl/ssl.h:75,
                 from ../../extmod/modussl_axtls.c:35:
../../lib/axtls/ssl/os_port.h:1:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
    1 | os_port_micropython.h
      |                    ^
In file included from ../../lib/axtls/crypto/crypto.h:42,
                 from ../../lib/axtls/ssl/tls1.h:47,
                 from ../../lib/axtls/ssl/ssl.h:75,
                 from ../../extmod/modussl_axtls.c:35:
../../lib/axtls/crypto/bigint_impl.h:89:5: error: unknown type name ‘comp’
   89 |     comp* comps;                /**< A ptr to the actual component data */
      |     ^~~~
In file included from ../../lib/axtls/crypto/crypto.h:43,
                 from ../../lib/axtls/ssl/tls1.h:47,
                 from ../../lib/axtls/ssl/ssl.h:75,
                 from ../../extmod/modussl_axtls.c:35:
../../lib/axtls/crypto/bigint.h:46:32: error: unknown type name ‘comp’
   46 | bigint *int_to_bi(BI_CTX *ctx, comp i);
      |                                ^~~~
make: *** [../../py/mkrules.mk:47: build-standard/extmod/modussl_axtls.o] Error 1
Did anyone solved this already ?

Best

User avatar
rcolistete
Posts: 352
Joined: Thu Dec 31, 2015 3:12 pm
Location: Brazil
Contact:

Re: Error while I try to make UNix port

Post by rcolistete » Fri Jul 17, 2020 3:33 pm

Have you done these steps ?

Code: Select all

[compiling_firmware]$ git clone --recurse-submodules https://github.com/rcolistete/micropython
[compiling_firmware]$ cd micropython
[micropython]$ git submodule update --init
[micropython]$ cd ports/unix
[unix]$ make clean
[unix]$ make -j8 submodules
[unix]$ make -j8
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

zaord
Posts: 96
Joined: Fri Jan 31, 2020 3:56 pm

Re: Error while I try to make UNix port

Post by zaord » Sat Jul 18, 2020 8:45 pm

Okay i reclean all and now its fixed :) tack !

garya@arcimoto.com
Posts: 7
Joined: Mon Oct 26, 2020 6:26 pm

Re: Error while I try to make UNix port

Post by garya@arcimoto.com » Thu Dec 17, 2020 9:39 pm

HI,
I'm having the same issue and the solution posted did not solve it.
Any other ideas are truly welcome and greatly appreciated.
Thank you in advance for your assistance.

garya@arcimoto.com
Posts: 7
Joined: Mon Oct 26, 2020 6:26 pm

Re: Error while I try to make UNix port

Post by garya@arcimoto.com » Fri Dec 18, 2020 12:52 am

Hi,
I have this same issue and I followed the recipe that was presented and I still get the following:

Code: Select all

CC ../../extmod/modussl_axtls.c
In file included from ../../lib/axtls/ssl/tls1.h:46,
                 from ../../lib/axtls/ssl/ssl.h:75,
                 from ../../extmod/modussl_axtls.c:35:
../../lib/axtls/ssl/os_port.h:1:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
    1 | os_port_micropython.h
      |                    ^
In file included from ../../lib/axtls/crypto/crypto.h:42,
                 from ../../lib/axtls/ssl/tls1.h:47,
                 from ../../lib/axtls/ssl/ssl.h:75,
                 from ../../extmod/modussl_axtls.c:35:
../../lib/axtls/crypto/bigint_impl.h:89:5: error: unknown type name ‘comp’
   89 |     comp* comps;                /**< A ptr to the actual component data */
      |     ^~~~
In file included from ../../lib/axtls/crypto/crypto.h:43,
                 from ../../lib/axtls/ssl/tls1.h:47,
                 from ../../lib/axtls/ssl/ssl.h:75,
                 from ../../extmod/modussl_axtls.c:35:
../../lib/axtls/crypto/bigint.h:46:32: error: unknown type name ‘comp’
   46 | bigint *int_to_bi(BI_CTX *ctx, comp i);
      |                                ^~~~
make: *** [../../py/mkrules.mk:47: build/extmod/modussl_axtls.o] Error 1
I doing this under Cygwin with
$ gcc --version
gcc (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

What am I doing wrong?
Any help would be greatly appreciated!
Thanks in advance for all your help.

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: Error while I try to make UNix port

Post by stijn » Fri Dec 18, 2020 8:01 am

os_port.h should be a symlink, instead it seems to be a plain text file with the name of the files it links to.
This has been discussed on github, IIRC the solution is to configure git to use symlinks. See e.g. https://github.com/micropython/micropython/issues/6519: should be sufficient to have a recent git version, set core.symlinks to true (git config --global core.symlinks true) and then clone again.

Have you done these steps?
Note that for a fresh clone these are sufficient for the unix build:

Code: Select all

git clone git@github.com:micropython/micropython.git
cd micropython/ports/unix
make submodules  # This already calls git submodule update --init --recursive
make

manseekingknowledge
Posts: 61
Joined: Sun Oct 29, 2017 5:14 pm

Re: Error while I try to make UNix port

Post by manseekingknowledge » Mon Nov 21, 2022 9:47 am

For my setup (WSL 1), I couldn't the "git config --global core.symlinks true" solution to work. Didn't matter if I cloned from the command line in WSL or if I was using SmartGit. The git install in WSL, Windows, and the settings in SmartGit all had symlinks set to true, but still didn't work. I finally remembered after many hours of struggling that when I started using MicroPython like 6 years ago I had this same problem. My solution today was the same as it was then, use mklink in Windows to correct the broken links. As an example, for os_port.h, open the file in notepad, copy the path in the file, delete the file, then run the command "mklink {path_you_copied} os_port.h" Build, then repeat process on other files if there are any more build failures. You have to use windows "mklink", not WSL "ln".

Post Reply