[Answered] How to build a subset of the possible components in ESP-IDF?

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: [Answered] How to build a subset of the possible components in ESP-IDF?

Postby ESP_Angus » Mon Feb 18, 2019 3:37 am

locustcox wrote:
Sat Feb 16, 2019 3:46 pm
Any chance -flto will ever be implemented?
Yes, there's a strong chance (but no ETA that I know of).
It's not like you all don't have enough on your place, but in our internal projects, we've found up to a 40% reduction in binary size when link-time optimizations are added.
Impressive. Is that in ESP-IDF projects, or on another platform?

locustcox
Posts: 20
Joined: Tue Sep 04, 2018 9:36 pm

Re: [Answered] How to build a subset of the possible components in ESP-IDF?

Postby locustcox » Tue Feb 19, 2019 10:19 pm

ESP_Angus wrote:
locustcox wrote:
Sat Feb 16, 2019 3:46 pm
Any chance -flto will ever be implemented?
Yes, there's a strong chance (but no ETA that I know of).
It's not like you all don't have enough on your place, but in our internal projects, we've found up to a 40% reduction in binary size when link-time optimizations are added.
Impressive. Is that in ESP-IDF projects, or on another platform?
It wasn't esp-idf projects, but our own internal projects. The biggest reduction was typically in 3rd party libraries. The linker was able to eliminate a lot of do-nothing code that was being compiled in without flto.

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: [Answered] How to build a subset of the possible components in ESP-IDF?

Postby snahmad75 » Wed Mar 13, 2019 3:34 pm

ESP_Angus wrote:
Tue May 08, 2018 3:18 am
No support for LTO yet, unfortunately.

Regarding the original post's question of building with a subset of components, doing this is a lot smoother in the new CMake preview branch. You can supply a minimal list of components you need in your build (as little as one or two) in the COMPONENTS, and the build system will automatically expend prerequisites to produce a working binary.
Are we going to support for LTO in few months time. GCC compiler supports it on other platforms.

I am hoping it will reduce bin size by at least half.

matejm
Posts: 1
Joined: Mon May 06, 2019 12:07 pm

Re: [Answered] How to build a subset of the possible components in ESP-IDF?

Postby matejm » Mon Jun 03, 2019 11:58 am

snahmad75 wrote:
Wed Mar 13, 2019 3:34 pm
ESP_Angus wrote:
Tue May 08, 2018 3:18 am
No support for LTO yet, unfortunately.

Regarding the original post's question of building with a subset of components, doing this is a lot smoother in the new CMake preview branch. You can supply a minimal list of components you need in your build (as little as one or two) in the COMPONENTS, and the build system will automatically expend prerequisites to produce a working binary.

Are we going to support for LTO in few months time. GCC compiler supports it on other platforms.

I am hoping it will reduce bin size by at least half.
Are there any news about supporting LTO?

Thanks for info!

Best regards,
Matej

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: [Answered] How to build a subset of the possible components in ESP-IDF?

Postby ESP_Angus » Wed Jun 05, 2019 2:49 am

matejm wrote:
Mon Jun 03, 2019 11:58 am
Are we going to support for LTO in few months time. GCC compiler supports it on other platforms.

I am hoping it will reduce bin size by at least half.
Hi Matej,

We don't have any update about LTO, but it will not be supported in the near future. We've done some experiments, but ESP-IDF relies heavily on particular linker behaviours so this is complex to implement without breaking existing functionality in some cases.

In the experiments that we have done we didn't see anything close to 50% binary size reductions, unfortunately.

Angus

Who is online

Users browsing this forum: No registered users and 386 guests