Code Monkey home page Code Monkey logo

esp-open-sdk's Introduction

esp-open-sdk

This repository provides the integration scripts to build a complete standalone SDK (with toolchain) for software development with the Espressif ESP8266 and ESP8266EX chips.

The complete SDK consists of:

  1. Xtensa lx106 architecture toolchain (100% OpenSource), based on following projects:

The source code above originates from work done directly by Tensilica Inc., Cadence Design Systems, Inc, and/or their contractors.

  1. ESP8266 IoT SDK from Espressif Systems. This component is only partially open source, (some libraries are provided as binary blobs).

OpenSource components of the SDK are based on:

Requirements and Dependencies

To build the standalone SDK and toolchain, you need a GNU/POSIX system (Linux, BSD, MacOSX, Windows with Cygwin) with the standard GNU development tools installed: bash, gcc, binutils, flex, bison, etc.

Please make sure that the machine you use to build the toolchain has at least 1G free RAM+swap (or more, which will speed up the build).

Debian/Ubuntu

Ubuntu 14.04:

$ sudo apt-get install make unrar-free autoconf automake libtool gcc g++ gperf \
    flex bison texinfo gawk ncurses-dev libexpat-dev python-dev python python-serial \
    sed git unzip bash help2man wget bzip2

Later Debian/Ubuntu versions may require:

$ sudo apt-get install libtool-bin

MacOS:

$ brew tap homebrew/dupes
$ brew install binutils coreutils automake wget gawk libtool help2man gperf gnu-sed --with-default-names grep
$ export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"

In addition to the development tools MacOS needs a case-sensitive filesystem. You might need to create a virtual disk and build esp-open-sdk on it:

$ sudo hdiutil create ~/Documents/case-sensitive.dmg -volname "case-sensitive" -size 10g -fs "Case-sensitive HFS+"
$ sudo hdiutil mount ~/Documents/case-sensitive.dmg
$ cd /Volumes/case-sensitive

Building

Be sure to clone recursively:

$ git clone --recursive https://github.com/pfalcon/esp-open-sdk.git

The project can be built in two modes:

  1. Where the toolchain and tools are kept separate from the vendor IoT SDK which contains binary blobs. This makes licensing more clear, and helps facilitate upgrades to vendor SDK releases.

  2. A completely standalone ESP8266 SDK with the vendor SDK files merged into the toolchain. This mode makes it easier to build software (no additinal -I and -L flags are needed), but redistributability of this build is unclear and upgrades to newer vendor IoT SDK releases are complicated. This mode is default for local builds. Note that if you want to redistribute the binary toolchain built with this mode, you should:

    1. Make it clear to your users that the release is bound to a particular vendor IoT SDK and provide instructions how to upgrade to a newer vendor IoT SDK releases.
    2. Abide by licensing terms of the vendor IoT SDK.

To build the self-contained, standalone toolchain+SDK:

$ make STANDALONE=y

This is the default choice which most people are looking for, so just the following is enough:

$ make

To build the bare Xtensa toolchain and leave ESP8266 SDK separate:

$ make STANDALONE=n

This will download all necessary components and compile them.

Using the toolchain

Once you complete build process as described above, the toolchain (with the Xtensa HAL library) will be available in the xtensa-lx106-elf/ subdirectory. Add xtensa-lx106-elf/bin/ subdirectory to your PATH environment variable to execute xtensa-lx106-elf-gcc and other tools. At the end of build process, the exact command to set PATH correctly for your case will be output. You may want to save it, as you'll need the PATH set correctly each time you compile for Xtensa/ESP.

ESP8266 SDK will be installed in sdk/. If you chose the non-standalone SDK, run the compiler with the corresponding include and lib dir flags:

$ xtensa-lx106-elf-gcc -I$(THISDIR)/sdk/include -L$(THISDIR)/sdk/lib

The extra -I and -L flags are not needed when using the standalone SDK.

Subdirectory examples/ contains some example application(s) which can be built with esp-open-sdk. If you are interested in real-world, full-fledged, advanced example of a project built using esp-open-sdk, check https://github.com/micropython/micropython/tree/master/ports/esp8266.

Pulling updates

The project is updated from time to time, to get updates and prepare to build a new SDK, run:

$ make clean
$ git pull
$ git submodule sync
$ git submodule update --init

If you don't issue make clean (which causes toolchain and SDK to be rebuilt from scratch on next make), you risk getting broken/inconsistent results.

Additional configuration

You can build a statically linked toolchain by uncommenting CT_STATIC_TOOLCHAIN=y in the file crosstool-config-overrides. More fine-tunable options may be available in that file and/or Makefile.

License

esp-open-sdk is in its nature merely a makefile, and is in public domain. However, the toolchain this makefile builds consists of many components, each having its own license. You should study and abide them all.

Quick summary: gcc is under GPL, which means that if you're distributing a toolchain binary you must be ready to provide complete toolchain sources on the first request.

