[Galaxy Ace II Android Development] ace2nutzer:
Yes i believe u .. this build: 20150714 is even more screwed up than the latest build here ^^

That old build is a mixed build of Rox's + Chrono's his latest CM11 at that time. but it's more a Rox build .. there from Chrono's CM11 i was only using a few Libs in order to fix Live Video Stream + Stagefright leaks ... and maybe Camera libs too.

Also it was compiled by Rox with JustArchis Optimizations, which is even more painfully ... so it's really no wonder that it doesn't work too.

And one more thing, even if build the ROM without Modifications at all .. so original form CM Team ... then it'll have buggy Code too..

The CM Team have a lot of "Devs" they really don't know what they do...

I don't know how u can contribute to CM Team at all .. but i think every of us can do it .. just making some changes and then having GitHub Account .. and then u can create pull requests to CM Repos .. and if they are ok with your pull request .. then it's merged to original CM Repo and everybody can use this, i mean, next time u're compiling the ROM and u want to update the sources .. then u'll receive that new commit too .. no matter if it makes things better or worse.

Just an example ...

i had to fork (clone) this Repo:

https://github.com/ace2nutzer/android_external_ffmpeg

As u can see i did just one commit with "Some optimizations"

if u click on it, then u'll see what i've changed compared to original.

So let us analyze a bit ...

first they add here:

https://github.com/ace2nutzer/andro...c9eb#diff-ec687e74855dc5b64a787b20c93dd5deL61

-O3 (which is not better than -O2 ;) )

and then on the same Repo .. but for an other lib .. they are just wondering that it doesn't work properly:

https://github.com/ace2nutzer/andro...c9eb#diff-9cc0bf9163dafea23b08c8ae2abf6831L21

So and then they just use for that lib that can't be compiled with -O3 simply -Os ! (see one line below)

btw: it even doesn't work with -O2 ... which is even lower optimizations level than -O3 ;)

Not enough ?

Okay i'll show u one more painfully Commit .. probably even from Google itself, unless CM Team did here some changes in order to make it even more worse :D

But first a small introduction ....

The whole ROM is splitted in 2 ways of different optimizations ...

So there is target_arm .. which is only approx 10 - 20% of the ROM

And target_thumb .. which is for the rest of the rom ... so much more.

As u already know, ARM is faster than THUMB ... around 10 - 15% ... (i can't say exactly right now ... but u can google this ;) )

Because THUMB is just an ARM instructions compressed set.

Well, take a look how they have applied the optimizations:

Here starts the fun .. check this... original CM Repo without any modifications from me:

https://github.com/CyanogenMod/android_build/blob/cm-11.0/core/combo/TARGET_linux-arm.mk#L71

I don't want to explain every Flag .. but in short ...

-marm (default on target_arm .. even if u don't see this .... this is the default) = faster than -mthumb

-O2 = breaks the Code. (usually faster than -Os)

-Os = so far the highest optimization for the ROM without to produce broken Code.

-fstrict-aliasing = use strict aliasing

-fno-strict-aliasing = don't use strict aliasing

INFO: Linux kernel source is cleaner than CM sources. (we learned this yesterday together with chrono ... ;) )

okay.. what about strict aliasing ?

strict aliasing is an optimization .. but it requires that the Code is extremely very well programmed .. otherwise it makes things even more worse.

Strict Aliasing is even on latest linux kernel by default DISABLED .... and this even with still contributions and development form linus torvalds itself. - if u google this .. u'll find an statement from linus torvalds personally that he simply can't suggest to use it.

Well, so now let us analyze those MAIN optimizations that are applied to the whole ROM .. and no only one lib or Repo lol ...

Almost 80% of ROM:

TARGET_thumb_CFLAGS := -mthumb \ ----> just a bit slower, not problematic.

-Os \ -----------------------------> so far the best choice.

-fomit-frame-pointer \ -----> Yeah that's great.

-fno-strict-aliasing -----------> Good choice.

Next part ... approx 20% of ROM:

TARGET_arm_CFLAGS := -O2 \ -----------> Breaks the Code

-fomit-frame-pointer \

-fstrict-aliasing \ ---------> Breaks the Code

-funswitch-loops

As u can see, for some reason .... they just decide to apply strict aliasing + -O2 on that small part of the ROM ...

but why ??? u really think all the Google + CM Devs did write a more cleaner Code for Target ARM but not for THUMB .. so that target_ARM can handle higher optimizations ??!! - I say NO. Target ARM and THUMB is same quality of Code.

Also not to mention about other Flags ..... i'm just too sleepy :)

But Well, here one more .. which is incredible bad too:

https://github.com/CyanogenMod/android_build/blob/cm-11.0/core/combo/TARGET_linux-arm.mk#L108

so -ffunction-sections and -fdata-sections ....

They do nothing good... here original form GCC Manual:

But looks like the ROM really need it... at least ffunction-sections .....

but at least so far removing flag fdata-sections cause no build errors :)

And and and ... i do just an cut here ... good night ;)