yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] Hashbang173:
Do you plan to add support for arm64? (TARGET_linux-arm64.mk)
[Android Software/Hacking General [Developers Only]] JustArchi:
Adding support is easy, but I have no device to test.

You can check what I done in ARM target, and do the same in arm64, test, report back.
[Android Software/Hacking General [Developers Only]] WhiteNeo:
[MENTION=5161352]JustArchi[/MENTION]

Building CM12 with V4 commit and the sabermod GCC 4.8 you linked in commit header fails with the following error:

/home/whiteneo/cm12/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../libexec/gcc/arm-linux-androideabi/4.8.x-sabermod/cc1: error while loading shared libraries: libcloog-isl.so.4: cannot open shared object file: No such file or directory

I've reverted to the SaberMod version I was using before (an old 4.8 one that I've been using for weeks now) and it seems to build just fine.

Well, at least it's not complaining about missing libs anymore. :D We'll see..

Anyway, thanks for your great work! :)

Really been looking forward to this! :D
[Android Software/Hacking General [Developers Only]] sparksco:
The patch I linked in a previous post solves the libs errors. Which toolchain version works without ROM patching?
[Android Software/Hacking General [Developers Only]] WhiteNeo:
Thanks. Talking about this one, right?

https://bitbucket.org/Nico60/sm_arm-linux-androideabi-4.8

I used the lollipop branch by a git user called "ClK3iner" or something, however, when I checked last time the repos were deleted. And so was my browser history. So all that's left is some magically working 4.8 toolchains :D
[Android Software/Hacking General [Developers Only]] JustArchi:
Use sabermod toolchain suggested in my commit, and not third-party unknown ones.

Either official from gitlab, or official from my github mirror.

1. SaberMod 4.8 arm-linux-androideabi -> https://github.com/ArchiDroid/Toolchain/tree/sabermod-4.8-arm-linux-androideabi (original source: https://gitlab.com/SaberMod/arm-linux-androideabi-4.8/tree/master)
[Android Software/Hacking General [Developers Only]] WhiteNeo:
I got those library issues with your mirrored one, as well as this one.. Quite strange.
[Android Software/Hacking General [Developers Only]] sparksco:
I made a thread here for SaberMod discussions (developers only)

http://xdaforums.com/android/software-hacking/toolchains-sabermod-arm-arm64-t3064459#post59685223
[Android Software/Hacking General [Developers Only]] judas1977:
I've got that issue too. using justarchi's mirror.
[Android Software/Hacking General [Developers Only]] JustArchi:
Alright guys, the time has come. V4 is live, OP is updated, the fun begun.

I also included fix for your library problem, go ahead and grab it :).

Have fun, if you encounter any issues, please let us know, so we (community) can help you, and I can add the solution to the OP later.

My development work on XDA will be always free, but my i7-2600k doesn't want to stop consume my power. If you appreciate my CPU testing over a dozen of builds with dozen of flag combinations for you, feel free buy me a coke. I'd deeply appreciate that, as electricity is not free, at least yet.

Happy O3'ing!
[Android Software/Hacking General [Developers Only]] jukiewalsh:
Thanks!! 92Y98751G7439042L have a few cokes on me.

Any plans on extending this to omni like with v3? I know lollipop is still a wip for them and everything I'm just asking if you have any plan at all.
[Android Software/Hacking General [Developers Only]] JustArchi:
Commit should work, you may only need to resolve some conflicts. Try to apply it first, perhaps you won't find any.

Personally I can't test every ROM-version variation, so I prefer to test the commit only on a few devices and my own ROMs that are based on CM. This way I can cover "most" of the scenarios. However, all AOSPs work similar, it's most likely that this should also work on Omni and other ROMs built from source, as long as they're LP. Give it a try, and let me know in case of issues.

And thank you for your generous donation :).
[Android Software/Hacking General [Developers Only]] jgcaap:
Trying out.
[Android Software/Hacking General [Developers Only]] sgspluss:
[MENTION=5161352]JustArchi[/MENTION], is it possible to use v3 OmniRom also for AOSP Roms?

As far as i know Omni is very close to AOSP even closer then CM, so would be interessting if its possible.
[Android Software/Hacking General [Developers Only]] judas1977:
Hello.

I tried to use V4 and i have strange "compiler error". Don't know if it's connected to v4 though...

Here is error (log):

http://hastebin.com/nusopovexo.hs

i use your eabi gcc made for maxprzemo,

but for androideabi - i use standard (default) gcc from Resurrection Remix [because of sabermod issues, it was before you gave the patches;))]

Is this related to V4 or not?

TIA

EDIT:

i have that error:

/home/judas77/android/rr/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../libexec/gcc/arm-linux-androideabi/4.8.x-sabermod/cc1: error while loading shared libraries: libisl.so.13: cannot open shared object file: No such file or directory

And your solution didn't help (actually linux said that i have installed that library you pointed in OP).
[Android Software/Hacking General [Developers Only]] jgcaap:
Archi everything is Working good :)

---------- Post added at 05:58 PM ---------- Previous post was at 05:50 PM ----------

Just something I noticed. There are some graphics which with linaro, create some glitches.

Anyone have something like this? Thanks

---------- Post added at 06:00 PM ---------- Previous post was at 05:58 PM ----------

https://github.com/JustArchi/android_external_webp/commit/36c6201fbb108d6b757f860e2cd57f3982191662

This commit should still help out with glitches right?
[Android Software/Hacking General [Developers Only]] JustArchi:
Added fix to the OP.
[Android Software/Hacking General [Developers Only]] judas1977:
Sorry for my ignorance, but how to fetch that library using ubuntu^^. (That 'other one')
[Android Software/Hacking General [Developers Only]] JustArchi:
Depends which version you use.

http://packages.ubuntu.com/search?keywords=libisl13

It's available in vivid, so update.
[Android Software/Hacking General [Developers Only]] WhiteNeo:
And how to get libcloog-isl4 in ArchLinux? :)

Pacman seems to be unable to find this package.
[Android Software/Hacking General [Developers Only]] JustArchi:
Sorry, I really don't know as I'm not using Arch.
[Android Software/Hacking General [Developers Only]] jgcaap:
This fix works perfectly. Archi great work you have here!
[Android Software/Hacking General [Developers Only]] sgspluss:
Ignore this posting, my mistake.

Gesendet von meinem Galaxy Nexus
[Android Software/Hacking General [Developers Only]] eoghan2t7:
Hi justarchi is there any way to disable optimization on certain libs and hwcomposer.msm8960.so is giving compiler errors and I would like to disable optimization for it?
[Android Software/Hacking General [Developers Only]] JustArchi:
If something gives you internal compiler error then it means that code is fuc*ed up. Change the compiler, as suggested in the OP. If that doesn't help, send log to the developer of SM [MENTION=2394329]sparksco[/MENTION], so he can take a look what is wrong.

But yeah, you can always force some flags in local makefile, for example by adding -Os to enforce Os for that specific project.

Example: https://github.com/ArchiDroid/android_external_fuse/commit/819c9b526826883549e90b15aa7d3ee4549f7783
[Android Software/Hacking General [Developers Only]] sparksco:
I compiled all the required libs here if you don't use the ROM patches that export LD_LIBRARY_PATH and LIBRARY_PATH to the ones in the toolchains.

https://gitlab.com/SaberMod/sabermod-prebuilts/tree/master/cloog/lib

Copy the files in lib folder with root to /usr/lib/x86_64-linux-gnu or I think on arch it might be /usr/lib/x86_64-linux

You can copy with root file explorer

sudo nautilus
[Android Software/Hacking General [Developers Only]] Ross Korolov:
Yeah, good way to fix that problem, bro))!
[Android Software/Hacking General [Developers Only]] sgspluss:
[MENTION=5161352]JustArchi[/MENTION] tried to complie kitkat again with you linaro 4.8 (rom and kernel) all feels more the smooth BUT...

Sadly cant fix the graphical glitches in playstore, i've tried https://github.com/JustArchi/android_external_webp/commit/36c6201fbb108d6b757f860e2cd57f3982191662 but glitches are not fixed.

