yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] t4n017:
Is this Linaro fault?

shell@janice:/ $ free
CANNOT LINK EXECUTABLE: cannot locate symbol "__tls_get_addr" referenced by "free"...
[Android Software/Hacking General [Developers Only]] bigsupersquid:
I had issues with busybox not linking exactly the same way.

can't remember if it was reverting to -O2 or the full gamut of make clobber then rm -rf ~/.ccache and rebuild that fixed it. I definitely didn't mess with the toolchain to fix it, was using justarchi's linaro 4.8 repo the whole time.

I'm leaning towards the -O2, I keep thinking I have fully functional -O3 builds but something or another won't link correctly.
[Android Software/Hacking General [Developers Only]] JustArchi:
Depends. I have some LDFLAGS which are removing unused sections, mostly -Wl,--gc-sections, -Wl,--relax. You may try to remove it (if you decide to remove gc-sections, remove also -fdata-sections and -ffunction-sections from the rest).
[Android Software/Hacking General [Developers Only]] t4n017:
Yes, busybox isn't working either.

It was a clean build, and I don't use ccache. It can't be that.

I'll try with -O2, maybe is a -O3 problem on Linaro.

Sorry, maybe I shouldn't ask here because it isn't your commit fault, I didn't applied it this time. I only upgraded from -O2 to -O3 and use Linaro 4.8.
[Android Software/Hacking General [Developers Only]] :
Yes there is clearly a difference with your optimizations.

Good work.
[Android Software/Hacking General [Developers Only]] LuK1337:
Any way to fix ART bootloop on GCC 4.8 (Yes, I've used patch from OP)?

Logcat: http://pastebin.com/Yr4BRzsX
[Android Software/Hacking General [Developers Only]] smeejaytee:
Hi I have used a rom with your modifications implemented and I found it amazing but it's not been updated yet and it was only a test build the only trouble is not all devs are wanting to use them what I was wondering is would it not be possible to make a flashable zip to concert a rom that would be really great for people that can't get access to a ROM with the amazing archdroid mods if this is possible please consider it thanks in advance
[Android Software/Hacking General [Developers Only]] JustArchi:
No. It's IMPOSSIBLE to make a flashable zip with my optimizations. If some developer doesn't want to apply this, it's his/her choice, you either search for someone who does or you accept this fact.
[Android Software/Hacking General [Developers Only]] smeejaytee:
no I understand that's fine I just wondered whether it was possible thanks four the reply
[Android Software/Hacking General [Developers Only]] JustArchi:
I stated clearly in the OP that it's not possible to apply this on already compiled ROM.
[Android Software/Hacking General [Developers Only]] David_cole:
Id like to know where you got "increase speed by upto 6x" from? I've used roms that come both with and without your optimisations and the difference is very small. This is a genuine question and in no way am I insulting your work... But I just can't see this massive boost.... Maybe the roms weren't compiled correctly or something?
[Android Software/Hacking General [Developers Only]] JustArchi:
After applying my optimizations in correct way and measuring some compiled components UNIX time showed that they're performing 6x faster than previously. I've even attached in the OP just one simple change with Os -> O3, which is already 3x boosted. I don't care if other developers apply my optimizations in proper way or not. I've done a masterpiece and I feel the difference, all of my users as well. If you don't feel a difference then either you applied my optimizations wrongly or your device is already a high-end (at least newer than i9300) and there's little to none to show.
[Android Software/Hacking General [Developers Only]] smeejaytee:
I think there brilliant for HTC one x boosted my device massively
[Android Software/Hacking General [Developers Only]] David_cole:
I'm no dev mate I'd have no clue how to do all this magic lol... I simply used roms that devs claimed where compiled with your optimisations. And I'm using a samsung s4 if that makes the difference... Either way thanks for doing new stuff that nobody else had achieved.
[Android Software/Hacking General [Developers Only]] cimdrap:
can you tell me which ROMS use this optimizations?
[Android Software/Hacking General [Developers Only]] sparksco:
A lot of Roms already use strict-aliasing and -O3. That's probably why you won't see a huge difference (if any at all). I was testing strict-aliasing and -O3 way before this commit ever came along. What I've found is that krait devices don't like -O3 much and usually causes weird bugs like aosp browser will close randomly, and probably other bugs that are not as not noticeable or as major. Graphite optimizations seem to work well across all devices.
[Android Software/Hacking General [Developers Only]] Blue59:
really great work thanks :) i want build my own rom and i create roomservice.xml then add linaro 4.8 repo sync now ok only build rom now ? or any other settings for your optimizations?
[Android Software/Hacking General [Developers Only]] RMarkwald:
Has anyone successfully built using these optimizations for the Moto X, out of curiosity? I went back a dozen pages, and didn't see anything specific to the Moto X, did see the Moto G...

