ESP Open SDK compile error on OSX

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
andreagrandi
Posts: 16
Joined: Fri Feb 05, 2016 6:48 pm
Contact:

ESP Open SDK compile error on OSX

Post by andreagrandi » Sun Mar 06, 2016 9:48 pm

Hi, I'm trying to follow these instructions https://github.com/pfalcon/esp-open-sdk
to build the toolchain on OSX (El Capitan) but I'm getting this error:

Code: Select all

Now configured for "xtensa-lx106-elf"
sed -r -i.org s%CT_PREFIX_DIR=.*%CT_PREFIX_DIR="/Volumes/case-sensitive/esp-open-sdk/xtensa-lx106-elf"% .config
sed -r -i s%CT_INSTALL_DIR_RO=y%"#"CT_INSTALL_DIR_RO=y% .config
cat ../crosstool-config-overrides >> .config
./ct-ng build
[INFO ]  Performing some trivial sanity checks
[INFO ]  Build started 20160306.210216
[INFO ]  Building environment variables
[INFO ]  =================================================================
[INFO ]  Retrieving needed toolchain components' tarballs
[INFO ]  Retrieving needed toolchain components' tarballs: done in 359.00s (at 06:02)
[INFO ]  =================================================================
[INFO ]  Extracting and patching toolchain components
[INFO ]  Extracting and patching toolchain components: done in 143.00s (at 08:26)
[INFO ]  =================================================================
[INFO ]  Installing GMP for host
[INFO ]  Installing GMP for host: done in 73.00s (at 09:39)
[INFO ]  =================================================================
[INFO ]  Installing MPFR for host
[INFO ]  Installing MPFR for host: done in 30.00s (at 10:09)
[INFO ]  =================================================================
[INFO ]  Installing ISL for host
[INFO ]  Installing ISL for host: done in 36.00s (at 10:45)
[INFO ]  =================================================================
[INFO ]  Installing CLooG for host
[INFO ]  Installing CLooG for host: done in 12.00s (at 10:57)
[INFO ]  =================================================================
[INFO ]  Installing MPC for host
[INFO ]  Installing MPC for host: done in 12.00s (at 11:09)
[INFO ]  =================================================================
[INFO ]  Installing binutils for host
[INFO ]  Installing binutils for host: done in 82.00s (at 12:31)
[INFO ]  =================================================================
[INFO ]  Installing pass-2 core C compiler
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstddef:46:9: error: no member named 'ptrdiff_t' in the global namespace
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:413:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:440:56: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:756:66: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:756:54: error: template parameter missing a default argument
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:755:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:903:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1522:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1550:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1580:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1644:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1736:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1833:23: error: use of undeclared identifier 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1835:65: error: expected class name
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1850:12: error: use of undeclared identifier 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1851:22: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1853:16: error: use of undeclared identifier 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1854:11: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1854:29: error: use of undeclared identifier 'ptrdiff_t'
[ERROR]    fatal error: too many errors emitted, stopping now [-ferror-limit=]
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstddef:46:9: error: no member named 'ptrdiff_t' in the global namespace
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstddef:46:9: error: no member named 'ptrdiff_t' in the global namespace
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:413:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:440:56: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:756:66: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:756:54: error: template parameter missing a default argument
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:755:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:903:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:413:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:440:56: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1522:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:756:66: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:756:54: error: template parameter missing a default argument
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1550:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1580:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1644:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1736:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1833:23: error: use of undeclared identifier 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1835:65: error: expected class name
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:755:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1850:12: error: use of undeclared identifier 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:903:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1851:22: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1853:16: error: use of undeclared identifier 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1854:11: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1854:29: error: use of undeclared identifier 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memoryfatal error:: too many errors emitted, stopping now [-ferror-limit=]
[ERROR]    1522:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1550:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1580:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1644:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1736:13: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1833:23: error: use of undeclared identifier 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1835:65: error: expected class name
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1850:12: error: use of undeclared identifier 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1851:22: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1853:16: error: use of undeclared identifier 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1854:11: error: unknown type name 'ptrdiff_t'
[ERROR]    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1854:29: error: use of undeclared identifier 'ptrdiff_t'
[ERROR]    fatal error: too many errors emitted, stopping now [-ferror-limit=]
[ERROR]    make[4]: *** [graphite.o] Error 1
[ERROR]    make[4]: *** [graphite-blocking.o] Error 1
[ERROR]    make[4]: *** [graphite-clast-to-gimple.o] Error 1
[ERROR]    make[3]: *** [all-gcc] Error 2
[ERROR]
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing pass-2 core C compiler'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@216]
[ERROR]  >>        called from: do_cc_core_backend[scripts/build/cc/gcc.sh@483]
[ERROR]  >>        called from: do_cc_core_pass_2[scripts/build/cc/gcc.sh@153]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@638]
[ERROR]  >>
[ERROR]  >>  For more info on this error, look at the file: 'build.log'
[ERROR]  >>  There is a list of known issues, some with workarounds, in:
[ERROR]  >>      'share/doc/crosstool-ng/ct-ng.1.20.0/B - Known issues.txt'
[ERROR]
[ERROR]  (elapsed: 14:40.00)
[14:41] / make[2]: *** [build] Error 1
make[1]: *** [_toolchain] Error 2
make: *** [/Volumes/case-sensitive/esp-open-sdk/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc] Error 2
I've tried to google for this error but it looks like I need to manually change some code and I'd rather not to do that otherwise it won't be easy to stay up to date with the main branch if something changes. Have you experienced the same problem on OSX? Were you able to fix it?