Maybe you have an idea what i can do to fix them?
[Android Software/Hacking General [Developers Only]] mistercheese:
my compile errors are identical to the errors posted in the link and im pretty sure libisl.so.13 is installed here.. so did u already got it fixed?
[Android Software/Hacking General [Developers Only]] MCP1:
Same here with linaro 4.8 (JustArchi repo). This commit used to work in the past but now it makes no difference. The cm11 webp repo didn't change as well the compiler, so probably there was a change in google play...
[Android Software/Hacking General [Developers Only]] JustArchi:
Sorry but I don't know. It worked for me back when I was compiling KK. You're on your own.

Sorry guys, it works for me. I can only suggest using latest Debian Testing, same as I do.
[Android Software/Hacking General [Developers Only]] mistercheese:
Compiling with this branch fixed it for me

https://github.com/SaberMod/arm-androideabi-4.8
[Android Software/Hacking General [Developers Only]] sparksco:
That one is pretty old ... I only keep it there for GPL.

https://gitlab.com/SaberMod/arm-linux-androideabi-4.8
[Android Software/Hacking General [Developers Only]] mistercheese:
I know but all the newer ones gives me problems and a headache
[Android Software/Hacking General [Developers Only]] sparksco:
Such as ??? I can't really see what problems would arise from the newer ones compared to the old ones ...
[Android Software/Hacking General [Developers Only]] abrakadabra_srb:
CM12

Hey Archi (and everyone else)

I'm trying to build CM12 with these optimizations for my HTC One and I'm getting this error:

/tmp/ccoL8Hra.s: Assembler messages:

/tmp/ccoL8Hra.s:7379: Error: no such instruction: `vfmadd312sd .LC64@GOTOFF(%ebx),%xmm1,%xmm0'

/tmp/ccoL8Hra.s:7436: Error: no such instruction: `vfmadd312sd .LC64@GOTOFF(%ebx),%xmm1,%xmm0'

/tmp/ccoL8Hra.s:7846: Error: no such instruction: `vfmadd312sd .LC64@GOTOFF(%ebx),%xmm1,%xmm0'

make: *** [/opt/cm-12/out/host/linux-x86/obj32/STATIC_LIBRARIES/libpng_intermediates/png.o] Error 1

No matter which toolchain I use, I keep getting this, is it something regarding to toolchain at all? Thnx in advance!
[Android Software/Hacking General [Developers Only]] mistercheese:
[MENTION=2394329]sparksco[/MENTION]

Read this post

http://xdaforums.com/showthread.php?p=59855475

I installed libisl13 mentioned in OP but still got problems with Every toolchain that needs libisl13
[Android Software/Hacking General [Developers Only]] sparksco:
I posted instructions some posts back. It's not difficult to do.

Read this post

http://xdaforums.com/showthread.php?p=59804807
[Android Software/Hacking General [Developers Only]] mistercheese:
I know.. I have read the whole thread multiple times and i already tried that.. Thanks
[Android Software/Hacking General [Developers Only]] sparksco:
Odd.. Well you can see for yourself that .13 is there.

https://gitlab.com/SaberMod/sabermod-prebuilts/tree/master/cloog/lib

Must be something else wrong with your setup.
[Android Software/Hacking General [Developers Only]] abrakadabra_srb:
I noticed something about this: if I remove -march=native from HOST_linux-x86.mk then I dont get the error and I'm able to build the ROM. Can someone please tell me what this flag actually does?

---------- Post added at 09:59 PM ---------- Previous post was at 09:54 PM ----------

Well, my bad, I expected the ROM to be built as it passed the error, but 5 mins after the post I got this:

make[1]: Leaving directory `/opt/cm-12/kernel/htc/msm8960'

make: *** [TARGET_KERNEL_BINARIES] Error 2

make: *** Waiting for unfinished jobs....

In file included from external/stlport/stlport/stl/_algo.h:737:0,

from external/stlport/stlport/algorithm:41,

from external/chromium_org/v8/src/vector.h:9,

from external/chromium_org/v8/src/utils.h:18,