Since version 1.1.0, vendor SDK comes under modified MIT license. Newlib, used as C library comes with variety of BSD-like licenses. libgcc, compiler support library, comes with a linking exception. All the above means that for applications compiled with this toolchain, there are no specific requirements regarding source availability of the application or toolchain. (In other words, you can use it to build closed-source applications). (There're however standard attribution requirements - see licences for details).

esp-open-sdk's People

Contributors

0xdead avatar automationd avatar berkutta avatar chadouming avatar choffee avatar dancudds avatar ekchatzi avatar floodedcodeboy avatar frozendroid avatar george-hopkins avatar gnif avatar happycodingrobot avatar ibobik avatar jcmvbkbc avatar jeremyd2019 avatar joostd avatar karlp avatar kzyapkov avatar likewise avatar martonmiklos avatar mbialon avatar melak avatar mrsurly avatar nekromant avatar olaf-mandel avatar pfalcon avatar pownyan avatar tigeba avatar tobiaskohlbau avatar zerog2k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp-open-sdk's Issues

"Blinky" example fails to build with SDK version 1.1.0

Compiling the "Blinky" example with SDK version 1.1.0 (Ubuntu 14.04.2 LTS) fails with the following error message:

xxx@xxx:/opt/Espressif/source-code-examples/blinky$ make
CC user/user_main.c
AR build/app_app.a
LD build/app.out
/opt/Espressif/ESP8266_SDK/lib/libmain.a(app_main.o): In function `user_uart_wait_tx_fifo_empty':
(.irom0.text+0x34c): undefined reference to `user_rf_pre_init'
/opt/Espressif/ESP8266_SDK/lib/libmain.a(app_main.o): In function `user_uart_wait_tx_fifo_empty':
(.irom0.text+0x474): undefined reference to `user_rf_pre_init'
collect2: error: ld returned 1 exit status
make: *** [build/app.out] Error 1

If I compile the toolchain with the VENDOR_SDK variable in the Makefile set to 1.0.1, the example builds just fine.

Use 0.9.3 SDK

We have a major update on our heads, so I guess it makes sense to update the scripts.

Can't get IoT demo example to build..

Trying to build the default IoT example in the sdk/examples tree.. should these be buildable as delivered, or did I miss reading a document, etc..

All I get from the make when running gen_misc.sh is the following after the input questions, which I choose the defaults:

start...
gmake: Nothing to be done for 'FORCE'.

The makefile seems rather sparse, and I am under the impression there is no parent makefile that should be called above it..

cloog download is missing

The build fails when trying to download cloog. Tried make clean and rebuilding but it can't find it.

[DEBUG]    Trying 'http://www.bastoul.net/cloog/pages/download/cloog-0.18.1'
[DEBUG]    ==> Executing: 'wget' '--passive-ftp' '--tries=3' '-nc' '--progress=dot:binary' '-T' '10' '-O' '/home/parallels/Desktop/Espressif/esp-open-sdk/crosstool-NG/.build/tarballs/cloog-0.18.1.tmp-dl' 'http://www.bastoul.net/cloog/pages/download/cloog-0.18.1' 
[ALL  ]    --2015-08-03 16:23:27--  http://www.bastoul.net/cloog/pages/download/cloog-0.18.1
[ALL  ]    Resolving www.bastoul.net (www.bastoul.net)... failed: Connection timed out.
[ALL  ]    wget: unable to resolve host address `www.bastoul.net'
[DEBUG]    Not at this location: "http://www.bastoul.net/cloog/pages/download/cloog-0.18.1"
[DEBUG]    Trying 'ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-0.18.1'
[DEBUG]    ==> Executing: 'wget' '--passive-ftp' '--tries=3' '-nc' '--progress=dot:binary' '-T' '10' '-O' '/home/parallels/Desktop/Espressif/esp-open-sdk/crosstool-NG/.build/tarballs/cloog-0.18.1.tmp-dl' 'ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-0.18.1' 
[ALL  ]    --2015-08-03 16:23:37--  ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-0.18.1
[ALL  ]               => `/home/parallels/Desktop/Espressif/esp-open-sdk/crosstool-NG/.build/tarballs/cloog-0.18.1.tmp-dl'
[ALL  ]    Resolving gcc.gnu.org (gcc.gnu.org)... failed: Connection timed out.
[ALL  ]    wget: unable to resolve host address `gcc.gnu.org'
[DEBUG]    Not at this location: "ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-0.18.1"
[ERROR]  
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Retrieving needed toolchain components' tarballs'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: do_cloog_get[scripts/build/companion_libs/130-cloog.sh@741]
[ERROR]  >>        called from: do_companion_libs_get[scripts/build/companion_libs.sh@15]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@583]
[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: 2:41.38)

Seems to not exist anymoreโ€ฆ. Any help is appreciated. Thanks

Fails to build on Cygwin

At least two problems, first a dos2unix - git is adding carriage returns which causes problems (e.g. set in ./bootstrap fails). Second, configure says
configure: error: in `/home/.../esp-open-sdk/crosstool-NG':
configure: error: C compiler cannot create executables
Oh yes it can, but they end in ".exe" or something else so whatever test it is using is broken.

wget failure

cp esptool/esptool.py /home/oldfart/esp-open-sdk/xtensa-lx106-elf/bin/
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=189"
--2015-02-13 21:24:41-- http://bbs.espressif.com/download/file.php?id=189
Resolving bbs.espressif.com... 192.185.229.242
Connecting to bbs.espressif.com|192.185.229.242|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7190185 (6.9M) [application/octet-stream]
--2015-02-13 21:24:42-- http://bbs.espressif.com/download/file.php?id=189
Reusing existing connection to bbs.espressif.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 7190185 (6.9M) [application/octet-stream]
Saving to: `file.php?id=189.1'

100%[======================================>] 7,190,185 1.98M/s in 4.4s

2015-02-13 21:24:46 (1.56 MB/s) - `file.php?id=189.1' saved [7190185/7190185]

unzip -q -o esp_iot_sdk_v0.9.5_15_01_23.zip
unzip: cannot find or open esp_iot_sdk_v0.9.5_15_01_23.zip, esp_iot_sdk_v0.9.5_15_01_23.zip.zip or esp_iot_sdk_v0.9.5_15_01_23.zip.ZIP.
make: *** [esp_iot_sdk_v0.9.5/.dir] Error 9

wget needs the -o option to fix this.

Branch for sdk-0.9.4

I have some strange issues with sdk 0.9.5 on my system.
Whenever i try to use a timer (os_timer_disarm, os_timer_setfn, os_timer_arm) it never fires.
Same code works fine in 0.9.4.

Until i figure out what's wrong, could you create a branch sdk-0.9.4?

cant build on ubuntu14.04 x64

i have this error message.

xtensa-lx106-elf-gcc -DHAVE_CONFIG_H -I.   -I../include  -mlongcalls -MT debug_hndlr.o -MD -MP -MF .deps/debug_hndlr.Tpo -c -o debug_hndlr.o debug_hndlr.S
debug_hndlr.S: Assembler messages:
debug_hndlr.S:89: Error: unknown opcode or format name 'wsr.ICOUNT'
debug_hndlr.S:99: Error: unknown opcode or format name 'wsr.IBREAKENABLE'
make[4]: *** [debug_hndlr.o] Error 1
make[4]: Leaving directory `/home/mb/esp-open-sdk/lx106-hal/src'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/mb/esp-open-sdk/lx106-hal/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/mb/esp-open-sdk/lx106-hal'
make[1]: *** [_libhal] Error 2
make[1]: Leaving directory `/home/mb/esp-open-sdk/lx106-hal'
make: *** [/home/mb/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/libhal.a] Error 2

Cannot build a "blinky" example on OSX out of the box

MacBook-Pro-Dawid-2:esp-open-sdk macdada$ pwd
/Volumes/case-sensitive/esp-open-sdk

MacBook-Pro-Dawid-2:esp-open-sdk macdada$ make

cp esptool/esptool.py /Volumes/case-sensitive/esp-open-sdk/xtensa-lx106-elf/bin/
ln -snf esp_iot_sdk_v1.0.0 sdk
Installing vendor SDK headers into toolchain sysroot
Installing vendor SDK libs into toolchain sysroot
Installing vendor SDK linker scripts into toolchain sysroot

Xtensa toolchain is built, to use it:
export PATH=/Volumes/case-sensitive/esp-open-sdk/xtensa-lx106-elf/bin:$PATH

Espressif ESP8266 SDK is installed, its libraries and headers are merged with the toolchain

MacBook-Pro-Dawid-2:esp-open-sdk macdada$ export PATH=/Volumes/case-sensitive/esp-open-sdk/xtensa-lx106-elf/bin:$PATH

MacBook-Pro-Dawid-2:esp-open-sdk macdada$ cd ..
MacBook-Pro-Dawid-2:case-sensitive macdada$ cd source-code-examples/blinky/

MacBook-Pro-Dawid-2:blinky macdada$ make
CC user/user_main.c
make: /opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc: No such file or directory
make: *** [build/user/user_main.o] Error 1

MacBook-Pro-Dawid-2:blinky macdada$ xtensa-lx106-elf-gcc
xtensa-lx106-elf-gcc: fatal error: no input files
compilation terminated.

I guess I should change paths like /opt/Espressif/ in the blink's Makefile to simply calling the lib or to point to /Volumes/case-sensitive/esp-open-sdk/xtensa-lx106-elf/bin?

If so, I'd at least put an info about this to the docs.

libsmartconfig download is missing.

I did a make clean and tried to build again, but it can't re-download libsmart config anymore.

cp esptool/esptool.py /home/tim/esp-open-sdk/xtensa-lx106-elf/bin/
ln -snf esp_iot_sdk_v1.2.0 sdk
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=585"
--2015-07-24 10:41:50--  http://bbs.espressif.com/download/file.php?id=585
Resolving bbs.espressif.com (bbs.espressif.com)... 192.185.229.242
Connecting to bbs.espressif.com (bbs.espressif.com)|192.185.229.242|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2015-07-24 10:41:51 ERROR 404: Not Found.

Makefile:183: recipe for target 'libsmartconfig_2.4.2.zip' failed
make: *** [libsmartconfig_2.4.2.zip] Error 8

The bbs says the file doesn't exist anymore.

patch: adding Espressif libnet80211.a patch to

Makefile patch to support Espressif's libnet fix
(http://bbs.espressif.com/viewtopic.php?f=5&t=426&sid=c6355a0f51f6d5142f6e7fd8329bc0ed)

--- Makefile    2015-04-26 14:32:12.886110295 +0200
+++ Makefile.patch_v101 2015-05-14 15:51:27.891186061 +0200
@@ -58,7 +58,9 @@

 sdk_patch: .sdk_patch_$(VENDOR_SDK)

-.sdk_patch_1.0.1:
+.sdk_patch_1.0.1: libnet80211.zip esp_iot_sdk_v1.0.1/.dir
+   $(UNZIP) $<
+   mv libnet80211.a $(VENDOR_SDK_DIR_1.0.1)/lib/
    patch -d $(VENDOR_SDK_DIR_1.0.1) -p1 < c_types-c99.patch
    @touch $@

@@ -119,6 +121,8 @@
    wget --content-disposition "http://bbs.espressif.com/download/file.php?id=190"
 libssl.zip:
    wget --content-disposition "http://bbs.espressif.com/download/file.php?id=316"
+libnet80211.zip:
+   wget --content-disposition "http://bbs.espressif.com/download/file.php?id=361"

 sdk: $(VENDOR_SDK_DIR)/.dir
    ln -snf $(VENDOR_SDK_DIR) sdk

Cannot Build Toolchain

Using Lubunto, latest version 15.04 32bit, fresh VM. Failed after following directions on the Readme.

First error i recieved was this:

checking for GNU libtool >= 1.5.26... no
configure: error: could not find GNU libtool >= 1.5.26
../Makefile:277: recipe for target '_ct-ng' failed
make[1]: *** [_ct-ng] Error 1

The libexpat-dev dependency was already downloaded. Following advice found elsewhere, i did apt-get install libtool-bin. That got me past that error. But then while trying to do 'make STANDALONE=n', I recieved another error.

make[2]: Entering directory '/home/kratz/esp-open-sdk/crosstool-NG'
[INFO ] Performing some trivial sanity checks
[INFO ] Build started 20150909.203422
[INFO ] Building environment variables
[INFO ] =================================================================
[INFO ] Retrieving needed toolchain components' tarballs
[INFO ] Retrieving needed toolchain components' tarballs: done in 216.05s (at 03:37)
[INFO ] =================================================================
[INFO ] Extracting and patching toolchain components
[INFO ] Extracting and patching toolchain components: done in 105.15s (at 05:22)
[INFO ] =================================================================
[INFO ] Installing GMP for host
[INFO ] Installing GMP for host: done in 76.44s (at 06:39)
[INFO ] =================================================================
[INFO ] Installing MPFR for host
[INFO ] Installing MPFR for host: done in 38.04s (at 07:17)
[INFO ] =================================================================
[INFO ] Installing ISL for host
[INFO ] Installing ISL for host: done in 68.31s (at 08:25)
[INFO ] =================================================================
[INFO ] Installing CLooG for host
[INFO ] Installing CLooG for host: done in 11.35s (at 08:37)
[INFO ] =================================================================
[INFO ] Installing MPC for host
[INFO ] Installing MPC for host: done in 11.96s (at 08:49)
[INFO ] =================================================================
[INFO ] Installing binutils for host
[INFO ] Installing binutils for host: done in 144.77s (at 11:13)
[INFO ] =================================================================
[INFO ] Installing pass-2 core C compiler
[ERROR] collect2: error: ld returned 1 exit status
[ERROR] make[4]: *** [cpp] 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@257]
[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: 21:07.45)
[21:07] / ct-ng:148: recipe for target 'build' failed
make[2]: *** [build] Error 2

What do I do from here?

on Debian Jessie, a pakage named libtool-bin is needed too..

hello,
let me tell you a minor issue i faced.
i'm starting testing your open sdk (thanx for the effort)
during the installation on a Debian "Jessie" environment, (in STANDALONE=n mode..) i followed your suggestion about "apt-get install xxx" packages anyway the first .configure "bumped" on recognition of libtool > 1.5.26..

the issue is that "libtool" binary is missing. In Debian Jessie it's actually installed with the package "libtool-bin" in a 2.x.y version, see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=761791

i don't know why it's not a dependancy of libtool actually.

i suppose you could just explicitly add this package on the suggested list in the README file so everybody following instruction is good to go.

esptool has fallen out of sync

themadinventor/esptool master has merged all changes the pfalcon/esptool esp-open-sdk fork was created for. @projectgus seems to be handling pull requests now. It may be a good idea to switch back. There is also an important commit in there that works around a ROM problem.

0.9.3 SDK missing Wait_SPI_Idle

/home/necromant/x-tools/xtensa-lx106-elf/bin/../xtensa-lx106-elf/sysroot/usr/lib/libmain.a(spi_flash.o):(.text+0xc): undefined reference to `Wait_SPI_Idle'
/home/necromant/x-tools/xtensa-lx106-elf/bin/../xtensa-lx106-elf/sysroot/usr/lib/libmain.a(spi_flash.o): In function `spi_flash_get_id':
(.text+0x20): undefined reference to `Wait_SPI_Idle'

Or is it just me?

"Malformed archive" error building on Mac OS X 10.10

I'm trying to install the SDK on my Mac, but have gotten this error twice now:

Making install in src
 /usr/local/bin/gmkdir -p '/Volumes/Case/lab/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib'
 /usr/local/bin/ginstall -c -m 644  libhal.a '/Volumes/Case/lab/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib'
 ( cd '/Volumes/Case/lab/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib' && xtensa-lx106-elf-ranlib libhal.a )
xtensa-lx106-elf-ranlib: libhal.a: Malformed archive
make[4]: *** [install-libLIBRARIES] Error 1
make[3]: *** [install-am] Error 2
make[2]: *** [install-recursive] Error 1
make[1]: *** [_libhal] Error 2
make: *** [/Volumes/Case/lab/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/libhal.a]     Error 2

I am installing on a case-sensitive drive image, but I used a sparsebundle instead of the fixed 10G image described in the documentation. Could that cause my problem, or is there something else I can check?

MacOS: building crosstool-NG failed

I followed your instructions, but unfortunately I am not able to build successfully. Besides #45 and #43 which I could resolve I am now stuck with the following error

[INFO ]  =================================================================
[INFO ]  Installing pass-2 core C compiler
[INFO ]  Installing pass-2 core C compiler: done in 168.00s (at 05:21)
[INFO ]  =================================================================
[INFO ]  Installing C library
[ERROR]    make[7]: *** [install-toollibLIBRARIES] Error 1
[ERROR]    make[6]: *** [install-am] Error 2
[ERROR]    make[5]: *** [install-recursive] Error 1
[ERROR]    make[4]: *** [install-target-newlib] Error 2
[ERROR]    make[3]: *** [install] Error 2
[ERROR]
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing C library'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@216]
[ERROR]  >>        called from: do_libc[scripts/build/libc/newlib.sh@125]
[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: 6:02.00)
[06:02] / 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

Where is ets_memcpy defined?

In building the IoT example in the sdk/ I fail to link the build due to missing defined functions in the libs --
I searched the symbol tables for all the libs built with the toolchain, but can't find a defined reference to ets_memcpy and several other ets_ functions...

What lib am I missing? or failed to build... note: I built the toolchain as STANDALONE=n

/research/Esp8266/esp-open-sdk/esp_iot_sdk_v1.2.0/lib/libwpa.a(wpas_glue.o):(.irom0.text+0x48): undefined reference to ets_memcpy' /research/Esp8266/esp-open-sdk/esp_iot_sdk_v1.2.0/lib/libwpa.a(wpas_glue.o):(.irom0.text+0x57): undefined reference toets_memset'
/research/Esp8266/esp-open-sdk/esp_iot_sdk_v1.2.0/lib/libwpa.a(aes-wrap.o):(.irom0.text+0x1f): undefined reference to ets_memset' /research/Esp8266/esp-open-sdk/esp_iot_sdk_v1.2.0/lib/libwpa.a(aes-wrap.o): In functionaes_wrap':
(.irom0.text+0x30): undefined reference to `ets_memcpy'

I cannot build IoT_Demo

The Makefile in the IoT_Demo dir has no default make target. Presumably it was supposed to be called by some other Makefile but I cannot find any referece to how this is supposed to be compiled...

Doesn't build on Slackware-current

When trying to build on Slackware Current I get this error message:

[DEBUG]    ==> Executing: 'touch' '/home/bogdan/esp-open-sdk/crosstool-NG/.build/src/.binutils-2.24.extracted'                                                                                                                                                                    
[DEBUG]    ==> Executing: 'rm' '-f' '/home/bogdan/esp-open-sdk/crosstool-NG/.build/src/.binutils-2.24.extracting'                                                                                                                                                                 
[DEBUG]    Entering '/home/bogdan/esp-open-sdk/crosstool-NG/.build/src/binutils-2.24'                                                                                                                                                                                             
[EXTRA]    Patching 'binutils-2.24'
[DEBUG]    Looking for patches in '/home/bogdan/esp-open-sdk/crosstool-NG/lib/ct-ng.1.20.0/patches/binutils/2.24'...
[DEBUG]    ==> Executing: 'patch' '--no-backup-if-mismatch' '-g0' '-F1' '-p1' '-f' '-i' '/home/bogdan/esp-open-sdk/crosstool-NG/lib/ct-ng.1.20.0/patches/binutils/2.24/120-sh-conf.patch'
[ALL  ]    patching file configure
[ALL  ]    Hunk #1 succeeded at 3793 (offset 223 lines).
[ALL  ]    /usr/bin/patch: listing attributes of configure: Invalid argument
[ERROR]
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Extracting and patching toolchain components'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR]  >>        called from: CT_Patch[scripts/functions@1098]
[ERROR]  >>        called from: do_binutils_extract[scripts/build/binutils/binutils.sh@32]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@607]
[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: 8:54.56)

How do we update this?

What's the best way to update this without cloning the whole thing again? are the submodules updated with just git pull in the repo root directory? then do we just call make again without make clean or anything?

This seems to allow the 0.9.5 beta1 to build ok (can compile nodemcu 0.9.5 without any extra symlinks):

diff --git a/Makefile b/Makefile
index c55e2e0..5e3e26c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,14 @@
 TOP = $(PWD)
 TOOLCHAIN = $(TOP)/xtensa-lx106-elf
-VENDOR_SDK = 0.9.3
+VENDOR_SDK = 0.9.5

 UNZIP = unzip -q -o

 VENDOR_SDK_ZIP = $(VENDOR_SDK_ZIP_$(VENDOR_SDK))
 VENDOR_SDK_DIR = $(VENDOR_SDK_DIR_$(VENDOR_SDK))

+VENDOR_SDK_ZIP_0.9.5 = esp_iot_sdk_v0.9.5_b1_14_12_25.zip
+VENDOR_SDK_DIR_0.9.5 = esp_iot_sdk_v0.9.5_b1
 VENDOR_SDK_ZIP_0.9.4 = esp_iot_sdk_v0.9.4_14_12_19.zip
 VENDOR_SDK_DIR_0.9.4 = esp_iot_sdk_v0.9.4
 VENDOR_SDK_ZIP_0.9.3 = esp_iot_sdk_v0.9.3_14_11_21.zip
@@ -46,6 +48,9 @@ libcirom: $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/lib/libcirom.a

 sdk_patch: .sdk_patch_$(VENDOR_SDK)

+.sdk_patch_0.9.5:
+       @touch $@
+
 .sdk_patch_0.9.4:
        @touch $@

@@ -82,6 +87,9 @@ $(VENDOR_SDK_DIR)/.dir: $(VENDOR_SDK_ZIP)
        -mv License $(VENDOR_SDK_DIR)
        touch $@

+esp_iot_sdk_v0.9.5_b1_14_12_25.zip:
+       wget --content-disposition "http://bbs.espressif.com/download/file.php?id=119"
+
 esp_iot_sdk_v0.9.4_14_12_19.zip:
        wget --content-disposition "http://bbs.espressif.com/download/file.php?id=111"

lwip build from source?

Currently liblwip.a is being taken direct from the espressif SDK binary libs, correct? Have you explored the work done by @kadamski at https://github.com/kadamski/esp-lwip - is there a reason not to use this?

I suppose since liblwip source is not being regularly released by Espressif this might be a problem - this was based on a dump of changes on top of 1.4.0.

SDK Makefile versus root Makefile problem

While willing to compile an examples in sdk/app, got the following error:
~/esp8266/esp-open-sdk/sdk/app$ make
../../Makefile:288: warning: overriding commands for target clean' ../Makefile:299: warning: ignoring old commands for targetclean'
You cloned without --recursive, fetching submodules for you.
git submodule update --init --recursive
make -C crosstool-NG -f ../Makefile _ct-ng
make: *** crosstool-NG: No such file or directory. Stop.
make: *** [crosstool-NG/ct-ng] Error 2

