Disable LTO when building lib/libblink_web.so for ARM with gcc

199 views
Skip to first unread message

Prathamesh Kulkarni

unread,
Apr 15, 2015, 6:06:27 PM4/15/15
to chromi...@chromium.org
Hi,
I apologize if this is not the right list for this thread. I am trying to build chromium on ARM with LTO enabled with gcc.
It appears linking lib/libblink_web.so results in internal compiler error (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65776).
I would be grateful if someone could point me to disable LTO for building lib/libblink_web.so when target is ARM.
I tried setting cflags and ldflags to -fno-lto in blink.gyp but that didn't appear to work.

Thank you,
Prathamesh

Fabrice de Gans-Riberi

unread,
Apr 16, 2015, 7:32:53 AM4/16/15
to chromi...@chromium.org
Hi!

Looking at the GCC bug report, it appears you are using an unreleased version of GCC so we won't commit the change to trunk but feel free to have a local patch for yourself!
I am not sure how you are setting LTO. The "proper" way to do this is to add "use_lto=1" to your GYP_DEFINES. There are known issues with using LTO with GCC 4.9 and it is very experimental right now. If you need to disable LTO for one specific target,here's an example of how it's done: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/openmax_dl/dl/dl.gyp&q=use_lto==1&sq=package:chromium&type=cs&l=286

If you want some more details and/or comment, this is the tracking bug for enabling LTO on Android ARM: http://crbug.com/407544

Cheers!
Fabrice

Prathamesh Kulkarni

unread,
Apr 18, 2015, 5:34:53 PM4/18/15
to fde...@chromium.org, chromi...@chromium.org
On 16 April 2015 at 17:02, Fabrice de Gans-Riberi <fde...@chromium.org> wrote:
> Hi!
>
> Looking at the GCC bug report, it appears you are using an unreleased
> version of GCC so we won't commit the change to trunk but feel free to have
> a local patch for yourself!
> I am not sure how you are setting LTO. The "proper" way to do this is to add
> "use_lto=1" to your GYP_DEFINES. There are known issues with using LTO with
> GCC 4.9 and it is very experimental right now. If you need to disable LTO
> for one specific target,here's an example of how it's done:
> https://code.google.com/p/chromium/codesearch#chromium/src/third_party/openmax_dl/dl/dl.gyp&q=use_lto==1&sq=package:chromium&type=cs&l=286
Hi Fabrice,
Thanks for your reply. I tried the above solution in blink.gyp but
that didn't work.
I ended up by manually removing -flto from blink_web.ninja and *.ninja
files in Webkit/Source/core/, which worked for me
(blink_web.ninja shows dependencies on object files in Webkit/Source/core).
I will try to disable lto (as in the above link) in blink.gyp,
Webkit/Source/core/core.gyp and Webkit/Source/core/core_generated.gyp
and check if that works. Please let me know if you find
a better solution -;)

Thank you,
Prathamesh
>
> If you want some more details and/or comment, this is the tracking bug for
> enabling LTO on Android ARM: http://crbug.com/407544
>
> Cheers!
> Fabrice
>
> On Thursday, April 16, 2015 at 12:06:27 AM UTC+2, Prathamesh Kulkarni wrote:
>>
>> Hi,
>> I apologize if this is not the right list for this thread. I am trying to
>> build chromium on ARM with LTO enabled with gcc.
>> It appears linking lib/libblink_web.so results in internal compiler error
>> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65776).
>> I would be grateful if someone could point me to disable LTO for building
>> lib/libblink_web.so when target is ARM.
>> I tried setting cflags and ldflags to -fno-lto in blink.gyp but that
>> didn't appear to work.
>>
>> Thank you,
>> Prathamesh
>
> --
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
Reply all
Reply to author
Forward
0 new messages