from external/chromium_org/v8/src/assert-scope.h:10,

from external/chromium_org/v8/src/v8.h:33,

from external/chromium_org/v8/src/hydrogen.h:8,

from external/chromium_org/v8/src/hydrogen.cc:5:

external/stlport/stlport/stl/_algo.c: In member function 'void v8::internal::HOptimizedGraphBuilder::HandlePolymorphicCallNamed(v8::internal::Call*, v8::internal::HValue*, v8::internal::SmallMapList*, v8::internal::Handle<v8::internal::String>)':

external/stlport/stlport/stl/_algo.c:962:5: warning: array subscript is above array bounds [-Warray-bounds]

__insertion_sort(__first, __first + __stl_threshold, _STLP_VALUE_TYPE(__first,_RandomAccessIter), __comp);

Help please :)
[Android Software/Hacking General [Developers Only]] JustArchi:
You may need to declare -Os for libpng.

Fun fact, I didn't get this error, and libpng is shared library I also use.
[Android Software/Hacking General [Developers Only]] sparksco:
Isn't /tmp related to ccache most of the time? I know ccache can really mess with gcc flags which is why I don't use it.
[Android Software/Hacking General [Developers Only]] JustArchi:
Not always, GCC also uses /tmp for temporary assembled code parts, unless you use -pipe.

And about ccache: I don't use it either. I made some tests and came to the conclusion that it doesn't help at all. It's slowing down compilation.
[Android Software/Hacking General [Developers Only]] Cem0:
This seems relevant. http://cpiekarski.com/2013/01/02/speeding-up-aosp-builds/
[Android Software/Hacking General [Developers Only]] sparksco:
OK so I'm not the only one that thought it was slowing things down. I thought I was the only one to find that myth buster. I heard it only helps with dirty builds but what's the point since I do clean builds a lot anyways.
[Android Software/Hacking General [Developers Only]] JustArchi:
It helps only when you compile something second time and you didn't clean ccache.

If you dirty build, you recompile like one up to two projects (unless some code changed, e.g. busybox) so you see no real difference using ccache or not in dirty builds.

The only situation when ccache MAY be useful is when you build for the first time, make clean, and then build for the second time. But in this scenario, it already takes too long, and I wouldn't be surprised if both ccache builds would take longer than two independent ones.

I don't like ccache, I can't see any real improvement, and I did see many quirks and little bugs that happened with it. I don't recommend it.
[Android Software/Hacking General [Developers Only]] MCP1:
[MENTION=4920940]sgspluss[/MENTION], if you replace the library /system/lib/libskia.so with a version built with gcc 4.7 (or an old version of gcc/linaro 4.8) everything works. You can even add it to your vendor prebuilt files set, so it would be included in your new builds automatically.

Not the prettiest solution but at least an easy one...
[Android Software/Hacking General [Developers Only]] scanno:
I am trying to build Omni 5.1 using v4 and the stock 4.8 toolchain. I am running into an intenal compiler error:

frameworks/av/services/audioflinger/AudioMixer.cpp: In static member function 'static void android::AudioMixer::track__NoResample(android::AudioMixer::track_t*, TO*, size_t, TO*, TA*) [with int MIXTYPE = 0; TO = int; TI = short int; TA = int; size_t = unsigned int]':

frameworks/av/services/audioflinger/AudioMixer.cpp:2060:6: internal compiler error: in vect_get_vec_def_for_operand, at tree-vect-stmts.c:1423 void AudioMixer::track__NoResample(track_t* t, TO* out, size_t frameCount,

Any suggestions?
[Android Software/Hacking General [Developers Only]] mistercheese:
Try sabermod 4.8
[Android Software/Hacking General [Developers Only]] Khaon:
Compile this module with Os
[Android Software/Hacking General [Developers Only]] ivankolev:
Sorry in advance if this is inappropriate question!

But what about cm 12.1? Is v4 somehow suitable or have to wait your development?

If have to wait, take your time and thank you for your great work!

Greetings
[Android Software/Hacking General [Developers Only]] scanno:
The changes in 5.1 are not major. So i wouldn't be suprised that you can use v4 without problems
[Android Software/Hacking General [Developers Only]] JustArchi:
I just built first CM12.1 for i9300, so I should tell you about my findings regarding my optimizations in a few days.

But as [MENTION=905572]scanno[/MENTION] said above, they should work fine.
[Android Software/Hacking General [Developers Only]] Khaon:
Why aren't you using some kind of modular approach? Let's say to exclude relevant modules ? Wouldn't need the user to edit module definition
[Android Software/Hacking General [Developers Only]] jgcaap:
I am having problem compiling external pdfium part. We're you able to do it with which toolchains? I wanted to test with Google to check diferences.
[Android Software/Hacking General [Developers Only]] abrakadabra_srb:
Htc ONE

I managed to compile CM12 for my Htc ONE with these optimizations and SaberMod toolchains but had to change two things:

In HOST_linux-x86.mk I had to change -march=native to -march=prescott and also remove -march=native in line HOST_linux-x86_64.mk

I had to build libhwcomposer with -Os flag

Now, I did antutu benchmark before flashing this build and after. It was a clean install (manually wiped system, data, cache etc) and I had all the same apps. Antutu showed lower score with these optimizations then the result with build without optimizations. I'm not crazy about benchmarking, actually, before this I dont remember when was the last time I did it, but since i'm playing around with this I thought I give it a shot. In the end, I have two questions:

Do these changes I had to made in order to build the ROM affect the optimizations in any way?

How relevant are benchmark results when it comes to these optimizations?
[Android Software/Hacking General [Developers Only]] MikeyNick:
I`m trying to build ResurrectionRemix ROM for Moto X 2013 with these optimizations using SaberMod toolchain, but can`t seem to get past an issue...

Assembler messages:
Fatal error: invalid -march= option: `armv7-a'
make[3]: *** [applets/applets.o] Error 1
make[2]: *** [applets_dir] Error 2
make[1]: *** [prepare] Error 2
make[1]: Leaving directory `/home/michael/RR/external/busybox'
make: *** [/home/michael/RR/out/target/product/ghost/obj/busybox/minimal/.config] Error 2
make: *** Deleting file `/home/michael/RR/out/target/product/ghost/obj/busybox/minimal/.config'

I`ve tried going into the HOST_linux-x86.mk and changing back to -march=prescott , and removing the arg from HOST_linux-x86_64.mk , did a make clobber and cleaned ccache, but it always seems to give that error anyway.

The only place i deviated from the commit was uncommenting:

ARCHIDROID_GCC_CFLAGS += -fgraphite

and adding in some of the flags mention by frap in comment https://github.com/ArchiDroid/andro...c39a038c5bfaef5a8b268c#commitcomment-10479264 (except for -floop-flatten and -ftree-loop-linear because clang complained they were unknown arguments.

I`m using SaberMod androideabi 4.8 (https://gitlab.com/SaberMod/arm-linux-androideabi-4.8) and arm-eabi 4.9 (https://gitlab.com/SaberMod/arm-eabi-4.9)

any clear mistakes you guys can see?

EDIT: Where are my manners? Thanks for the great guide! I just got into ROM building a couple months ago and now trying to learn more and step it up, and guides like this are a huge help and I appreciate people like you taking the time to write them!
[Android Software/Hacking General [Developers Only]] sparksco:
The error is from the default LTS branch of the toolchain arm-linux-androideabi-4.8

For now use the master branch. So if you used git clone you'll need to add "-b master" to the end to clone master branch instead of LTS branch. I'll be working on fixing LTS branch soon.
[Android Software/Hacking General [Developers Only]] tortellini:
Hello [MENTION=5161352]JustArchi[/MENTION]

I try to build a rom with your optimization. I use the source code of " resurrection remix cm12.1 ."

The ROM is for a HTC One X Endeavoru .

I use linaro 4.9 toolchain for kernel and 4.8 for the ROM.

I have this issue :

target thumb C: libext4_utils <= system/extras/ext4_utils/make_ext4fs.c

target thumb C: libext4_utils <= system/extras/ext4_utils/ext4fixup.c

target thumb C: libext4_utils <= system/extras/ext4_utils/ext4_utils.c

target thumb C: libext4_utils <= system/extras/ext4_utils/allocate.c

target thumb C: libext4_utils <= system/extras/ext4_utils/contents.c

target thumb C: libext4_utils <= system/extras/ext4_utils/extent.c

target thumb C: libext4_utils <= system/extras/ext4_utils/indirect.c

target thumb C: libext4_utils <= system/extras/ext4_utils/uuid.c

target thumb C: libext4_utils <= system/extras/ext4_utils/sha1.c

target thumb C: libext4_utils <= system/extras/ext4_utils/wipe.c

target thumb C: libext4_utils <= system/extras/ext4_utils/crc16.c

target thumb C: libext4_utils <= system/extras/ext4_utils/ext4_sb.c

target thumb C: libext4_utils <= system/extras/ext4_utils/canned_fs_config.c

target thumb C++: mediaserver <= frameworks/av/media/mediaserver/main_mediaserver.cpp

target arm C++: libaudioflinger <= frameworks/av/services/audioflinger/AudioMixer.cpp

system/extras/ext4_utils/canned_fs_config.c: In function 'canned_fs_config':

system/extras/ext4_utils/canned_fs_config.c:83:45: warning: unused parameter 'dir' [-Wunused-parameter]

void canned_fs_config(const char* path, int dir,

^

arm-linux-androideabi-g++: error: -DSTATE_QUEUE_INSTANTIATIONS="StateQueueInstantiations.cpp": No such file or directory

make: *** [/home/tortellini/rr51/out/target/product/endeavoru/obj/SHARED_LIBRARIES/libaudioflinger_intermediates/AudioMixer.o] Error 1

make: *** Waiting for unfinished jobs....

target thumb C++: libaudioflinger <= frameworks/av/services/audioflinger/AudioFlinger.cpp

arm-linux-androideabi-g++: error: -DSTATE_QUEUE_INSTANTIATIONS="StateQueueInstantiations.cpp": No such file or directory

make: *** [/home/tortellini/rr51/out/target/product/endeavoru/obj/SHARED_LIBRARIES/libaudioflinger_intermediates/AudioFlinger.o] Error 1

tortellini@Tortellini49FR:~/rr51$

[/CODE]

I have the same error with CM12 and CM 12.1 code source.

Can you help me ?

Thanks for your hard works.

Tortellini
[Android Software/Hacking General [Developers Only]] JustArchi:
I compiled CM12.1 with my optimizations using same toolchains which are proposed in the commit, and all works fine.
[Android Software/Hacking General [Developers Only]] liv3dn8as:
bad object

Hi! Sorry for the n00b question but do i need to use your android_build git repo? the reason for asking is that i tried to fetch it first then apply the commit but i always get a "bad object" error. I build BeanStalk 5.0 for the VS980 so it is CM based but BS uses his own git repo. let me know if additional info is needed to help answer this!
[Android Software/Hacking General [Developers Only]] judas1977:
it's strange error with those "no such file or directory":

i have this error (RR 5.1 too):

target thumb C++: libFFmpegExtractor <= external/stagefright-plugins/libstagefright/FFmpegExtractor/FFmpegExtractor.cpp
external/libnfc-nci/halimpl/pn54x/tml/phTmlNfc_i2c.c:37:29: fatal error: linux/nfc/pn544.h: No such file or directory
#include <linux/nfc/pn544.h>
^

file reffered in above code IS available in my kernel source (include/linux/nfc/pn544.h).

Why is this error occur?
[Android Software/Hacking General [Developers Only]] JustArchi:
Stop asking me and ask your compiler. I don't have any similar issues.
[Android Software/Hacking General [Developers Only]] judas1977:
Yes, i understand that you may get angry, but... It's not the cause of issue i think, because... I use your toolchain (for kernel, that one made for a7 at maxprzemo request and recommended by you (sabermod) for android.

I have one suspicion though: maybe it's because of ccache (which afair you don't use). I try to remove ccache and try again. Last thing: maybe something differ between clean cm12.1 and RR