This seems to be due to the app Makefile including the ../../Makefile which is the one from root but with a different path, then trying to regenerate the crosstool-NG compile/install process.

Workaround found: rename esp-open-sdk/Makefile to something else(Makefile.old) and app compilation will work.

Problem building on OS X, possibly related to Xcode 6.3 (6D570)

Trying to build on OS X 10.10.3 this morning after getting an Xcode update last night. Working from a clean clone of the repository and building with make STANDALONE=n the process fails with this error:

[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:402:13: error: unknown type name 'ptrdiff_t'

and many more ptrdiff_t related errors until the build ends with

[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[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]

Not sure if this is related to the recent Xcode update or if something completely different is happening.

Compiling Error: Build failed in step 'Installing final compiler'

I tried building the esp-open-sdk in order to compile nodemcu for my ESP.

I got the following error on my Ubuntu 10.04.4 32bit System, during the building process:

[INFO ]  Installing final compiler
[ERROR]    make[4]: *** [cc1] Error 1
[ERROR]    make[3]: *** [all-gcc] Error 2
[ERROR]   
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing final compiler'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR]  >>        called from: do_cc_core_backend[scripts/build/cc/gcc.sh@483]
[ERROR]  >>        called from: do_cc_for_host[scripts/build/cc/gcc.sh@595]
[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: 53:36.00)
[53:37] / make[2]: *** [build] Fehler 2
make[2]: Verlasse Verzeichnis '/home/simon/esp-open-sdk/crosstool-NG'
make[1]: *** [_toolchain] Fehler 2
make[1]: Verlasse Verzeichnis '/home/simon/esp-open-sdk/crosstool-NG'
make: *** [/home/simon/esp-open-sdk/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc] Fehler 2

I hope you can help me with this.
Thanks in Advance.
s137

Espruino with Xtensa on ESP8266

Hi guys!

I am in a mission to run Javascript on esp8266.

I struggled a lot and I managed to compile the Espruino with Xtensa, now all goes well, but I stuck with this linker segmentation overflow "section .text' will not fit in region iram1_0_seg'"

0x00000.bin 195kb
0x40000.bin 144kb

Is there any guru who would like to help me solving this issue?

Espruino: https://github.com/espruino

(Pre)Build fails with Extracting and Patching Toolcahin Components: "gzip: /opt/Espressif/esp-open-sdk-n/crosstool-NG/.build/tarballs/mpc-1.0.2.tar.gz: not in gzip format"

So when I try and run make (after a fresh pull) for either the standalone or non-standlone version of the toolchain the gathering of resource files fails.

[DEBUG] ==> Executing: 'touch' '/opt/Espressif/esp-open-sdk-n/crosstool-NG/.build/src/.cloog-0.18.1.extracted'
[DEBUG] ==> Executing: 'rm' '-f' '/opt/Espressif/esp-open-sdk-n/crosstool-NG/.build/src/.cloog-0.18.1.extracting'
[DEBUG] Entering '/opt/Espressif/esp-open-sdk-n/crosstool-NG/.build/src/cloog-0.18.1'
[EXTRA] Patching 'cloog-0.18.1'
[DEBUG] Looking for patches in '/opt/Espressif/esp-open-sdk-n/crosstool-NG/lib/ct-ng.1.20.0/patches/cloog/0.18.1'...
[DEBUG] Looking for patches in ''...
[DEBUG] Looking for patches in '/opt/Espressif/esp-open-sdk-n/crosstool-NG/local-patches/cloog/0.18.1'...
[DEBUG] Looking for patches in ''...
[ALL ] Overiding config.guess and config.sub
[ALL ] '/opt/Espressif/esp-open-sdk-n/crosstool-NG/scripts/config.guess' -> './autoconf/config.guess'
[ALL ] '/opt/Espressif/esp-open-sdk-n/crosstool-NG/scripts/config.guess' -> './osl/autoconf/config.guess'
[ALL ] '/opt/Espressif/esp-open-sdk-n/crosstool-NG/scripts/config.guess' -> './isl/config.guess'
[ALL ] '/opt/Espressif/esp-open-sdk-n/crosstool-NG/scripts/config.sub' -> './autoconf/config.sub'
[ALL ] '/opt/Espressif/esp-open-sdk-n/crosstool-NG/scripts/config.sub' -> './osl/autoconf/config.sub'
[ALL ] '/opt/Espressif/esp-open-sdk-n/crosstool-NG/scripts/config.sub' -> './isl/config.sub'
[DEBUG] ==> Executing: 'touch' '/opt/Espressif/esp-open-sdk-n/crosstool-NG/.build/src/.cloog-0.18.1.patched'
[DEBUG] ==> Executing: 'rm' '-f' '/opt/Espressif/esp-open-sdk-n/crosstool-NG/.build/src/.cloog-0.18.1.patching'
[DEBUG] ==> Executing: 'mkdir' '-p' '/opt/Espressif/esp-open-sdk-n/crosstool-NG/.build/src/cloog-0.18.1/m4'
[DEBUG] ==> Executing: 'touch' '/opt/Espressif/esp-open-sdk-n/crosstool-NG/.build/src/.mpc-1.0.2.extracting'
[DEBUG] Entering '/opt/Espressif/esp-open-sdk-n/crosstool-NG/.build/src'
[EXTRA] Extracting 'mpc-1.0.2'
[DEBUG] ==> Executing: 'mkdir' '-p' 'mpc-1.0.2'
[DEBUG] ==> Executing: 'tar' '--strip-components=1' '-C' 'mpc-1.0.2' '-xv' '-f' '-'
[FILE ] tar: This does not look like a tar archive
[FILE ] tar: Exiting with failure status due to previous errors
[ERROR]
[ERROR] >>
[ERROR] >> Build failed in step 'Extracting and patching toolchain components'
[ERROR] >> called in step '(top-level)'
[ERROR] >>
[ERROR] >> Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR] >> called from: CT_Extract[scripts/functions@958]
[ERROR] >> called from: do_mpc_extract[scripts/build/companion_libs/140-mpc.sh@21]
[ERROR] >> called from: do_companion_libs_extract[scripts/build/companion_libs.sh@22]
[ERROR] >> called from: main[scripts/crosstool-NG.sh@606]
[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: 13:55.57)

Missing symlinks

Only some of the required symlinks are in place, to mimic the Espressif setup you need:

xt-addr2line         ->  xtensa-lx106-elf-addr2line
xt-ar                ->  xtensa-lx106-elf-ar
xt-c++filt           ->  xtensa-lx106-elf-c++filt
xtensa-lx106-elf-cc  ->  xtensa-lx106-elf-gcc
xt-gprof             ->  xtensa-lx106-elf-gprof
xt-ld                ->  xtensa-lx106-elf-ld
xt-nm                ->  xtensa-lx106-elf-nm
xt-objcopy           ->  xtensa-lx106-elf-objcopy
xt-objdump           ->  xtensa-lx106-elf-objdump
xt-ranlib            ->  xtensa-lx106-elf-ranlib
xt-readelf           ->  xtensa-lx106-elf-readelf
xt-size              ->  xtensa-lx106-elf-size
xt-strings           ->  xtensa-lx106-elf-strings
xt-strip             ->  xtensa-lx106-elf-strip
xt-xc++              ->  xtensa-lx106-elf-cpp
xt-xcc               ->  xtensa-lx106-elf-gcc

Also genflashbinv6 is missing, so Makefiles that rely on it instead of esptool.py won't work.

Unexpected Build Failure on MACOSX

se-steowens-mb1:case-sensitive sowens$ git clone https://github.com/pfalcon/esp-open-sdk.git
Cloning into 'esp-open-sdk'...
remote: Counting objects: 147, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 147 (delta 0), reused 0 (delta 0), pack-reused 144
Receiving objects: 100% (147/147), 30.10 KiB | 0 bytes/s, done.
Resolving deltas: 100% (81/81), done.
Checking connectivity... done
se-steowens-mb1:case-sensitive sowens$ cd esp-open-sdk/
se-steowens-mb1:esp-open-sdk sowens$ ls
Makefile            c_types-c99.patch       crosstool-config-overrides  lx106-hal
README.md           crosstool-NG            esptool
se-steowens-mb1:esp-open-sdk sowens$ make STANDALONE=n
You cloned without --recursive, fetching submodules for you.
git submodule update --init --recursive
Submodule 'crosstool-NG' (https://github.com/jcmvbkbc/crosstool-NG) registered for path 'crosstool-NG'
Submodule 'esptool' (https://github.com/themadinventor/esptool) registered for path 'esptool'
Submodule 'lx106-hal' (https://github.com/tommie/lx106-hal) registered for path 'lx106-hal'
Cloning into 'crosstool-NG'...
remote: Counting objects: 25674, done.
remote: Total 25674 (delta 0), reused 0 (delta 0), pack-reused 25674
Receiving objects: 100% (25674/25674), 14.89 MiB | 3.30 MiB/s, done.
Resolving deltas: 100% (14498/14498), done.
Checking connectivity... done
Submodule path 'crosstool-NG': checked out '7c6bc14de33e7a331ad4932bb505385ba0963eea'
Cloning into 'esptool'...
remote: Counting objects: 164, done.
remote: Total 164 (delta 0), reused 0 (delta 0), pack-reused 164
Receiving objects: 100% (164/164), 51.49 KiB | 0 bytes/s, done.
Resolving deltas: 100% (80/80), done.
Checking connectivity... done
Submodule path 'esptool': checked out '12debb7bfe5e978060ff1919bf87d00ed52c4a72'
Cloning into 'lx106-hal'...
remote: Counting objects: 46, done.
remote: Total 46 (delta 0), reused 0 (delta 0), pack-reused 46
Unpacking objects: 100% (46/46), done.
Checking connectivity... done
Submodule path 'lx106-hal': checked out '90cdf910a8431675b6814ba447550edca3a78d4c'
make -C crosstool-NG -f ../Makefile _ct-ng
./bootstrap
Running autoconf...
Done. You may now run:
    ./configure
./configure --prefix=`pwd`
checking build system type... x86_64-apple-darwin12.5.0
checking host system type... x86_64-apple-darwin12.5.0
checking for a BSD-compatible install... /opt/local/bin/ginstall -c
checking for grep that handles long lines and -e... /usr/local/bin/grep
checking for egrep... /usr/local/bin/grep -E
checking for a sed that does not truncate output... /usr/local/bin/sed
checking whether sed understands -r -i -e... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for ranlib... ranlib
checking for gobjcopy... gobjcopy
checking for absolute path to gobjcopy... /usr/local/bin/gobjcopy
checking for gobjdump... gobjdump
checking for absolute path to gobjdump... /usr/local/bin/gobjdump
checking for greadelf... greadelf
checking for absolute path to greadelf... /usr/local/bin/greadelf
checking for gperf... gperf
checking for absolute path to gperf... /usr/bin/gperf
checking for bison... bison
checking for flex... flex
checking for makeinfo... makeinfo
checking for cut... cut
checking for stat... stat
checking for readlink... readlink
checking for wget... wget
checking for tar... tar
checking for gzip... gzip
checking for bzip2... bzip2
checking for patch... /usr/bin/patch
checking for bash >= 3.1... /bin/bash
checking for GNU awk... /opt/local/bin/gawk
checking for GNU make >= 3.80... /opt/local/bin/gmake
checking whether /opt/local/bin/gmake sets $(MAKE)... yes
checking for make 3.81... no
checking for GNU libtool >= 1.5.26... /opt/local/bin/glibtool
checking for GNU libtoolize >= 1.5.26... /opt/local/bin/glibtoolize
checking for GNU automake >= 1.10... /opt/local/bin/automake
checking for xz... xz
checking for cvs... no
checking for svn... svn
checking for inline... inline
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking libintl.h usability... no
checking libintl.h presence... no
checking for libintl.h... no
checking ncurses/ncurses.h usability... no
checking ncurses/ncurses.h presence... no
checking for ncurses/ncurses.h... no
checking ncurses/curses.h usability... no
checking ncurses/curses.h presence... no
checking for ncurses/curses.h... no
checking ncursesw/curses.h usability... no
checking ncursesw/curses.h presence... no
checking for ncursesw/curses.h... no
checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
checking for library containing initscr... -lncurses
configure: creating ./config.status
config.status: creating Makefile
make MAKELEVEL=0
  SED    'ct-ng'
  SED    'scripts/crosstool-NG.sh'
  SED    'scripts/saveSample.sh'
  SED    'scripts/showTuple.sh'
  GEN    'config/configure.in'
  GEN    'paths.mk'
  GEN    'paths.sh'
  DEP    'nconf.gui.dep'
  DEP    'nconf.dep'
  DEP    'lxdialog/yesno.dep'
  DEP    'lxdialog/util.dep'
  DEP    'lxdialog/textbox.dep'
  DEP    'lxdialog/menubox.dep'
  DEP    'lxdialog/inputbox.dep'
  DEP    'lxdialog/checklist.dep'
  DEP    'mconf.dep'
  DEP    'conf.dep'
  BISON  'zconf.tab.c'
  GPERF  'zconf.hash.c'
  LEX    'lex.zconf.c'
  DEP    'zconf.tab.dep'
  CC     'zconf.tab.o'
In file included from zconf.tab.c:213:
./zconf.hash.c:177:8: warning: implicit declaration of function 'offsetof' is invalid in C99 [-Wimplicit-function-declaration]
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str2),              T_ON,           TF_PARAM},
       ^
./zconf.hash.c:177:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str2),              T_ON,           TF_PARAM},
                ^
./zconf.hash.c:178:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str3),              T_OPT_ENV,      TF_OPTION},
                ^
./zconf.hash.c:180:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str5),              T_ENDIF,        TF_COMMAND},
                ^
./zconf.hash.c:181:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str6),              T_OPTION,       TF_COMMAND},
                ^
./zconf.hash.c:182:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str7),      T_ENDMENU,      TF_COMMAND},
                ^
./zconf.hash.c:183:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str8),      T_OPTIONAL,     TF_COMMAND},
                ^
./zconf.hash.c:184:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str9),      T_ENDCHOICE,    TF_COMMAND},
                ^
./zconf.hash.c:185:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str10),             T_RANGE,        TF_COMMAND},
                ^
./zconf.hash.c:186:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str11),             T_CHOICE,       TF_COMMAND},
                ^
./zconf.hash.c:187:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str12),     T_DEFAULT,      TF_COMMAND, S_UNKNOWN},
                ^
./zconf.hash.c:188:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str13),     T_DEFAULT,      TF_COMMAND, S_BOOLEAN},
                ^
./zconf.hash.c:189:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str14),             T_HELP,         TF_COMMAND},
                ^
./zconf.hash.c:191:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str16),             T_CONFIG,       TF_COMMAND},
                ^
./zconf.hash.c:192:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str17),     T_DEFAULT,      TF_COMMAND, S_TRISTATE},
                ^
