{"push_id":769294213,"size":1,"distinct_size":1,"ref":"refs/heads/cm-12.1","head":"a47fd6c6ed9615addd79992269b60ab1ff266e46","before":"cbe19a83cf6c144090b840075eabe16f116d45cf","commits":[{"sha":"a47fd6c6ed9615addd79992269b60ab1ff266e46","author":{"email":"8af56de68279cb6f5ed022f31af18b9fcdcc2e92@example.com","name":"Your Name"},"message":"Use Qualcomm Snapdragon LLVM Compiler 3.6\n(https://developer.qualcomm.com/mobile-development/increase-app-performance/snapdragon-llvm-compiler-android)\nfor Android Lollipop 5.x for devices with Qualcomm CPU\n\nAs far as I know nobody has done that yet. Except me :)\n\nThis changes the toolchain for CLANG from the default one which comes\nwith Android (aCLANG) to the Qualcomm Snapdragon LLVM Compiler 3.6\n(qCLANG) mentioned above. The toolchain will be used for almost all\nplaces where the default Android CLANG (aCLANG) is used for compiling\nTARGET MODULES. BUT ONLY if \"USE_CLANG_QCOM := true\" is set. Otherwise\nit is using aCLANG. So you can merge this commit and the build will be\nthe same as before except you specifically define \"USE_CLANG_QCOM :=\ntrue\"!\n\nWARNING: THIS IS NOT FULLY TESTED FOR STABILITY YET. READ CAREFULLY It\nis very likely that using this toolchain, especially with the\noptimizations flags, will introduce BUGS!\n\nI would suggest: IF YOU USE IT DONT MAKE BUG REPORTS FOR YOUR OFFICIAL\nROM OR KERNEL OR ANY APPS. Make reports in the development thread. The\nROM compiles, boots and starts. Also if Bionic and other modules are\ncompiled with Qualcomm Snapdragon LLVM Compiler 3.6 (qCLANG).\nAndrobench, Antutu, Basemark 2.0 , Geekbench 3, Vellamo are 'completing'\nthe benchmarks. This is a work in progress. There is confirmation that\nit works for Sony Z Ultra and Samsung Galaxy Note 4 and after some\nmonths of testing everything seems good.\n\nAt the moment this is only tested with Qualcomm Snapdragon but in theory\nthis should also work with any Krait and even Scorpion CPU. According to\nDocumentation there is also support for armv8/aarch64 (Snapdragon 810)\nand you should gain a real performance bump but support is not yet\nimplemented! If you have a Snapdragon 810 device and want to try this\nout contact me please.\n\nInstall instructions:\n\n1. You have to make an account in order to download the toolchain!\n2. You need to download the toolchain and extract it to {your android\ndir}/prebuilts/clang/linux-x86/host/*\n3. Add the repo (https://github.com/mustermaxmueller/clanglibs) to your\nmanifest. For example: <project path=\"vendor/clanglibs\"\nname=\"mustermaxmueller/clanglibs\" remote=\"github\"\nrevision=\"clang_qcom_3.6\"/>\n4. Replace the compiler-rt repo with this one\nhttps://github.com/mustermaxmueller/compiler-rt in your manifest For\nexample: <project path=\"external/compiler-rt\"\nname=\"mustermaxmueller/compiler-rt\" remote=\"github\"\nrevision=\"clang_qcom_3.6\"/>\n5. Add my build repo https://github.com/mustermaxmueller/android_build/\nor merge my changes. For example: <project path=\"build\"\nname=\"mustermaxmueller/android_build\" remote=\"github\"\nrevision=\"master\"/>\n6. Add my frameworks_rs repo\nhttps://github.com/mustermaxmueller/android_frameworks_rs or merge my\nchanges. For example: <project path=\"build\"\nname=\"mustermaxmueller/android_build\" remote=\"github\"\nrevision=\"master\"/>\n\n    You need the Qualcomm Snapdragon LLVM Compiler 3.5 for this to\nwork!!!\n    OR\n    Make changes to\nframeworks/rs/driver/runtime/build_bc_lib_internal.mk like stated here:\nhttp://forum.xda-developers.com/showpost.php?p=59626153&postcount=47\n\n7. Change following line in following files:\n\nprebuilts/ndk/current/platforms/android-14/arch-arm/usr/include/math.h\nprebuilts/ndk/current/platforms/android-8/arch-arm/usr/include/math.h\nfrom\n&& __clang_minor__ >= 6)\nto\n&& __clang_minor__ >= 7)\n\n8. Set \"USE_CLANG_QCOM := true\" e.g. in Boardconfig.mk\n\n    OPTIONAL (set these options in your Boardconfig.mk):\n    USE_CLANG_QCOM_VERBOSE := true (give extra output when compiling)\n    USE_CLANG_QCOM_LTO := true (use LTO; not working at the moment)\n    CLANG_QCOM_COMPILE_ART := true (compile art with qclang; not working\nat the moment!)\n    CLANG_QCOM_COMPILE_BIONIC := true (compile bionic with qclang)\n    CLANG_QCOM_COMPILE_MIXED := true (compile defined modules with\nqclang)\n    CLANG_QCOM_FORCE_COMPILE_MODULES += (Here you can overwrite which\nmodules should be compiled with qCLANG instead of GCC)\n    CLANG_QCOM_FORCE_COMPILE_ACLANG_MODULES += (Here you can overwrite\nwhich modules should be compiled with aCLANG instead of qCLANG)\n    CLANG_QCOM_DONT_REPLACE_WITH_Ofast_MODULES += (Here you can\noverwrite which modules shouldnt be compiled with -Ofast)\n\n9. Add \"USE_CLANG_QCOM := true\" to your\nBoardconfig.mk/BoardconfigCommon.mk of your device.\n   (If you want to be certain that qclang is used,also set\n\"USE_CLANG_QCOM_VERBOSE := true\" in your Boardconfig.mk and you will see\nthe verbose output while compiling.)\n\n10. Make a clean compile! Also delete ccache!\n\nAnnotation:\n1. You should only get measurable performance benefits if you compile\nBionic with CLANG!\n2. Documentation for the toolchain: {your android\ndir}/prebuilts/clang/linux-x86/host/llvm-Snapdragon_LLVM_for_Android_3.6/Snapdragon_LLVM_ARM_36_User_Guide.pdf\n3. The Flags \"-muse-optlibc\" and \"-ffuse-loops\" are not Documented.\n(http://pastebin.com/PZtk6WHB)\n4. The implementation is not beautiful but it works\n5. HOST is compiled with aCLANG because qCLANG does not understand x86\n6. You can make performance and size comparisons by removing/commenting\n\"USE_CLANG_QCOM := true\"\n7. I could have made the installation easier by uploading the toolchain\nto Github but I do not know if I am allowed to. And I am no lawyer so...\n\nTODO:\n-Make more performance comparisons to aCLANG and GCC. It seems good even\ncompared to GCC\n-Use ccache -Where does it make sense to use qCLANG instead of GCC?\n-Compile Android with qCLANG wherever possible.\nhttp://www.linuxplumbersconf.org/2013/ocw/system/presentations/1131/original/LP2013-Android-clang.pdf\nand\nhttps://events.linuxfoundation.org/sites/events/files/slides/2014-ABS-LLVMLinux.pdf\n\nDevelopment Thread:\nhttp://forum.xda-developers.com/android/software-hacking/wip-compile-android-5-0-2-qualcomm-llvm-t3035162\nConflicts:\n\tcore/binary.mk","distinct":true,"url":"https://api.github.com/repos/jgcaaprom/android_build/commits/a47fd6c6ed9615addd79992269b60ab1ff266e46"}]}