Latest esp-idf -> as: unrecognised option '--64'

murray_lang
Posts: 24
Joined: Fri Oct 07, 2016 4:43 pm

Latest esp-idf -> as: unrecognised option '--64'

Postby murray_lang » Fri Feb 17, 2017 10:17 am

Hi,

I just pulled the latest version of esp-idf from github and I now get the following when I try to make my project:

Code: Select all

<my path> $make all
make[1]: Entering directory `/home/murray/ESP/esp-idf-v2.0/tools/kconfig'
cc  -I/usr/include/ncursesw   -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o mconf.o mconf.c
as: unrecognised option '--64'
make[1]: *** [mconf.o] Error 1
make[1]: Leaving directory `/home/murray/ESP/esp-idf-v2.0/tools/kconfig'
make: *** No rule to make target `/home/murray/Robotics/Weta/vm/weta-esp/weta-esp32/build/include/config/auto.conf', needed by `/home/murray/Robotics/Weta/vm/weta-esp/weta-esp32/build/bootloader/bootloader.bin'.  Stop.
I tried a fresh recursive clone, but with the same result. I downloaded the latest xtensa tools, but with the same result. My path environment variable has the correct tools listed first. I have been compiling problem free for months, and had no problems with the previous update, which would have been a few weeks ago.

Anybody else having the same problem?

Regards,
Murray

ESP_Sprite
Posts: 9014
Joined: Thu Nov 26, 2015 4:08 am

Re: Latest esp-idf -> as: unrecognised option '--64'

Postby ESP_Sprite » Tue Feb 21, 2017 3:07 am

It seems that your host (=not the Xtensa) compiler is unhappy. Throwing that error into Google gives me a lot of people who see this problem when as on their system accidentally points to an as from a cross compiler. Can you see if that's the case?

murray_lang
Posts: 24
Joined: Fri Oct 07, 2016 4:43 pm

Re: Latest esp-idf -> as: unrecognised option '--64'

Postby murray_lang » Tue Feb 21, 2017 3:41 pm

Hi ESP_Sprite,

Something is calling the xtensa as with the --64 option, which it does not support. The xtensa tools are first in the path (otherwise this error would not have occurred because the linux as does support --64). The following shows which gcc and as versions are found when invoked with no path:

Code: Select all

murray@dev ~ $ gcc --version
gcc (crosstool-NG crosstool-ng-1.22.0-55-gecfc19a) 4.8.5
Copyright (C) 2015 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.

murray@dev ~ $ as --version
GNU assembler (crosstool-NG crosstool-ng-1.22.0-61-gab8375a) 2.25.1
Copyright (C) 2014 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `xtensa-esp32-elf'.
murray@dev ~ $
I built my project successfully, ran git pull from within esp-idf to get the latest version, then got this error when I tried to build again. This was all within a few minutes with no restart and no change in my environment. I then tried a fresh clone of esp-idf, but with the same result. The only change is the SDK.

I will investigate further.

Murray

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Latest esp-idf -> as: unrecognised option '--64'

Postby ESP_igrr » Tue Feb 21, 2017 4:44 pm

'as' should be the host compiler (i.e. it should compile programs for Linux x64 on Linux).

What happens is that the build system tries to build 'mconf', which is a host application (part of kconfig). On your system 'as' points to Xtensa compiler, so it effectively tries to compile a Linux x64 application with an Xtensa compiler and obviously fails.

You need to make sure that when you add Xtensa toolchain path to your PATH, you add <toolchain_directory>/bin and not <toolchain_directory>/xtensa-esp32-elf/bin. Then you will get Xtensa toolchain executables named xtensa-esp32-elf-{gcc,as,cc,...}, which is what the ESP-IDF build system expects.

murray_lang
Posts: 24
Joined: Fri Oct 07, 2016 4:43 pm

Re: Latest esp-idf -> as: unrecognised option '--64'

Postby murray_lang » Wed Feb 22, 2017 2:26 pm

Thanks iggr,

That fixed it. I don't know why it wasn't a problem with previous sdk updates, but I don't care now. More interesting problems to solve.

Who is online

Users browsing this forum: yaghmr and 136 guests