Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

jerry.cmake: Disable LTO for JerryScript build #1901

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pfalcon
Copy link
Contributor

@pfalcon pfalcon commented Apr 26, 2019

With LTO compiling enabled, and Zephyr SDk 0.10.0, during final Zephyr
link (which isn't done with LTO option), for armv7m targets, weird
errors are thrown:

zephyr-sdk-0.10.0/arm-zephyr-eabi/.../arm-zephyr-eabi/bin/ld: error:
zephyr_prebuilt.elf uses VFP register arguments, /tmp/ccTrD4ap.ltrans1.ltrans.o does not

Note that both JerryScript and Zephyr seem to be built with correct and
consistent target options, which enable VFP usage.

Disabling LTO option for JerryScript build fixes this issue.

Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org

With LTO compiling enabled, and Zephyr SDK 0.10.0, during final Zephyr
link (which isn't done with LTO option), for armv7m targets, weird
errors are thrown:

zephyr-sdk-0.10.0/arm-zephyr-eabi/.../arm-zephyr-eabi/bin/ld: error:
zephyr_prebuilt.elf uses VFP register arguments, /tmp/ccTrD4ap.ltrans1.ltrans.o does not

Note that both JerryScript and Zephyr seem to be built with correct and
consistent target options, which enable VFP usage.

Disabling LTO option for JerryScript build fixes this issue.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
@pfalcon pfalcon force-pushed the jerryscript-no-lto branch from 7b75a4f to 53892f8 Compare April 26, 2019 11:16
@pfalcon
Copy link
Contributor Author

pfalcon commented Apr 26, 2019

This is follow up to #1900 . I split this into separate PR because I only can explain the need for this patch with LTO bugs as presented in Zephyr SDK 0.10.0 toolchain. (I'd say, there's industrial folklore that LTO can break with non-trivial projects in rather unobvious, hard to debug ways. I personally avoid using, despite being an optimization geek.)

Again, split from the main patch to see if other folks may have better ideas.

@jimmy-huang
Copy link
Contributor

+1, I ran into the same problem, so yeah, thanks for fixing this.

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

Successfully merging this pull request may close these issues.

2 participants