yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] amaces:
It's possible/likely, since the additional layer in HEAD~2 was mostly for my testing, although I tried to read the documentation, and only add what was not included in the respective -Ox base level. Anyway, HEAD~3 is pretty much yours with simple adaptations for Marshmallow's build changes (e.g., ARCHIDROID_IGNORE_RECOVERY_SIZE).

Ha-ha, I'm equally cynical, but yeah, a couple of changes in bionic and frameworks/base are still needed for Android EABI 5.x. Still, much easier than on Lollipop:
[Android Software/Hacking General [Developers Only]] JustArchi:
Only those two? Plain easy then, haha.

Thanks for fix for recovery size, I was wondering why my old ifneq resulted in syntax error.

I'm pretty much done with 4.9 tests, but if only those two commits are needed for GCC 5.3 support then I'll be happy to test it too before a release.

Some things have changed, as I said above - this commit is not only a simple copy pasta for next android, but also some serious development going on. For example, -Wl,--relax which worked in KK, was broken in LP, again works in M. I have a few more of those little things to test.
[Android Software/Hacking General [Developers Only]] amaces:
Thanks for doing this work; I plan to rebase on you V5, so looking forward to that ;)
[Android Software/Hacking General [Developers Only]] JustArchi:
Just wait for the release as my current repo is one giant mess for testing everything I can for M release, so there's really no point in squashing it or even worse - merging, before I'm done.
[Android Software/Hacking General [Developers Only]] rpdroky:
After compiling with UBER 4.9, did you get @22 apps optimized every reboot? i just wanned to know if its just a i9300 problem or its a comune one
[Android Software/Hacking General [Developers Only]] JustArchi:
I don't know because I didn't even test that build when I heard that I can compile it with UBER 5.3.

But I can say that no such issue happens on my latest working build with my optimizations and custom toolchains.

I'm nearly done with my optimizations. I'm just sad that custom aarch64 toolchain doesn't work - my OP2 kernel doesn't boot when compiled with UBERTC 4.9 aarch64.
[Android Software/Hacking General [Developers Only]] Adromir:
I just got it work with this Version: https://bitbucket.org/UBERTC/aarch64-linux-android-4.9-kernel using this for rom: https://bitbucket.org/UBERTC/aarch64-linux-android-4.9
[Android Software/Hacking General [Developers Only]] rpdroky:
Well i wanned to build with 5.3 initial , but it gave me alot of errors , now thanks to [MENTION=4473900]amaces[/MENTION] hints gcc 5 works :D

And about the restart optimization , it takes @ 10-15 sec extra so aint a big isue , i guess i9300 is way to old :)

Thanks alot to both of you! :highfive:
[Android Software/Hacking General [Developers Only]] JustArchi:
Doesn't work for me as my device kernel seems to be using the same toolchain as the ROM (only one aarch64), and that one causes non-booting behaviour.

Could you provide me with your local manifest, or all lines that redefine your used toolchains?
[Android Software/Hacking General [Developers Only]] akhilnarang:
If the kernel even tried to be compiled with the ROM ubertc, I get ICEs [aarch64]

Set the KERNEL_TOOLCHAIN flag manually for the kernel specific ubertc and try
[Android Software/Hacking General [Developers Only]] Adromir:
Once I am home, I will give you the changes I made to my boardconfig. Maybe I even made too much to it, because I am just a beginner.
[Android Software/Hacking General [Developers Only]] JustArchi:
Nobody was born with AOSP Makefiles knowledge. I still have a lot to learn myself.

I'm currently testing how aarch64 kernel toolchain works with my setup. If I succeed, even better, because I might be able to enable even more flags in final commit :).
[Android Software/Hacking General [Developers Only]] Adromir:
I took a start at the makefiles of the ubermallow Rom. It's from the devs of the Uber-toolchain. They also include a lot of optimizations for their Rom already I think you find it at http://www.github.com/ubermallow
[Android Software/Hacking General [Developers Only]] JustArchi:
Yeah, although I don't agree with everything they're doing regarding optimizations. More is not better, tests, benchmarks and regressions should be done. I already spotted things that are not good.

Anyway, the line I added to my board config seems to work.

