-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
ROM size increase due Zephyr compile options not stripping unused functions #5265
Comments
tl;dr; The longer story ... A patch was introduced that increased the use of COMPILE_LANGUAGE generator expressions. COMPILE_LANGUAGE generator expressions were not supported by the zephyr_get_* API until In hindsight I should have done both patches at the same time. |
If you have CONFIG_CPLUSPLUS enabled then this can be closed as a duplicate of #5152 grep CONFIG_CPLUSPLUS build_directory/zephyr/.config |
Oh, and it is necessary to port to a new interface: |
@SebastianBoe Yeah, I do indeed have CONFIG_CPLUSPLUS set, thanks. |
We have MicroPython build fail for arduino_101 https://ci.linaro.org/view/lite-iot-ci/job/lite-aeolus-micropython/189/PLATFORM=arduino_101,ZEPHYR_GCC_VARIANT=zephyr,label=docker-xenial-amd64-13/console due to:
This didn't happen before. Let me reopen this ticket for further investigation. |
CONFIG_CPLUSPLUS is not used. |
IMHO one shouldn't open issues in Zephyr when external projects have build failures. A build failure after an update could be due to many reasons ... Example: #5297 |
Really? Indeed, it could be due to many reasons, and 90% of those reasons are regressions in the Zephyr build system. |
So, Makefile.exports has:
I.e., both -ffunction-sections -fdata-sections are there, and actually used when compiling both app and Zephyr code. And link is:
I.e. -Wl,--gc-sections is there too. Weird. |
Prooflink that it worked just 2 days ago: https://ci.linaro.org/view/lite-iot-ci/job/lite-aeolus-micropython/186/PLATFORM=arduino_101,ZEPHYR_GCC_VARIANT=zephyr,label=docker-xenial-amd64-13/console |
I guess it doesn't link, and therefore you can't run rom_report to find out what is using so much space? Perhaps you could compare what <toolchain>-size says before and after the update. |
@SebastianBoe : I'm on it (and not asking you to look into it), just appreciate being able to investigate within the scope of the upstream project, and within existing ticket, to keep other parties in loop. (Of course, will appreciate your attention when I have come to some results where I can't easily proceed forward - like you always helped so far, thanks!) |
@SebastianBoe : It was smart to change this line: https://github.com/zephyrproject-rtos/zephyr/pull/5229/files#diff-c31c4dbe0e95f5d6cc91df73faf59217R20 , and I hope you'd agree it's easy to overlook ;-). Thanks for you patience! |
When building 3rd party libraries for A101, when CMake file uses zephyr_get_compile_options_as_string(options) to include compile options, it seemed the it has changed and no longer include some of the flags to strip out unused functions, and therefore, the final ROM image size is increased.
For example,
with latest master, the compile options returned is:
-Os -g -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -ffreestanding -include /home/jimmy/projects/zephyrjs/zephyr.js/outdir/arduino_101/zephyr/include/generated/autoconf.h -nostdinc
But with an ealier commit b678895 is:
-Os -g -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -ffreestanding -include /home/jimmy/projects/zephyrjs/zephyr.js/outdir/arduino_101/zephyr/include/generated/autoconf.h -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -Wno-pointer-sign -fno-stack-protector -Wno-unused-but-set-variable -fno-reorder-functions -fno-defer-pop -nostdinc -Werror=implicit-int -ffunction-sections -fdata-sections -mpreferred-stack-boundary=2 -mno-sse -march=lakemont -mtune=lakemont -msoft-float
The text was updated successfully, but these errors were encountered: