Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build error missing time.o for 2.2 (no error 2.1) #2444

Closed
stevemac00 opened this issue Jul 31, 2018 · 8 comments
Closed

build error missing time.o for 2.2 (no error 2.1) #2444

stevemac00 opened this issue Jul 31, 2018 · 8 comments

Comments

@stevemac00
Copy link

stevemac00 commented Jul 31, 2018

Expected behavior

Build

Actual behavior

I have been making builds with 2.1 for the past year without any issues. I created a new disk for 2.2 but when I attempt to build from 2.2 I get this error:

ar d /Volumes/casesenshfs-220/nodemcu-firmware/sdk/esp_iot_sdk_v2.2.0-f8f27ce/lib/libmain.a time.o
ar: time.o: not found in archive

Here is what I use to build:
git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
cd esp-open-sdk
make STANDALONE=y
export PATH=...
cd ..
git clone https://github.com/nodemcu/nodemcu-firmware.git
cd nodemcu-firmware
make clean
make

Test code

NodeMCU version

2.2 esp_iot_sdk_v2.2.0

Hardware

N/A

@TerryE
Copy link
Collaborator

TerryE commented Jul 31, 2018

@stevemac00 I am doing these sdk_v2.2.0-f8f27ce builds regularly and my build doesn't attempt to access time.o

~~I can't find anything in the makefile to attempt to delete time.o from libmain.a. Can you post the make log as a gist and link it here. Thanks.~

Found it. It's generated in the root Makefile rule sdk_pruned. These sdk rules have side effects and so aren't intended to be interrupted. Did you abort a make just after starting? Just remove the sdk folder under your root (/Volumes/casesenshfs-220/nodemcu-firmware/sdk in your case) and the make will recreate it properly.

@stevemac00
Copy link
Author