I'll see if it boots once whole ROM is done.
[Android Software/Hacking General [Developers Only]] Adromir:
If you need any help, I will provide it if possible. I will still send you my configuration later, I have the rom build with the 4.9 toolchain and the kernel with 4.9-kernel
[Android Software/Hacking General [Developers Only]] JustArchi:
I don't, I managed to do it by myself ;).
[Android Software/Hacking General [Developers Only]] Adromir:
Okay, if it boots, I can heavily shorten down my configuration, because I have a lot more than that. Still wasn't able though to make it boot with a 5.3 compiled kernel, but I have an idea already, what the problem might have been
[Android Software/Hacking General [Developers Only]] JustArchi:
Booted for me :). And I confirmed that it's all that is needed.
[Android Software/Hacking General [Developers Only]] Adromir:
Great thanks. Hopefully it also works to get the rom compile with 4.9 Uber and the kernel with a different one like 5.3. Now just trying to sort out, how to include your optimizations the best way lol
[Android Software/Hacking General [Developers Only]] Vynikal:
Ok, I am currently using a ROM built with JustArchi's commits for cm13. So far so good, I even enabled the graphite line, no problems encountered. I only applied the id3 commit and -Os flag for /system/bt/main/Android.mk
[Android Software/Hacking General [Developers Only]] rpdroky:
Hy Archi , when youl have the time, coul'd you help me out with this GCC5 error in i9300 , i tryed to cherry-pick this to from yre cm12.1 but it had no efect at all , Thanks in advance for any advice :)

Edit: Never mind , i just deleted this line and the ROM compiled , altho i don't know if there are side efects by doing that ...

Cheers :highfive:
[Android Software/Hacking General [Developers Only]] JustArchi:
I'm currently testing my build for OP2 and I can't notice any need of extra -Os hacks or cherry-picks for any other repos apart from android_bionic fixes for GCC 5.3.1, if somebody wants to compile androideabi with something newer than 4.9.

Any symptoms I should be aware of & check before staying with my assumption that it's no longer needed?
[Android Software/Hacking General [Developers Only]] akhilnarang:
+1

In compiling mm, haven't found any other patches required to use gcc5+ other than that one in bionic

BTW, using 5.3 for ROM for aarch64 also????

Uber has only a 4.9 one
[Android Software/Hacking General [Developers Only]] JustArchi:
I'll switch to 6.0 for kernel later as well, but I'm testing things before doing so.
[Android Software/Hacking General [Developers Only]] Vynikal:
Actually I didn't test a build without those two changes, I played it the safe way.
[Android Software/Hacking General [Developers Only]] Vynikal:
This is the final commit for cm-13.0, all credits go to JustArchi, as I only summed up his experiments to one final commit.

I enabled graphite flags, they work fine if you choose a compatible toolchain without ICEs. I use UBER (5.3), and for kernel Christopher83's new gcc (5.2).

Builds are stable on my devices, I even compiled one for 2011 SE device :victory:

https://github.com/Vynikal/android_build/commit/6af9a30f748153bf9bcab533dbaa7c964113aff2
[Android Software/Hacking General [Developers Only]] Uchiha_Dev:
If I add the toolchain you provided do I need to use your commits ? Also I make a new xml roomservice.xml, will doing a repo sync download it and replace with your toolchain ? And if I do a repo sync will I lose all the patches and commits that I made in my working dir will be lost and be replaced with the original ones ? (I made the patches myself offline, I don't have the commits in git)

---------- Post added at 03:22 PM ---------- Previous post was at 02:55 PM ----------

I used

cd /rr/build/

git fetch https://github.com/ArchiDroid/android_build.git

git cherry-pick f9b983e8e11624b48ae575da206f1baf6979772c

and I get this error : fatal: bad object f9b983e8e11624b48ae575da206f1baf6979772c

well nevermind I manually added the commits, I am only supposed to add these commits right ? or are there other repo's too ?

https://github.com/ArchiDroid/android_build/commit/f9b983e8e11624b48ae575da206f1baf6979772c (I just added and removed the green and red lines respectively, is that OK ?)
[Android Software/Hacking General [Developers Only]] Adromir:
I tried to build it with UberTc aarch64-4.9 and 4.9- kernel but the build stops at libskia and libselinux with an graphite error that crashes the toolchain
[Android Software/Hacking General [Developers Only]] Uchiha_Dev:
could anyone tell me if this makes any changes to the libs, bins, xbin or not ?
[Android Software/Hacking General [Developers Only]] Vynikal:
Idk about aarch64 toolchains, I don't have any 64-bit device.

But you'll surely get rid of the error by adding a "#" before line 44.

This is for everyone who gets graphite errors.

Most likely they'll get a bit bigger. Nothing crucial.
[Android Software/Hacking General [Developers Only]] Uchiha_Dev:
can I odex it for more optimization ?
[Android Software/Hacking General [Developers Only]] Uchiha_Dev:
I did not notice any difference sadly "for me"
[Android Software/Hacking General [Developers Only]] rpdroky:
At least you can odex it, i tryed to odex my i9300 ROM and it gives me bootloop :p
[Android Software/Hacking General [Developers Only]] Uchiha_Dev:
yes, I will try that

Stuck at boot animation after odexing :/
[Android Software/Hacking General [Developers Only]] Uchiha_Dev:
I am adding this in a different ROM now and I get the expected endif in TARGET_linux-arm.mk file, it shows that it is expecting a endif at the end of the .mk, if I add it, the ROM starts to compile but I am afraid it will cause errors or bugs in ROM

---------- Post added at 08:26 PM ---------- Previous post was at 08:01 PM ----------

Fixed it :D With a little comparison (was not a mistake by me but a few lines were not there in the .mk by default)

---------- Post added at 08:29 PM ---------- Previous post was at 08:26 PM ----------

Also is it ok to use the stock 4.8 toolchain instead of using a custom toolchain ?
[Android Software/Hacking General [Developers Only]] PWn3R:
Hi All - I've spent about 14 hours messing around trying to figure this out now, and I'm hoping someone else can find something weird.

I'm on Ubuntu 15.10 with all the required packages installed based on the documentation. I am getting these errors:

target thumb C++: init <= system/core/init/bootchart.cpp

target thumb C++: init <= system/core/init/builtins.cpp

clang++: error: optimization flag '-fivopts' is not supported

clang++: error: optimization flag '-ftracer' is not supported

clang++: error: optimization flag '-fivopts' is not supported

clang++: error: optimization flag '-ftracer' is not supported

build/core/binary.mk:733: recipe for target

At the beginning of the compiles. I am not sure what to do to fix it. It *looks* like somehow Clang is getting the GCC optimization flags that were added by the ArchiDroid stuff. Before anyone starts screaming - I am building Beanstalk - which is CM based, NOT stock CM. I'm willing to work through errors, I think things are configured properly and I was successfully building prior to adding these changes. Just looking for some help. THANKS!
[Android Software/Hacking General [Developers Only]] rpdroky:
Here is the fixed version [MENTION=4872819]Vynikal[/MENTION] made , he added -ftracer and -fivopts (the errors) in the core/clang/config.mk file in the CLANG_CONFIG_UNKNOWN_CFLAGS := \ section , give it a try

Cheers :highfive:
[Android Software/Hacking General [Developers Only]] PWn3R:
THANK YOU!!!!!!!!!!!!!! Will test when I have a minute.

EDIT: That worked thank you very much. One last issue is that Bluetooth Share crashes non stop if you try to turn on bluetooth. Anyone else run into this issue? Anyone got a fix?

EDIT2: I just noticed the bluetooth fix for changing a flag in a file that took me about an hour to find in the OP. Flag change has been made and a new build is going now. Thanks again ArchiDroid and thanks rpdroky for the help.
[Android Software/Hacking General [Developers Only]] rpdroky:
Glad to be hepful , btw , coul'd you mention the flag that you changed ?
[Android Software/Hacking General [Developers Only]] Vynikal:
The commit rpdroky pointed at is a bit outdated, use the new cm13 one as I'm going to delete the old one.
[Android Software/Hacking General [Developers Only]] Adromir:
Okay, I got everything work so far building a room with aarch64-4.9 for both rom and kernel. But when I try to switch to 5.3 for kernel, I run in some issues. If I enable ARCHIDROID_GCC_CFLAGS_32 I get the error that this are unsupported options while compiling the rom. If I disable them, the kernel build fails with a parenthesis error. Am I thinking right that moving the flags from ARCHIDROID_GCC_CFLAGS_32 to ARCHIDROID_GCC_CFLAGS_64 might do the trick?
[Android Software/Hacking General [Developers Only]] Uchiha_Dev:
used this in AICP and got this error

http://pastebin.com/1rUwZtfh
[Android Software/Hacking General [Developers Only]] PWn3R:
It's the change in the OP from ArchiDroid under fixes section labelled bluetooth. I honestly can't remember where I actually found said file, but I changed it and recompiled and everything worked correctly. I have to re do all my merges by hand because something got corrupted in my .git and .repo folders so I had to do a repo forall -vc "git reset --hard" and then wipe out some corrupted entries to fix things. It removed all the changes that I merged into those files by hand....

---------- Post added at 10:04 PM ---------- Previous post was at 10:03 PM ----------

Looks to me like something might not be merged in the right spot. I would check the changes in the core directory and make sure where you merged everything was correct. When I did it with Beanstalk almost none of the line numbers were right, and I had to correct a couple of the variables.
[Android Software/Hacking General [Developers Only]] Uchiha_Dev:
Thanks, I will check but I am sure I added all of it in the correct places and all the line numbers matched
[Android Software/Hacking General [Developers Only]] rpdroky:
What toolchain are you using? because you need a custom one for the optimizations, like UBERTC
[Android Software/Hacking General [Developers Only]] sunsettrack4:
I want to use UBERTC tool chain for building, so I added these lines to roomservice.xml:

<remove-project name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" />
<project name="UBERTC/arm-eabi-5.3" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" remote="bitbucket" revision="master" />
<remove-project name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9" />
<project name="UBERTC/arm-linux-androideabi-5.3" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" remote="bitbucket" revision="master" />

But for some reason, I'm unable to start the building process:

sunsettrack4@jln-ubuntu:~/rr$ make clean
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=6.0.1
RR_VERSION=ResurrectionRemix-M-v5.6.4-20160309-slte
DEVICE=slte
TARGET_BUILD_VARIANT=user
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a15
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
TARGET_GCC_VERSION=4.9
TARGET_NDK_GCC_VERSION=4.9
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.2.0-30-generic-x86_64-with-Ubuntu-15.10-wily
HOST_BUILD_TYPE=release
BUILD_ID=MMB29V
OUT_DIR=/home/sunsettrack4/rr/out
============================================
Checking build tools versions...
PRODUCT_COPY_FILES device/samsung/slte/configs/gps/gps.conf:system/etc/gps.conf ignored.
PRODUCT_COPY_FILES frameworks/av/media/libeffects/data/audio_effects.conf:system/etc/audio_effects.conf ignored.
PRODUCT_COPY_FILES device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml ignored.
PRODUCT_COPY_FILES device/generic/goldfish/camera/media_profiles.xml:system/etc/media_profiles.xml ignored.
PRODUCT_COPY_FILES device/generic/goldfish/camera/media_codecs.xml:system/etc/media_codecs.xml ignored.
PRODUCT_COPY_FILES hardware/libhardware_legacy/audio/audio_policy.conf:system/etc/audio_policy.conf ignored.
No private recovery resources for TARGET_DEVICE slte
Entire build directory removed.

#### make completed successfully (2 seconds) ####

sunsettrack4@jln-ubuntu:~/rr$

I already deleted CCACHE. Everything works fine by using the normal toolchains. What's wrong?
[Android Software/Hacking General [Developers Only]] Adromir:
I would guess you deleted the bootable_recovery folder?
[Android Software/Hacking General [Developers Only]] Uchiha_Dev:
used the toolchain archi provided, added the lines in roomservice.xml and repo synced, force synced his toolchain's
[Android Software/Hacking General [Developers Only]] sunsettrack4:
Maybe this folder doesn't exist in my project. I'll take a look at it, thanks! But why does the terminal show the wrong tool chain version (4.9 instead of UBERTC 5.3)?
[Android Software/Hacking General [Developers Only]] akhilnarang:
Coz you've synced it in 4.9 dir

Don't remove the default ones, sync there in 5.3 folder

Then export TARGET_GCC_VERSION_EXP := 5.3
[Android Software/Hacking General [Developers Only]] sunsettrack4:
Do I have to add any extra fixes to compile kernel with 5.3 tool chain? Because I get error 1, I'll post a log as soon as I am back at home.

Gesendet von meinem SM-G920F mit Tapatalk
[Android Software/Hacking General [Developers Only]] Vynikal:
if you jumped right to 5.X toolchain from an older one, you'll need to fix many errors, you can find specific examples in my Github kernel repositories.
[Android Software/Hacking General [Developers Only]] sunsettrack4:
Is there the possibility to use arm-eabi-5.3 and arm-linux-androideabi-4.9 at the same time? When I use the TARGET_GCC_VERSION=5.3 command, the terminal wants to open the arm-linux-androideabi-5.3 files which shouldn't be used in my building process ...

Gesendet von meinem SM-G920F mit Tapatalk
[Android Software/Hacking General [Developers Only]] akhilnarang:
That flag is for androideabi, for compiling ROM

Set 4.9

To use the 5.3 for kernel, KERNEL_TOOLCHAIN := /path/to/arm-eabi-5.3/bin
[Android Software/Hacking General [Developers Only]] sunsettrack4:
I don't know why I always get this error without any mentioned reasons, even by using UBERTC 4.9:

Makefile:130: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory '/home/sunsettrack4/rr/kernel/samsung/slte'
build/core/tasks/kernel.mk:286: recipe for target 'TARGET_KERNEL_BINARIES' failed
make: *** [TARGET_KERNEL_BINARIES] Error 2

Do you have an idea? This is my kernel source: https://github.com/sunsettrack4/resurrection_kernel_samsung_slte
[Android Software/Hacking General [Developers Only]] akhilnarang:
Error is more up
[Android Software/Hacking General [Developers Only]] sunsettrack4:
Yep, I found it:

/home/sunsettrack4/rr/kernel/samsung/slte/include/linux/compiler-gcc.h:103:30: fatal error: linux/compiler-gcc5.h: No such file or directory
compilation terminated.
/home/sunsettrack4/rr/kernel/samsung/slte/scripts/mod/Makefile:34: recipe for target 'scripts/mod/devicetable-offsets.s' failed
make[4]: *** [scripts/mod/devicetable-offsets.s] Error 1
/home/sunsettrack4/rr/kernel/samsung/slte/scripts/Makefile.build:455: recipe for target 'scripts/mod' failed
make[3]: *** [scripts/mod] Error 2
make[3]: *** Auf noch nicht beendete Prozesse wird gewartet …

I think I should add this file: https://github.com/Vynikal/android_...ed2849b6366a82a/include/linux/compiler-gcc5.h

But what about the other errors?
[Android Software/Hacking General [Developers Only]] akhilnarang:
You can expect a lot more[emoji14]You can have a look at https://github.com/akhilnarang/ThugLife_falcon/commits/master about page 4/5, should have gcc5 fixes
[Android Software/Hacking General [Developers Only]] roshan2989:
Still getting bluetooth fc after applying "-Os" to LOCAL_CFLAGS" in system/bt,here is the logcat for it

View attachment logcat_13_3.zip

after applying the flag,just did a clean build "make clean/clobber AND empty ccache (rm -rf ~/.ccache)" as mention in op,getting the same result.
[Android Software/Hacking General [Developers Only]] Vynikal:
Did you really put it here?

https://github.com/CyanogenMod/android_system_bt/blob/cm-13.0/main/Android.mk#L137
[Android Software/Hacking General [Developers Only]] roshan2989:
yes here it is, and i odex the rom,is this because of the odex?
[Android Software/Hacking General [Developers Only]] PWn3R:
Hi All - I had to re-merge all the changes by hand and I got a successful build. I just added the BT change again - took me a few minutes to find the file. I am getting a message from multiple things saying there is no space on the device I am testing on. Granted I am building on a N6 and I updated to the Android N Bootloader and Radio. Everything boots, but I don't understand the storage message (when you go to storage, there's 48GB of free space on my device).

Has anyone seen this issue?
[Android Software/Hacking General [Developers Only]] sunsettrack4:
Which changes do I have to add in order to compile CM13 with -O3 flags? It seems that the changes mentioned in thread OP are outdated.
[Android Software/Hacking General [Developers Only]] benschhold:
[MENTION=5161352]JustArchi[/MENTION]

Hey, did you make a progress in OP2 optimizations?

Cause i tried but it sadly doesnt boot using uber4.9 tc rom and kernel

Benjamin
[Android Software/Hacking General [Developers Only]] Adromir:
For what arch? I am successfully using it with the aarch64 toolchains
[Android Software/Hacking General [Developers Only]] benschhold:
OP2 is aarch64 device

check the top 2 commits: https://github.com/benschhold/android_build/commits/cm-13.0

anything wrong with that?