This is the guide I have been looking for, excellent guide JustArchi!

I did try the ArchiDroid Hybrid toolchain, but got some errors. I downloaded the necessary items for the Linaro Toolchain in roomservice.xml, and cleared ccache/make clean && make clobber, and kicked off another build, so we'll see. If that fails, I'll try Google's 4.8.

I know that my builds do work (CM 11 for moto_msm8960dt) without these customizations, so I know it is something not working or that I have/haven't done. I also cherry-picked the ART commit too. If anyone is building successfully using these optimizations and can lend some pointers, I am all ears.

Thanks again for this guide!
[Android Software/Hacking General [Developers Only]] David_cole:
Yes I have noticed the browser randomly FC .. Doesn't happen if I don't use these optimisations... Do you plan on releasing your way of doing things? I thought graphite was mainly for kernels or am I talking sh1t? Thanks for any reply.
[Android Software/Hacking General [Developers Only]] RMarkwald:
Since switching to the Linaro 4.8, it hasn't errored out for the Moto X and is still building...in watching the build (akin to watching paint dry...), I haven't seen it stop in the 3 spots it would before, so progress...

---------- Post added at 07:15 PM ---------- Previous post was at 07:09 PM ----------

So if this builds and flashes successfully, how will I know that these optimizations have applied? Is there a command to run (on phone when booted) or another way to tell? (CM 11 for the moto_msm8960dt)
[Android Software/Hacking General [Developers Only]] bigsupersquid:
I got higher linpack scores (more MFlops) when optimized/newer toolchain.
[Android Software/Hacking General [Developers Only]] JustArchi:
Actually if you kept all optimizations (mostly important: O2/O3 for TARGET_THUMB instead of Os), you should immediately notice performance boost. You can also compare sizes of your zips, as optimized build should be larger by few megabytes. Apart from that you can go to your "build" folder in your AOSP tree, execute "git log" and check if my optimizations are on the top.

In general I'm getting best results with Linaro but recently I moved to SaberMod due to funky play store icons. Other than that Linaro is great and I'm still using it to compile my kernel (4.9-eabi branch).
[Android Software/Hacking General [Developers Only]] jamus28:
So I've been having the exfat mounting issue, which I see the -Os fuse fix for earlier in the thread.

Also, on my S4 mini, my webview browser (naked browser) is crashing occasionally, but more than on standard cm10.2. Any ideas or commits on a solution?

Thanks
[Android Software/Hacking General [Developers Only]] Vynikal:
[MENTION=5161352]JustArchi[/MENTION]

Could you please refresh links to bug-solving commits (ART, unknown CPU architecture)?

Thanks
[Android Software/Hacking General [Developers Only]] JustArchi:
Yup, in a moment.
[Android Software/Hacking General [Developers Only]] marcomarinho:
Hi,

I need some kind of help, I had that 'unknown CPU architecture' error. I used your repo, but in my device the thing are little different:

HTC MSM7X30

As you can see my kernel configuration start on:

HEAD	= head.o
OBJS	= misc.o decompress.o
FONTC	= $(srctree)/drivers/video/console/font_acorn_8x8.c

#

So the part above I can't commit it. Do you know how to solve this. Help me please :)

This were my tries:

https://github.com/PureKat/htc7x30-3.0/commit/d654a7944c118050e41830c520ff0981a7e6e3f3

https://github.com/PureKat/htc7x30-3.0/commit/f51b5ad6f5d6dfe4b7f916d166f011f2b2f9d967
[Android Software/Hacking General [Developers Only]] broodplank1337:
Thats sounds a bit overkill to me unless you have some uber server you are using

afaik ccache automatically detects when other flags are used and will recache the file compiled with new flags when needed.

I believe for slow pc's "rm -Rf ccache and clobber" is really a place you rather not go unless really needed. as It could easily occupy your PC for another 5-6 hours on full compiling power

I know cleanest result it being created by the way you tell it, but i'm not sure whether it's a good idea to always do that after every change. it kinda ruins the advantage of ccache and costs tons of time

Other then that good work :P, there aren't many tutorials like this around :good:
[Android Software/Hacking General [Developers Only]] JustArchi:
Refreshed.

As my commit for fixing smdk4x12 kernel is now refreshed, I suggest to take a look. Basically it's just an idea how to properly do it but it also depends WHERE your kernel stops compiling, i.e. mine stopped right at compressing final Image, so I needed to adjust this part. If you have a kernel developer for your device who compiles his kernels with Linaro, your best shot would be to ask him.

Actually, you can't prove that keeping ccache will properly detect flags and not use already precompiled shared parts from previous build. Don't worry, I can't prove that it doesn't properly detect flags either. Make clean is mandatory, because objects are definitely not refreshed and you can test that by simply changing flags and doing a build, ROM will be barely rebuilt and mostly on java parts, which are being rebuilt anyway.

I know that it's pretty much an overkill for people without powerful PCs or servers, but we can't do much about that. For fixing various issues usually it's fine to dirty build and see if issue still persists, but if we finally get rid of it, it's strongly advised to make clean and start from scratch with this component fixed. This is because changing flags is not "safe", it has it's consequences and can fix one package while breaking 3 other ones.

Also, it doesn't compile that long :p. Omni for i9300, with enabled (but empty) ccache and clean build compiles exactly 1,30 hour for me. I'm building in VirtualBox VM, it has 4 i7 2600k threads (out of 8, but HT doesn't work well), 4 GB Ram, 10 GB swap and is located on classic 7200 rpm hard drive. I don't consider this build as ultra powerful, especially because of hard drive and not SSD. It's 3-year-old PC.
[Android Software/Hacking General [Developers Only]] marcomarinho:
I used your new commity as base. The problem isn't where the kernel ends, but where the kernel begins. I will try to talk with a kernel developer and see if works :fingers-crossed: Thanks :good:

EDIT: I think I had fixed it :good:
[Android Software/Hacking General [Developers Only]] RMarkwald:
Moto X using Linaro 4.7 GCC error

http://pastebin.com/CAWskPQz - Error

Building CM 11 for the Moto X (moto_msm8960dt), builds great WITHOUT any tweaks applied.

I tried your tweaks, JustArchi, using your example roomservice.xml (and the tweaks added to the other files as needed), and each toolchain there. I even tried the Linaro 4.7 GCC you have, and get varying errors. But with the SaberMod, 4.8 Linaro, and 4.7 Linaro I get to the same point, then the build errors out as shown in the above link.

Proving to be tough, any thoughts anyone?

EDIT: Trying this from Page 13 of this thread:

I changed a line in the

/hardware/qcom/display-caf/libhwcomposer/Android.mk file from:

LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"qdhwcomposer\"

to:

LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"qdhwcomposer\" -Os
[Android Software/Hacking General [Developers Only]] jamus28:
Yes that's the undefined reference error msm8960 is getting. That's one solution, but a few posts after mine someone mentioned a better solution.

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

[MENTION=5161352]JustArchi[/MENTION] you may want to add these fixes to the frontpage for msm8960 users
[Android Software/Hacking General [Developers Only]] RMarkwald:
Thanks for the quick reply. I'm out now while build is going so we'll see what happens when I get home. I'll check out the other fix as well.
[Android Software/Hacking General [Developers Only]] JustArchi:
I've just successfully compiled CM11 with all of my optimizations and Linaro 4.9.1 :). Everything works, including proper google play icons. Loving the performance.

If you want to try your luck:

https://github.com/JustArchi/ArchiDroid/blob/2.X-EXPERIMENTAL/__dont_include/roomservice.xml#L16

https://github.com/JustArchi/ArchiDroid/blob/2.X-EXPERIMENTAL/__dont_include/roomservice.xml#L17

https://github.com/JustArchi/android_build/commit/afd0536448a53e17fbfbc594f657fa20b63d1e78

But beware, I got libstlport segfault bootloop with Omni, so don't try this at home :D.
[Android Software/Hacking General [Developers Only]] micr0g:
Hello.

Is it possible to add every commit in a script like neo's;

So we can build CM for Nexus 5

I tried in past to build slimkat with your commits and every time failed. (My skills are not so good to fix every error)

Dunno if it is possible but It'll be awesome something like this.
[Android Software/Hacking General [Developers Only]] JustArchi:
No because the amount of commits required to make this work depends on every device, and you don't need to apply all of them.

Personally apart from the base commit I only applied a fix for ART, Linaro and exfat.
[Android Software/Hacking General [Developers Only]] F4k:
So using your Linaro 4.9.1 toolchain and pointing as 4.9 will do the trick? No other additional changes are needed?

Keep your good work!
[Android Software/Hacking General [Developers Only]] McDope:
What's the best / correct way to disable the optimized flags in kernel sub-makefiles? Just adding "-Os" in LOCAL_CFLAGS?

I'm trying to solve some kernel issues (no accel/gyro sensors - which also results in non-working cam) on yuga which i guess are caused by the flags. As soon as I flash another kernel on same (optimized) ROM the sensors and cam work again.

Btw: With these flags and some kernel patches my yuga is now getting speeding tickets - best antutu scores (~20700) i've ever seen on this device ;D Thanks Archi! :)
[Android Software/Hacking General [Developers Only]] spanish33:
Yesterday I built paranoid android on s4mini which uses cm11 as base, with justarchi's optimization and 4.9 toolchain changes and the rom compiled successfully but won't boot. Stuck at graphical glitches on samsung boot logo.

Used 4.9 for rom and 4.7 for kernel, I even tried installing your F4k 1.5 kernel but same problem no boot. I think some additional changes are needed for s4mini.

I can upload the build if you want.

Edit :make clean and cleaned ccache directory.
[Android Software/Hacking General [Developers Only]] JustArchi:
Indeed, I pointed 2 local manifest entries required + bumping GCC version, it's all. Make clean, empty ccache, and hope for the best.

You can experiment with TARGET_ARM_CFLAGS, but it's O2 in default configuration, in mine it's O3. You may want to turn it back to O2 for tests.

Also, kernel has it's own set of flags, while indeed it shares some of them, I think that it's compiled with O2 regardless. You need to experiment.
[Android Software/Hacking General [Developers Only]] F4k:
I also tried with CarbonROM and I had no luck, it stuck on Samsung's boot logo.
[Android Software/Hacking General [Developers Only]] JustArchi:
As I told you, I had similar experience. You're not lucky I guess :p.
[Android Software/Hacking General [Developers Only]] spanish33:
Guess not [emoji14]
[Android Software/Hacking General [Developers Only]] judas1977:
Strange thing (but i didn't have time to investigate it deeper, because of my wife:)).

I use JA optimizations v3 commit, compile omni... Everything went good (except of my stupid mistakes made by cleaning device sources a bit), but in the near end something breaks compilation process. And the odd thing is that i saw no error but... I think it was when kernel starts to compile... It says there is no directory of... 4.9 gcc. WTF? I checked and your commit was applied properly, toolchain was set on 4.8...

And kernel sources didn't changed for couple of weeks... Previously it compiled without errors (week, two ago), so where could this be set to 4.9??
[Android Software/Hacking General [Developers Only]] bigsupersquid:
try this, in device/BoardConfig.mk

TARGET_KERNEL_CUSTOM_TOOLCHAIN := ../../../prebuilts/gcc/linux-x86/arm/arm-eabi-4.8

or point it to the proper directory for your repo.

Also, putting arm-eabi toolchain paths (in roomservice.xml) as path="prebuilt/linux-x86/toolchain/..." instead of path="prebuilts/gcc/linux-x86/arm/..." you can shorten that TARGET_KERNEL_CUSTOM_TOOLCHAIN := arm-eabi-4.8 if your build system is set up like mine. This paragraph may not apply to you, but it also might, and I found that relocating those toolchains made my building simpler.
[Android Software/Hacking General [Developers Only]] JustArchi:
You should start from the fact that every AOSP (CM/Omni) kernel should use CROSS_COMPILE variable and NOT static path.

I have a feeling that you cherry-picked some bad commit, check your android_build git log.

Also, it's nice to note that if you're not lucky regarding 4.9 GCC, if your kernel can handle 4.8, then it can also handle 4.9. So you can use a hybrid mode:

This way you'll place 4.9-eabi in place of 4.8-eabi, and 4.8-androideabi in place of 4.8-androideabi :). Some misc non-kernel related parts are also compiled with arm-eabi, so this hybrid mode can actually increase ROM performance by a little, even if your tree is not fully compatible with GCC 4.9 (target thumb).
[Android Software/Hacking General [Developers Only]] bigsupersquid:
took the variable from another device, in the device tree rather than android_build.

The static path is because the android_build from androidarmv6 is looking in prebuilt/linux-x86/toolchain for arm-eabi-?.? for the kernel toolchain, and before I set the roomservice to put those toolchains in that directory, I had to redirect it with the static path.

Once I figured out where to sync the toolchains, I didn't need that (../../ and so on) path. Now I just set TARGET_KERNEL_CUSTOM_TOOLCHAIN := arm-eabi-4.7 (since I just cannot figure out what stops my armv6 from booting with 4.8, even with the memset fixes.)
[Android Software/Hacking General [Developers Only]] RMarkwald:
I'll have to give this a try tonight. I did get SaberMod 4.8 to compile successfully for my moto_msm8960dt. Required a few fixes to source as pointed out in this thread, but it builds (and runs pretty great I must add!).

I did try the 4.9 toolchain, and it error'd out but wasn't very descriptive, seemed like it was somewhere in the kernel. I haven't tried the hybrid, so I am curious to see if that will work. I guess I'll find out, and post back.
[Android Software/Hacking General [Developers Only]] kantjer:
Well I tried it at home, build SlimKat with SaberMod 4.9.1.

The build went without errors but like your Omni rom mine also boot looped :eek:
[Android Software/Hacking General [Developers Only]] t4n017:
As you, I'm using SaberMod 4.8 for Android. With Linaro I was having the known graphical glitch on Google Play and also some "Can't

link executable X" (this last error was happening no matter if I apply this commit or not) on binaries like 'free' or 'busybox'.

SaberMod 4.8 on Android and Linaro 4.9 on Kernel (hybrid) is working really smooth. Give it a try.

I couldn't build AOSPA with GCC 4.9, it always breaks at some point. As you can see, it's not a problem on EABI, is a problem on ANDROIDEABI.
[Android Software/Hacking General [Developers Only]] JustArchi:
Like I said, if somebody's kernel compiles and works fine with 4.8, it will most likely also work with 4.9, even if ROM can't handle 4.9, you can use hybrid solution :). It may give additional boost.

Also, I reported graphical glitch bug to Linaro.

https://bugs.launchpad.net/linaro/+bug/1332989

We'll see how it goes. This is the only "bug" I have with Linaro.
[Android Software/Hacking General [Developers Only]] :
The only thing i do to replace toolchains is to rename them, i place arm-eabi 4.10 and rename to 4.8 ,building kernel with 4.10. Sabermod or linaro, doesn't matter
[Android Software/Hacking General [Developers Only]] JustArchi:
Just keep in mind that 4.10 in my repo wasn't updated till some time already. I'm up-to-date with all Linaro releases, they didn't move to 4.10 yet (only outdated trunk from April), so I suggest to use 4.9.1, which is dated June.
[Android Software/Hacking General [Developers Only]] :
I used my own prebuild sabermod toolchain
[Android Software/Hacking General [Developers Only]] RMarkwald:
Any thoughts on this error? Using your hybrid 4.9/4.8 JustArchi.

moto_msm8960dt

http://pastebin.com/SbRF6Anw
[Android Software/Hacking General [Developers Only]] JustArchi:
No clue, you have a problem with motorola kernel so you can search in this thread or on your device's board. Definitely don't ask me because it's nothing I could've faced ;).

Good luck.
[Android Software/Hacking General [Developers Only]] RMarkwald:
Thanks for looking at it. I'll stick with what's working, 4.8. [emoji2]
[Android Software/Hacking General [Developers Only]] Vynikal:
Simply, you're f----d, absolutely no clue given by terminal...

Noob question, do I have to do something (example "make clean"/delete .ccache) when changing toolchain to Linaro? Or when editing TARGET_linux-arm.mk to gcc version 4.9?
[Android Software/Hacking General [Developers Only]] RMarkwald:
I kinda figured Terminal wasn't very forthcoming as to an answer, so I'll just stick with 4.8.

If I change toolchains, I run: rm -rf /home/youruser/.ccache or rm -rf /root/.ccache && make clean
[Android Software/Hacking General [Developers Only]] judas1977:
Thanks... i have no idea where it came from, it's not in any known device source of my phone;)

In boardconfig was that line (but how!!!):

ARM_EABI_TOOLCHAIN := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/arm/arm-eabi-4.9/bin

So it's the answer why it wanted 4.9 to ;).

EDIT: I know where that line is from already, stupid me;))
[Android Software/Hacking General [Developers Only]] smeejaytee:
Hi I just wondered if any of you awesome guts that can build ROMs with this mod are building anything on the HTC one x I was using a rom that was using out but since 444 it hasn't Bern updated and I really miss it but I know nothing of building atom although I wish I did of anyone can help it would be very much appreciated thanks in advance
[Android Software/Hacking General [Developers Only]] Slomies:
I'm having an issue compiling a ROM for jflte and getting the same error using Sabermod 4.9 and Linaro 4.8 and was hoping I could get some direction on what to do to possibly fix the error and get a working build. I have posted my terminal window with the error below. Also, is the ART fix still needed if compiling for 4.4.4? I did include it when I tried to compile...

http://pastebin.com/QuPtDHpL
[Android Software/Hacking General [Developers Only]] teemo:
There is a test build. Not official though ;)
[Android Software/Hacking General [Developers Only]] smeejaytee:
Thanks I've never tried your ROM as I didn't know what features it has I will take a look thanks