I may have aborted at one time (I put this away for awhile and can't remember).
I did rm -rf /Volumes/casesenshfs-220/nodemcu-firmware/sdk/ but still got the same error.
The gist is https://gist.github.com/stevemac00/059ec9109f9865132ddcda70925bf8ee

Since it's complaining about time.o, my only clue is I'm defining SNTP but not RTCTIME although that was fine in 2.1.

@devsaurus
Copy link
Member

devsaurus commented Jul 31, 2018

@stevemac00 building from master also works for me.
What is the output when you list the archive manually once the build failed?
For me it's

$ ar t sdk/esp_iot_sdk_v2.2.0-f8f27ce/lib/libmain.a
app_main.o
eagle_lib.o
eagle_lwip_if.o
ets_timer.o
mem_manager.o
spi_overlap.o
time.o
user_interface.o
debug-vector.o
double-vector.o
kernel-vector.o
nmi-vector.o
user-vector.o
vector.o
spi_flash.o
$ ar --version
GNU ar (GNU Binutils; openSUSE Leap 42.3) 2.29.1

Deleting time.o is going to succeed of course.

@stevemac00
Copy link
Author

$ ar t sdk/esp_iot_sdk_v2.2.0-f8f27ce/lib/libmain.a

/
//
app_main.o/
eagle_lib.o/
eagle_lwip_if.o/
ets_timer.o/
mem_manager.o/
spi_overlap.o/
time.o/
/0
debug-vector.o/
double-vector.o/
kernel-vector.o/
nmi-vector.o/
user-vector.o/
vector.o/
spi_flash.o/

Now I'm even more confused. What is that /0 after time.o ?

@devsaurus
Copy link
Member

Now I'm even more confused. What is that /0 after time.o ?

Strange indeed. It's in the row where I have user_interface.o.
Is there anything else when you list verbosely with ar tv?
Which version of ar / binutils is this?

@stevemac00
Copy link
Author

Thanks for staying on this as I need the help. Something is wrong with what I've used on the 220 but I list the simple instructions I followed on my original post at the top.

I'm on MacOS 10.13.6 and using /usr/bin/ar included but it doesn't support the 'V' option for version.
I have my 2.1 and 2.2 builds on separate images so I went back to 2.1 and did a make clean then make which worked fine although it lists the same '/0'.

I'm wondering why the date is older on -220 than it is on -210?

nodemcu-firmware-210$ ar tv sdk/esp_iot_sdk_v2.1.0/lib/libmain.a
--------- 0/0 6728 May 5 03:09 2017 /
--------- 0/0 18 Dec 31 18:00 1969 //
rw-rw-r-- 502/502 34708 May 5 03:09 2017 app_main.o/
rw-rw-r-- 502/502 9820 May 5 03:09 2017 eagle_lib.o/
rw-rw-r-- 502/502 6936 May 5 03:09 2017 eagle_lwip_if.o/
rw-rw-r-- 502/502 10740 May 5 03:09 2017 ets_timer.o/
rw-rw-r-- 502/502 8024 May 5 03:09 2017 mem_manager.o/
rw-rw-r-- 502/502 3152 May 5 03:09 2017 spi_overlap.o/
rw-rw-r-- 502/502 7144 May 5 03:09 2017 time.o/
rw-rw-r-- 502/502 104516 May 5 03:09 2017 /0
rw-rw-r-- 502/502 1288 May 5 03:09 2017 debug-vector.o/
rw-rw-r-- 502/502 1288 May 5 03:09 2017 double-vector.o/
rw-rw-r-- 502/502 1288 May 5 03:09 2017 kernel-vector.o/
rw-rw-r-- 502/502 2140 May 5 03:09 2017 nmi-vector.o/
rw-rw-r-- 502/502 1816 May 5 03:09 2017 user-vector.o/
rw-rw-r-- 502/502 1564 May 5 03:09 2017 vector.o/
rw-rw-r-- 502/502 18388 May 5 03:09 2017 spi_flash.o/

nodemcu-firmware-220$ ar tv sdk/esp_iot_sdk_v2.2.0-f8f27ce/lib/libmain.a
--------- 0/0 6890 Feb 21 23:36 2018 /
--------- 0/0 18 Dec 31 18:00 1969 //
rw-rw-r-- 502/502 34076 Feb 21 23:36 2018 app_main.o/
rw-rw-r-- 502/502 9820 Feb 21 23:36 2018 eagle_lib.o/
rw-rw-r-- 502/502 7640 Feb 21 23:36 2018 eagle_lwip_if.o/
rw-rw-r-- 502/502 10740 Feb 21 23:36 2018 ets_timer.o/
rw-rw-r-- 502/502 8024 Feb 21 23:36 2018 mem_manager.o/
rw-rw-r-- 502/502 3152 Feb 21 23:36 2018 spi_overlap.o/
rw-rw-r-- 502/502 6932 Feb 21 23:36 2018 time.o/
rw-rw-r-- 502/502 109444 Feb 21 23:36 2018 /0
rw-rw-r-- 502/502 1288 Feb 21 23:36 2018 debug-vector.o/
rw-rw-r-- 502/502 1288 Feb 21 23:36 2018 double-vector.o/
rw-rw-r-- 502/502 1288 Feb 21 23:36 2018 kernel-vector.o/
rw-rw-r-- 502/502 2140 Feb 21 23:36 2018 nmi-vector.o/
rw-rw-r-- 502/502 1816 Feb 21 23:36 2018 user-vector.o/
rw-rw-r-- 502/502 1564 Feb 21 23:36 2018 vector.o/
rw-rw-r-- 502/502 18664 Feb 21 23:36 2018 spi_flash.o/

@stevemac00
Copy link
Author

stevemac00 commented Aug 1, 2018

Found a solution!
Turns out the 2.1 build has:
esp-open-sdk/xtensa-lx106-elf/bin/ar
where as the 2.2 build does not but has:
esp-open-sdk/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar

I simply cp xtensa-lx106-elf-ar to ar so it was used in my $PATH before /usr/bin/ar and it worked. Maybe the make file could be updated to explicitly use xtensa-lx106-elf-ar?

@devsaurus
Copy link
Member

Sure, that should do the trick 👍 Also removes dependencies to the host system installation.
Thanks a lot for digging this up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants