Epicday.... I've compiled xtensa-lx106-elf for FreeBSD

I’ve compiled the toolchain for FreeBSD… but placing them in packages folder under toolchain-xtensa does not work.

Installing tool-scons package:
Already installed
Installing toolchain-xtensa package:
Error: The package 'toolchain-xtensa' is not available for your system 'freebsd_amd64'

how can i force platformio to accept what is there and not try to install it. ?

Please edit ~/.platformio/appstate.json and add to installed_packages this

       "toolchain-xtensa": {
            "version": 9999, 
            "time": 1456513654
        } 

P.S: Could you share somewhere this toolchain? We will add it to our package repository. Thanks.

think i need to add more than that.

I get

The platform 'espressif' has not been installed yet. Would you like to install it now? [y/N]: 

even with that added

and it is then removed after i’ve done an update.

and of course i can share them (if they work)

here is the file

{"last_version": "2.9.1", "telemetry": {"backup": [{"qt": 1463602490.821116, "av": "2.9.1", "cd": "Run", "cd4": 1, "cd3": "run", "t": "screenview"}, {"el": "board=esp12e&framework=arduino&platform=espressif", "qt": 1463602492.068014, "av": "2.9.1", "ea": "Run", "ec": "Env", "cd": "Run", "cd4": 1, "cd3": "run", "t": "event"}, {"el": "tool-scons", "qt": 1463602564.013285, "ea": "Install", "ec": "PackageManager", "cd": "Run", "cd4": 1, "av": "2.9.1", "cd3": "run", "t": "event"}, {"exf": 0, "exd": "NonSystemPackage: The package 'toolchain-xtensa' is not available for your system 'freebsd_amd64'", "qt": 1463602564.014437, "cd": "Run", "cd4": 1, "av": "2.9.1", "cd3": "run", "t": "exception"}]}, "installed_packages": {"tool-scons": {"version": 1, "time": 1463602564}}, "cid": "b9f1ea95-d3bb-5d1a-8693-096c9dbe0553"}

Try this

{
	"last_version": "2.9.1",
	"installed_platforms": [
		"espressif"
	],
	"installed_packages": {
		"tool-scons": {
			"version": 1,
			"time": 1463602564
		},
		"toolchain-xtensa": {
			"version": 999,
			"time": 1463602564
		}
	},
	"cid": "b9f1ea95-d3bb-5d1a-8693-096c9dbe0553"
}

ok got it passed that… but it seems that all the requirements are not there

xtensa-lx106-elf-ar rcs .pioenvs/esp12e/libFrameworkArduinoVariant.a
xtensa-lx106-elf-g++: not found
xtensa-lx106-elf-ranlib .pioenvs/esp12e/libFrameworkArduinoVariant.a
xtensa-lx106-elf-g++ -o .pioenvs/esp12e/FrameworkArduino/Esp.o -c -fno-rtti -fno-exceptions -std=c++11 -Os -mlongcalls -mtext-section-literals -falign-functions=4 -ffunction-sections -fdata-sections -MMD -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12 -DARDUINO=20200 -U__STRICT_ANSI__ -I/root/.platformio/packages/framework-arduinoespressif/tools/sdk/include -I/root/.platformio/packages/framework-arduinoespressif/tools/sdk/lwip/include -I.pioenvs/esp12e/FrameworkArduino -I.pioenvs/esp12e/FrameworkArduinoVariant .pioenvs/esp12e/FrameworkArduino/Esp.cpp
xtensa-lx106-elf-g++: not found
scons: *** [.pioenvs/esp12e/src/tmp_ino_to.o] Error 127
xtensa-lx106-elf-g++ -o .pioenvs/esp12e/FrameworkArduino/FS.o -c -fno-rtti -fno-exceptions -std=c++11 -Os -mlongcalls -mtext-section-literals -falign-functions=4 -ffunction-sections -fdata-sections -MMD -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12 -DARDUINO=20200 -U__STRICT_ANSI__ -I/root/.platformio/packages/framework-arduinoespressif/tools/sdk/include -I/root/.platformio/packages/framework-arduinoespressif/tools/sdk/lwip/include -I.pioenvs/esp12e/FrameworkArduino -I.pioenvs/esp12e/FrameworkArduinoVariant .pioenvs/esp12e/FrameworkArduino/FS.cpp
scons: *** [.pioenvs/esp12e/FrameworkArduino/Esp.o] Error 127
xtensa-lx106-elf-g++: not found
scons: *** [.pioenvs/esp12e/FrameworkArduino/FS.o] Error 127

seems there are some files missing from

root@test:/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin # ls
xtensa-lx106-elf-addr2line	xtensa-lx106-elf-gcov
xtensa-lx106-elf-ar		xtensa-lx106-elf-gdb
xtensa-lx106-elf-as		xtensa-lx106-elf-gprof
xtensa-lx106-elf-c++filt	xtensa-lx106-elf-ld
xtensa-lx106-elf-cc		xtensa-lx106-elf-ld.bfd
xtensa-lx106-elf-cpp		xtensa-lx106-elf-nm
xtensa-lx106-elf-ct-ng.config	xtensa-lx106-elf-objcopy
xtensa-lx106-elf-elfedit	xtensa-lx106-elf-objdump
xtensa-lx106-elf-gcc		xtensa-lx106-elf-ranlib
xtensa-lx106-elf-gcc-4.8.2	xtensa-lx106-elf-readelf
xtensa-lx106-elf-gcc-ar		xtensa-lx106-elf-size
xtensa-lx106-elf-gcc-nm		xtensa-lx106-elf-strings
xtensa-lx106-elf-gcc-ranlib	xtensa-lx106-elf-strip

what i guess i should have

xtensa-lx106-elf-addr2line    xtensa-lx106-elf-gcc-ranlib
xtensa-lx106-elf-ar           xtensa-lx106-elf-gcov
xtensa-lx106-elf-as           xtensa-lx106-elf-gdb
xtensa-lx106-elf-c++          xtensa-lx106-elf-gprof
xtensa-lx106-elf-c++filt      xtensa-lx106-elf-ld
xtensa-lx106-elf-cc           xtensa-lx106-elf-ld.bfd
xtensa-lx106-elf-cpp          xtensa-lx106-elf-nm
xtensa-lx106-elf-ct-ng.config xtensa-lx106-elf-objcopy
xtensa-lx106-elf-elfedit      xtensa-lx106-elf-objdump
xtensa-lx106-elf-g++          xtensa-lx106-elf-ranlib
xtensa-lx106-elf-gcc          xtensa-lx106-elf-readelf
xtensa-lx106-elf-gcc-4.8.2    xtensa-lx106-elf-size
xtensa-lx106-elf-gcc-ar       xtensa-lx106-elf-strings
xtensa-lx106-elf-gcc-nm       xtensa-lx106-elf-strip

Seems to work. I found an alternative
http://www.esp8266.com/viewtopic.php?f=9&t=478

that says it builds g++

Could you share this toolchain somewhere?

I’m uploading it now, but its the one missing g++.

The other crosstool needs some other dependancies so it failed. No usable m4 in $PATH

here you go
https://www.dropbox.com/s/8e8131zpy6jovs8/xtensa-lx106-elf.zip?dl=0

so i can’t get the g++ version to compile.

[ERROR]    checking for suitable m4... configure: error: No usable m4 in $PATH or /usr/5bin (see config.log for reasons).

but i have m4 installed and in the right path, so stuck

got it working. g++ and all… compiled a test sketch

"/root/.platformio/packages/tool-esptool/esptool" -eo "/root/.platformio/packages/framework-arduinoespressif/bootloaders/eboot/eboot.elf" -bo .pioenvs/esp12e/firmware.bin -bm dio -bf 40 -bz 4M -bs .text -bp 4096 -ec -eo .pioenvs/esp12e/firmware.elf -bs .irom0.text -bs .text -bs .data -bs .rodata -bc -ec
"xtensa-lx106-elf-size" -B -d .pioenvs/esp12e/firmware.elf
/root/.platformio/packages/tool-esptool/esptool: not found
scons: *** [.pioenvs/esp12e/firmware.bin] Error 127
text	   data	    bss	    dec	    hex	filename
218494	    888	  29488	 248870	  3cc26	.pioenvs/esp12e/firmware.elf

The next major stumbling block is getting esptool compiled. This is going to be a problem… but at least if it is going to be a cloud compiler that should not be necessary

here is a link to the toolchain

https://www.dropbox.com/s/1fiwqztyxyw0tfd/xtensa-lx106-elf%2Bg%2B%2B.zip?dl=0

Looks like it is worth following up. compile time on my laptop 33 seconds, on freebsd 7.5 seconds. so i’d be keen to get this cloud compiling working:)

Which problems do you have?

So igrr has just fixed it :slight_smile: were good to go!
https://github.com/igrr/esptool-ck/commit/8a87f8a023005b951683405ad127d4be05c28504

esptool and toolchain working for freebsd. Need to actually test the binary though…

Great!!! Now, we are waiting for the binaries and would be glad to host them in PlatformIO Package Storage for other users.

i’ve posted the toolchain binaries
https://www.dropbox.com/s/1fiwqztyxyw0tfd/xtensa-lx106-elf%2Bg%2B%2B.zip?dl=0

and the esptool are here
https://www.dropbox.com/s/pybif16q9rajp22/esptool-0.4.8-4-g65479f3-freebsd.tar.gz?dl=0

feel free to make package… still need to test it though… just can’t right now… need a few hrs

ok, i confirm that the toolchain works, as does esptool.

I have built mkspiffs but it requires gcc 4.7 with some dependencies… i could only get the executable to work by symlinking in a

 ln -s /usr/local/lib/gcc48/libstdc++.so.6 /usr/lib/libstdc++.so.6

which is not so ideal i guess.

Just for link…