Forums - qcld: segmentation fault while building Chromium with LTO

7 posts / 0 new
Last post
qcld: segmentation fault while building Chromium with LTO
arter97
Join Date: 12 Sep 14
Posts: 3
Posted: Thu, 2016-10-13 06:50

Hi.

I'm trying to build CAF SWE Browser (Chromium) with Snapdragon LLVM compiler & LTO.

 

While I was able to compile Chromium with Snapdragon LLVM, using LTO has failed spectacularly.

Here's the log :

http://pastebin.com/mg1y7jX0

 

Is there anything I can do to fix it?

Or does qcld needs an update?

 

Thanks in advance :)

  • Up0
  • Down0
Raja Moderator
Join Date: 17 Apr 13
Posts: 42
Posted: Thu, 2016-10-13 14:48

Thanks for reporting the issue.

Can you share the build recipe for this chromium project (build steps) so that we can try to reproduce the crash.

Also, please send us the configuration of your build machine. How much RAM does it have?

 

  • Up0
  • Down0
arter97
Join Date: 12 Sep 14
Posts: 3
Posted: Fri, 2016-10-14 07:55

Sure.

 

SWE Browser build steps are available here :

https://wiki.codeaurora.org/xwiki/bin/Chromium+for+Snapdragon/m52_build_...

Just change m52 to m54.

 

I've patched the src/build directory to make it more optimized for Snapdragon LLVM.

Patch : http://pastebin.com/cvk7X3vc

 

1. Sync and apply the patch.

2. Run "build/download_gold_plugin.py" to download LLVMgold.so(used for host).

3. Move "third_party/llvm-build/Release+Asserts" to "third_party/llvm-build/host" since sdclang can't compile for x86.

4. Download sdclang 3.8.6 to "third_party/llvm-build/Release+Asserts".

5. Use the following command to build :

. ./build/android/envsetup.sh

gn gen out/Default --args='target_os="android" target_cpu="arm" is_debug=false is_component_build=false is_clang=true symbol_level=0 remove_webcore_debug_symbols=true optimize_for_size=false clang_use_chrome_plugins=false allow_posix_link_time_opt=true'

ninja -C out/Default swe_browser_apk
 
 
Thanks in advance :)
Feel free to ask me back if you encounter issues with Chromium sync/patch.

 

 

My system is i7-5820K with 32GB of RAM.

I tried changing the kernel (various 4.4, 4.7 and 4.8 kernels) but it didn't help.

And it's definitely not running out of RAM.

  • Up0
  • Down0
pstrong
Join Date: 12 May 16
Posts: 22
Posted: Fri, 2016-10-14 18:15

We have reproduced the crash on our end and are working on a fix.

  • Up0
  • Down0
pstrong
Join Date: 12 May 16
Posts: 22
Posted: Mon, 2016-10-31 14:35

The Segmentation fault in Snapdragon LLVM 3.8.6 has been fixed in 3.8.7.

With these patches in place, we are now experiencing very long compile times with the LTO option on this codebase.  We will post more information as we root cause the issue.

We have the 3.8.7 patch release ready.  Are you interested in trying it out?

  • Up0
  • Down0
arter97
Join Date: 12 Sep 14
Posts: 3
Posted: Mon, 2016-10-31 16:58
Sure, I'll try this out this week. Thanks :) Btw, is there a multi-threaded LTO option available on QCLD?
  • Up0
  • Down0
pstrong
Join Date: 12 May 16
Posts: 22
Posted: Mon, 2016-11-07 12:35

The Snapdragon LLVM ARM Toolchain Patch version 3.8.7 is now available for download.

This patch version fixes the initial segmentation fault reported on this thread.

In addition, we found out in the LLVM Dev meeting last week that it's not possible to build Chromium with LLVM LTO because of memory limitations.

Also, there is not a multi-threaded LTO option available on QCLD.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.