./zconf.hash.c:193:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str18),             T_TYPE,         TF_COMMAND, S_HEX},
                ^
./zconf.hash.c:194:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str19),     T_OPT_DEFCONFIG_LIST,TF_OPTION},
                ^
./zconf.hash.c:196:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str22),             T_IF,           TF_COMMAND|TF_PARAM},
                ^
./zconf.hash.c:197:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str23),             T_TYPE,         TF_COMMAND, S_INT},
                ^
./zconf.hash.c:199:17: error: expected expression
      {offsetof(struct kconf_id_strings_t, kconf_id_strings_str27),     T_OPT_MODULES,  TF_OPTION},
                ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [zconf.tab.o] Error 1
make: *** [build-lib-kconfig] Error 2
make: *** [build] Error 2
make[1]: *** [_ct-ng] Error 2
make: *** [crosstool-NG/ct-ng] Error 2
se-steowens-mb1:esp-open-sdk sowens$ 
``

building on osx fails in libcirom: no libc.a

Hi.
I am running into problems building on osx (10.10 - ), it stops when trying to do libcirom in the make.
if i run make libcirom i get:

make: /Volumes/case-sensitive/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/lib/libcirom.a: No such file or directory
make: *** [libcirom] Error 1

looking into xtensa-lx106-elf/xtensa-lx106-elf/sysroot/lib i see the folder is empty.
no libc.a.

i don't see any errors when building crosstool-NG. what went wrong?

Unable to use multiple jobs when compiling

make: *** No rule to make target '/home/pietrushnic/tmp1/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/lib/libc.a', needed by '/home/pietrushnic/tmp1/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/lib/libcirom.a'.  Stop.
make: *** Waiting for unfinished jobs....
You cloned without --recursive, fetching submodules for you.
git submodule update --init --recursive
Submodule 'crosstool-NG' (https://github.com/jcmvbkbc/crosstool-NG) registered for path 'crosstool-NG'
Submodule 'esptool' (https://github.com/themadinventor/esptool) registered for path 'esptool'
Submodule 'lx106-hal' (https://github.com/tommie/lx106-hal) registered for path 'lx106-hal'
Cloning into 'crosstool-NG'...
remote: Counting objects: 25635, done.
remote: Compressing objects: 100% (10653/10653), done.
remote: Total 25635 (delta 14470), reused 25635 (delta 14470)
Receiving objects: 100% (25635/25635), 14.88 MiB | 302.00 KiB/s, done.
Resolving deltas: 100% (14470/14470), done.
Checking connectivity... done.
Submodule path 'crosstool-NG': checked out '7c6bc14de33e7a331ad4932bb505385ba0963eea'
Cloning into 'esptool'...
remote: Counting objects: 152, done.
remote: Total 152 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (152/152), 46.86 KiB | 0 bytes/s, done.
Resolving deltas: 100% (72/72), done.
Checking connectivity... done.
Submodule path 'esptool': checked out 'e1abbf64abe76513ad6e66bb34b7b55229198355'
Cloning into 'lx106-hal'...
remote: Counting objects: 46, done.
remote: Total 46 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (46/46), done.
Checking connectivity... done.
Submodule path 'lx106-hal': checked out '90cdf910a8431675b6814ba447550edca3a78d4c'

Any idea what should be fixed to use multiple CPU jobs when compiling ? Why it complains about libc.a and libcirom.a ?

2nd make after make error is succesful

from a clean workdir, first "make STANDALONE=Y" exited on error on crosstool-NG because of missing libexpat-dev, but 2nd without any changes was able to finish make process.
This can lead to further problems.

can't build toolchain

Hi,

unfortunately, the build gets stuck as shown below.
any hints?

thank you very much!

[user1@manjaro esp-open-sdk]$ make STANDALONE=y
make -C crosstool-NG -f ../Makefile _ct-ng
make[1]: Entering directory '/home/user1/esp-open-sdk/crosstool-NG'
./bootstrap
Running autoconf...
Done. You may now run:
    ./configure
./configure --prefix=`pwd`
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking whether sed understands -r -i -e... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for ranlib... ranlib
checking for gobjcopy... no
checking for objcopy... objcopy
checking for absolute path to objcopy... /usr/bin/objcopy
checking for gobjdump... no
checking for objdump... objdump
checking for absolute path to objdump... /usr/bin/objdump
checking for greadelf... no
checking for readelf... readelf
checking for absolute path to readelf... /usr/bin/readelf
checking for gperf... gperf
checking for absolute path to gperf... /usr/bin/gperf
checking for bison... bison
checking for flex... flex
checking for makeinfo... makeinfo
checking for cut... cut
checking for stat... stat
checking for readlink... readlink
checking for wget... wget
checking for tar... tar
checking for gzip... gzip
checking for bzip2... bzip2
checking for patch... /usr/bin/patch
checking for bash >= 3.1... /usr/bin/bash
checking for GNU awk... /usr/bin/gawk
checking for GNU make >= 3.80... /usr/bin/make
checking whether /usr/bin/make sets $(MAKE)... yes
checking for make 3.81... no
checking for GNU libtool >= 1.5.26... /usr/bin/libtool
checking for GNU libtoolize >= 1.5.26... /usr/bin/libtoolize
checking for GNU automake >= 1.10... /usr/bin/automake
checking for xz... xz
checking for cvs... no
checking for svn... svn
checking for inline... inline
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking whether gettext is declared... yes
checking ncurses/ncurses.h usability... no
checking ncurses/ncurses.h presence... no
checking for ncurses/ncurses.h... no
checking ncurses/curses.h usability... no
checking ncurses/curses.h presence... no
checking for ncurses/curses.h... no
checking ncursesw/curses.h usability... no
checking ncursesw/curses.h presence... no
checking for ncursesw/curses.h... no
checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
checking for library containing initscr... -lncursesw
configure: creating ./config.status
config.status: creating Makefile
make MAKELEVEL=0
make: Entering directory '/home/user1/esp-open-sdk/crosstool-NG'
  SED    'ct-ng'
  SED    'scripts/crosstool-NG.sh'
  SED    'scripts/saveSample.sh'
  SED    'scripts/showTuple.sh'
  GEN    'config/configure.in'
  GEN    'paths.mk'
  GEN    'paths.sh'
  DEP    'nconf.gui.dep'
  DEP    'nconf.dep'
  DEP    'lxdialog/yesno.dep'
  DEP    'lxdialog/util.dep'
  DEP    'lxdialog/textbox.dep'
  DEP    'lxdialog/menubox.dep'
  DEP    'lxdialog/inputbox.dep'
  DEP    'lxdialog/checklist.dep'
  DEP    'mconf.dep'
  DEP    'conf.dep'
  BISON  'zconf.tab.c'
  GPERF  'zconf.hash.c'
  LEX    'lex.zconf.c'
  DEP    'zconf.tab.dep'
  CC     'zconf.tab.o'
  CC     'conf.o'
  LD     'conf'
  CC     'lxdialog/checklist.o'
  CC     'lxdialog/inputbox.o'
  CC     'lxdialog/menubox.o'
  CC     'lxdialog/textbox.o'
  CC     'lxdialog/util.o'
  CC     'lxdialog/yesno.o'
  CC     'mconf.o'
  LD     'mconf'
  CC     'nconf.o'
  CC     'nconf.gui.o'
  LD     'nconf'
  SED    'docs/ct-ng.1'
  GZIP   'docs/ct-ng.1.gz'
make: Leaving directory '/home/user1/esp-open-sdk/crosstool-NG'
make install MAKELEVEL=0
make: Entering directory '/home/user1/esp-open-sdk/crosstool-NG'
  GEN    'config/configure.in'
  GEN    'paths.mk'
  GEN    'paths.sh'
  INST    'ct-ng'
  INSTDIR 'config/'
  INSTDIR 'contrib/'
  INSTDIR 'patches/'
  INSTDIR 'scripts/'
  INST    'steps.mk'
  INST    'paths'
  INSTDIR 'samples/'
  INST    'kconfig/'
  INST    'docs/*.txt'
  INST    'ct-ng.1.gz'

For auto-completion, do not forget to install 'ct-ng.comp' into
your bash completion directory (usually /etc/bash_completion.d)
make: Leaving directory '/home/user1/esp-open-sdk/crosstool-NG'
make[1]: Leaving directory '/home/user1/esp-open-sdk/crosstool-NG'
make -C crosstool-NG -f ../Makefile _toolchain
make[1]: Entering directory '/home/user1/esp-open-sdk/crosstool-NG'
./ct-ng xtensa-lx106-elf
make[2]: Entering directory '/home/user1/esp-open-sdk/crosstool-NG'
  CONF  config/config.in
#
# configuration saved
#

***********************************************************

Initially reported by: Max Filippov <[email protected]>
URL: http://www.esp8266.com/viewtopic.php?f=9&t=224

***********************************************************

WARNING! This sample may enable experimental features.
         Please be sure to review the configuration prior
         to building and using your toolchain!
Now, you have been warned!

***********************************************************

Now configured for "xtensa-lx106-elf"
make[2]: Leaving directory '/home/user1/esp-open-sdk/crosstool-NG'
sed -r -i.org s%CT_PREFIX_DIR=.*%CT_PREFIX_DIR="/home/user1/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
make[2]: Entering directory '/home/user1/esp-open-sdk/crosstool-NG'
[INFO ]  Performing some trivial sanity checks
[INFO ]  Build started 20150712.161426
[INFO ]  Building environment variables
[INFO ]  =================================================================
[INFO ]  Retrieving needed toolchain components' tarballs
[02:43] / ^C <--pressing CTRL+C here

ct-ng:148: recipe for target 'build' failed
make[2]: *** [build] Interrupt
../Makefile:252: recipe for target '_toolchain' failed
make[1]: *** [_toolchain] Interrupt
Makefile:249: recipe for target '/home/user1/esp-open-sdk/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc' failed
make: *** [/home/user1/esp-open-sdk/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc] Interrupt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.