Thanks

User avatar
Ivoah
Posts: 5
Joined: Wed Mar 02, 2016 10:43 pm

Re: ESP Open SDK compile error on OSX

Post by Ivoah » Sun Mar 06, 2016 11:20 pm

From https://github.com/pfalcon/esp-open-sdk/issues/45, just make once, and after it fails run

Code: Select all

sed -i '/__need_size_t/d' ./crosstool-NG/.build/src/gmp-5.1.3/gmp-h.in
and then make again. I literally just had this issue, and this command fixed it.

User avatar
andreagrandi
Posts: 16
Joined: Fri Feb 05, 2016 6:48 pm
Contact:

Re: ESP Open SDK compile error on OSX

Post by andreagrandi » Mon Mar 07, 2016 6:42 am

This worked! Thank you so much. I was able to install the toolchain. Now when I compile esp8266 I get another error:

Code: Select all

CC ../py/../extmod/moduheapq.c
CC ../py/../extmod/moduhashlib.c
../py/../extmod/moduhashlib.c:37:37: fatal error: lib/axtls/crypto/crypto.h: No such file or directory
 #include "lib/axtls/crypto/crypto.h"
                                     ^
compilation terminated.
make: *** [build/py/../extmod/moduhashlib.o] Error 1
Did you have this one too?

User avatar
andreagrandi
Posts: 16
Joined: Fri Feb 05, 2016 6:48 pm
Contact:

Re: ESP Open SDK compile error on OSX

Post by andreagrandi » Mon Mar 07, 2016 6:57 am

Never mind, I fixed with this command:

Code: Select all

git submodule update --init
reference: http://forum.micropython.org/viewtopic.php?f=16&t=1520

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

Re: ESP Open SDK compile error on OSX

Post by platforma » Mon Mar 07, 2016 12:54 pm

pfalcon perhaps should make the "Be sure to clone recursively" line bold and in massive font :) A few people have made this mistake already.

User avatar
andreagrandi
Posts: 16
Joined: Fri Feb 05, 2016 6:48 pm
Contact:

Re: ESP Open SDK compile error on OSX

Post by andreagrandi » Mon Mar 07, 2016 1:06 pm

platforma wrote:pfalcon perhaps should make the "Be sure to clone recursively" line bold and in massive font :) A few people have made this mistake already.
it doesn't work anyway. When I cloned it the first time I used:

Code: Select all

git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
and I had to use the other command later to make it work.

Post Reply