yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] sysKin:
Sorry if I'm not clear, I mean only this particular one: when someone didn't understand what does sizeof do, and used it wrong. It's *definitely* wrong.

Several times I didn't want to change the buggy behaviour (who knows what else will I uncover) so I changed the sizeof to literal 4 -- which is exactly as wrong (sizeof pointer is 4 on 32-bit systems).
[Android Software/Hacking General [Developers Only]] metalspring:
Well again, if you can fix them, then go right ahead, but if you cant, then just leave it like the source had it, also keep in mind different optimizations change how code is put together and it may be a particular optimization causing the code to be improperly compiled resulting in those warnings
[Android Software/Hacking General [Developers Only]] bigsupersquid:
I've been lurking here a while since JustArchi started posting enhancement methods in the CrossBreeder thread.

Think I'm ready to try to apply the v3 optimizations to my Rom and kernel. I will of course give credit and link here when (not if) the optimizations improve my output.

I wanted to mention that the actual commit is really tiny considering what it does. And the list of specific optimizations before the actual patches is really quite impressive.

Thanks for sharing! The true spirit of open source, cooperation rather than hiding improvements and competing.
[Android Software/Hacking General [Developers Only]] sparksco:
Where you getting your information? I'd like to know thanks. From what I know there's plenty of a-15 devices. Nexus 5, LG G2 etc...
[Android Software/Hacking General [Developers Only]] metalspring:
I know there are plenty of cortex-a15 devices, and krait is most similar to cortex-a15, however its my understanding that for certain krait optimizations to work for most krait devices, they need to be treated as cortex-a9. At least thats what a few of the main vanir devs said, you may also want to check the comments on this commit-

http://vaniraosp.goo.im/#/c/9799/
[Android Software/Hacking General [Developers Only]] sparksco:
Yeah I don't believe everything I read.. Maybe they and others are using old gcc versions which don't support the cortex-a15. It works fine in the kernel I'll try ROM later adding C and CPP flags for hammerhead and see how it does.

Edit: Android might not also be ready for cortex-a15 optimizations, still need to test.
[Android Software/Hacking General [Developers Only]] metalspring:
I think its more to do with bionic than anything, since krait has its own versions, which may conflict with the ones in cortex-a15 and cause issues with krait 300 and older devices. Krait 400 devices (such as hammerhead and the one m8) seem to work just fine with cortex-a15 set
[Android Software/Hacking General [Developers Only]] xboxfanj:
http://android.git.linaro.org/gitwe...013118be46bed1d8:/drivers/usb/gadget/f_qdss.c
[Android Software/Hacking General [Developers Only]] r0gger:
Thank you both guys.

Highly appreciate this!

Regards!
[Android Software/Hacking General [Developers Only]] bigsupersquid:
I got this funny error with the justarchi branch linaro 4.8 building androidarmv6 based cm11.

error: relocation overflow in R_ARM_THM_CALL

in libwebcore. Went from -j6 to -j1 since google indicated out of memory (but I've got 16 Mb ram and a 6-core cpu since I actually invested more than $100 in a computer for the first time, this year)

It cut that error down to happening twice instead of four times.

More research said it was chromium... but that was in 2011.

So I cheated. Changed back to TARGET_GCC_VERSION := 4.7 in TARGET_linux-arm.mk, removed the part of libwebcore it'd built in /out, and did a 'make libwebcore'

It built fine that way. Then changed back to gcc 4.8 and went back to 'make bacon'

I'll probably test it before I get an answer, but is that a totally illegitimate way to get around the error?

//edit: I guess maybe it works even if it doesn't feel exactly kosher. Browser works fine... Everything built ok; of course the kernel wouldn't boot. But I slapped a gcc 4.7 version in and the whole thing started up fine after that. So on to patch the kernel. //edit: which didn't work... armv6 device and it still hangs. But I will dig further.

It could be an illusion cause I've not done a single benchmark yet, but it does seem to feel snappier.

Thanks again for sharing.

feels nice while running, now included on ROM; with credits on github and rom thread linking to this thread.

//edit: I found a slightly more elegant workaround.... added the -O2 flags to the Android.mk for v8 and it builds fine with most of the ROM -O3... Again, I'll have to see if there are issues or not with the janky workaround.
[Android Software/Hacking General [Developers Only]] xboxfanj:
On the two devices I've tried (Optimus G and M8), A15 flags have done better in general UI speed. Haven't compared benchmarks. Same observations on the Nexus 5 and jflte and several other devices by other members of the Vanir team. Google sets A15 flags globally for Krait devices in master (A9 on release branches).
[Android Software/Hacking General [Developers Only]] xboxfanj:
Either one technically works, but you may as well fix the warning if you know how rather than disabling the error. Disabling warnings is more of a last resort.
[Android Software/Hacking General [Developers Only]] sysKin:
Yup, that is what I did (and this is what I meant by "stop using n functions: strncmp -> strcmp"). If there are other bugs and both strings are not zero-terminated, then technically this can cause reading beyond allocated buffers, but it would require *many* more bugs in the code.

Ah, thanks for that, it explains some things. I looked into bionic and I see it has its own krait implementation (selected regardless of mcpu flag), but it's possible that this implementation was tuned for compilation for mcpu=cortex-a9 and doesn't do what's expected for a15. *However*, if that's the risk, then -O3 probably has the same (or even bigger) effect of un-tuning it...

Anyone knows of a benchmark that would extensively test bionic performance? Would file i/o be a good test?

----

Now, I have another observation: has anyone noticed that Dalvik VM compilation explicity disables one important optimisation flag? Being that Dalvik is important, I'm currently compiling with jump targets aligned, will tell you how that goes.

Does anyone know the performance cost of unaligned jump targets on our ARMs?
[Android Software/Hacking General [Developers Only]] rr46000:
Error

error while compiling,please help!

http://pastebin.com/CBuwVhPN

Trying to compile omnirom for moto g
[Android Software/Hacking General [Developers Only]] TeamMex:
uhmm use this

for me build fine :)

put in device/qcom/common/power/
[Android Software/Hacking General [Developers Only]] rr46000:
device/qcom/common/power/power.c: In function 'power_init':
device/qcom/common/power/power.c:67:45: warning: unused parameter 'module' [-Wunused-parameter]
static void power_init(struct power_module *module)
^
device/qcom/common/power/power.c: In function 'power_hint_override':
device/qcom/common/power/power.c:247:69: warning: unused parameter 'module' [-Wunused-parameter]
int __attribute__ ((weak)) power_hint_override(struct power_module *module, power_hint_t hint,
^
device/qcom/common/power/power.c:247:90: warning: unused parameter 'hint' [-Wunused-parameter]
int __attribute__ ((weak)) power_hint_override(struct power_module *module, power_hint_t hint,
^
device/qcom/common/power/power.c:248:15: warning: unused parameter 'data' [-Wunused-parameter]
void *data)
^
device/qcom/common/power/power.c: In function 'power_hint':
device/qcom/common/power/power.c:270:14: error: 'POWER_HINT_SET_PROFILE' undeclared (first use in this function)
case POWER_HINT_SET_PROFILE:
^
device/qcom/common/power/power.c:270:14: note: each undeclared identifier is reported only once for each function it appears in
device/qcom/common/power/power.c:278:14: error: 'POWER_HINT_AUDIO' undeclared (first use in this function)
case POWER_HINT_AUDIO:
^
device/qcom/common/power/power.c: In function 'set_interactive_override':
device/qcom/common/power/power.c:287:74: warning: unused parameter 'module' [-Wunused-parameter]
int __attribute__ ((weak)) set_interactive_override(struct power_module *module, int on)
^
device/qcom/common/power/power.c:287:86: warning: unused parameter 'on' [-Wunused-parameter]
int __attribute__ ((weak)) set_interactive_override(struct power_module *module, int on)
^
build/core/binary.mk:512: recipe for target '/home/rohan/android/omni/out/target/product/falcon/obj/SHARED_LIBRARIES/power.msm8226_intermediates/power.o' failed
make: *** [/home/rohan/android/omni/out/target/product/falcon/obj/SHARED_LIBRARIES/power.msm8226_intermediates/power.o] Error 1
make: *** Waiting for unfinished jobs....
device/qcom/common/power/metadata-parser.c: In function 'parse_metadata':
device/qcom/common/power/metadata-parser.c:59:77: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
bytes_to_copy = MIN(strlen(attribute_string) - strlen(attribute) - 1,
^
device/qcom/common/power/metadata-parser.c:59:112: warning: signed and unsigned type in conditional expression [-Wsign-compare]
bytes_to_copy = MIN(strlen(attribute_string) - strlen(attribute) - 1,
^
device/qcom/common/power/utils.c: In function 'interaction':
device/qcom/common/power/utils.c:178:54: warning: comparison between pointer and integer [enabled by default]
if (duration <= 0 || num_args < 1 || opt_list[0] == NULL)
^

real	4m25.153s
user	0m42.039s
sys	0m40.750s
rohan@rohan:~/android/omni$

and also please tell how to cherry pick a commit ,maybe i have been wrong in that
[Android Software/Hacking General [Developers Only]] TeamMex:
well i copy all configs i dont make cherry pick

check select.mk file and add this

# Global CFLAGS.
$(combo_target)GLOBAL_CFLAGS := -O3 -DNDEBUG -funsafe-loop-optimizations -fivopts -ftree-loop-im -ftree-loop-ivcanon -ffunction-sections -fdata-sections -funswitch-loops -frename-registers -frerun-cse-after-loop -fomit-frame-pointer -fgcse-sm -fgcse-las -fweb -ftracer -Wno-error=unused-parameter -Wno-error=unused-but-set-variable -Wno-error=maybe-uninitialized -fno-exceptions -Wno-multichar

# Global Release CFLAGS.
$(combo_target)RELEASE_CFLAGS := -O3 -DNDEBUG -fno-strict-aliasing -funsafe-loop-optimizations -fivopts -ftree-loop-im -ftree-loop-ivcanon -ffunction-sections -fdata-sections -funswitch-loops -frename-registers -frerun-cse-after-loop -fomit-frame-pointer -fgcse-sm -fgcse-las -fweb -ftracer -Wno-error=unused-parameter -Wno-error=unused-but-set-variable -Wno-error=maybe-uninitialized

# Global LDFLAGS.
$(combo_target)GLOBAL_LDFLAGS := -Wl,-O1 -Wl,--as-needed -Wl,--relax -Wl,--sort-common -Wl,--gc-sections

coment if work ;)

cheers.
[Android Software/Hacking General [Developers Only]] rr46000:
I fixed it on my own by using correct qcom/common repos

anyway I'll try this too

things I noticed, android version is back to 4.4.2 earlier it was 4.4.3

archi version is showing unknown

and process. system.acore fc's only on first boot
[Android Software/Hacking General [Developers Only]] JustArchi:
I have no idea what you did but this little commit has nothing common with android version or my version, perhaps you forked my whole repo instead of cherry-picking this.
[Android Software/Hacking General [Developers Only]] metalspring:
I have to disagree just a little, it's entirely possible new code introduced in a new android version can react differently to your optimizations, just the same way it might cause issues on some devices. I'm not saying it's likely, but it's definitely possible.
[Android Software/Hacking General [Developers Only]] JustArchi:
Okay but there's no way that my optimizations could downgrade android version from 4.4.3 to 4.4.2 :rolleyes:.
[Android Software/Hacking General [Developers Only]] rr46000:
I'm sorry but I did that, taking your whole repo

but how do I cherry pick ur commit, please, I have been searching a lot and I can't find how to cherry pick
[Android Software/Hacking General [Developers Only]] JustArchi:
I wrote in the OP that you must already be experienced with gerrit and cherry-picking commits. Honestly I found over a hundred of records on Google in less than a few seconds.
[Android Software/Hacking General [Developers Only]] rr46000:
I have already tried a lot, and all of them are either for gerrit , or when I use others then I get errors

Yes I read the whole op and I saw that too (it's for experienced users)

I was too amazed to see this commit that I thought that i should give it a try

anyway I'm learning..

anyway, I'll search more and see where it goes

Anyway thanks for the awesome commit!
[Android Software/Hacking General [Developers Only]] ZION959:
Cherry picking

http://pastebin.com/StEbCWEY

http://xdaforums.com/showthread.php?t=2329228
[Android Software/Hacking General [Developers Only]] jamus28:
FINALLY got this working for cm10.2 and my S4 mini (serrano3gxx)

Some advice:

Needed to edit the cherry pick. Followed this guide:

http://xdaforums.com/showpost.php?p=52925654&postcount=4

I had the hwcomposer.msm8960 undefined reference / collect2 error while building. I tried linaro 4.8, google 4.8, and 4.7.

I fixed it by adding the -Os LOCAL_CFLAGS to android.mk in

/hardware/qcom/display-caf/libhwcomposer

and

/hardware/qcom/display/libhwcomposer

Both local_cflags lines read

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

EDIT Better solution: Removing "inline" from before the undefined function in the cpp files worked! Thank you.

I was able to build without regressing to Os.

Make note of the "undefined" errors, eg Configrotator.

In the display and display-caf folders, do a search for "inline" within the cpp files. You'll see those lines of code.
[Android Software/Hacking General [Developers Only]] sysKin:
This is one way of fixing it, but there is another: find where those functions are implemented (it's in the same directory) and remove |inline| from them.

I *think* an alternative is to add |inline| to their declaration (in .h file) but I haven't tried that.

This |inline|, together with -O2 or -O3, somehow changes those functions in such a way that linker can't find them later.
[Android Software/Hacking General [Developers Only]] spanish33:
[MENTION=5161352]JustArchi[/MENTION] I made the following changes to build/core/combo/TARGET_linux-arm.mk and my build runs smoother than the default configuration.

TARGET_GCC_VERSION from 4.7 to 4.8

TARGET_arm_CFLAGS from 02 to 03

TARGET_thumb_CFLAGS from 0s to 02

Is there any additional benefits to applying your mod?
[Android Software/Hacking General [Developers Only]] JustArchi:
You didn't read important changes, did you?
[Android Software/Hacking General [Developers Only]] spanish33:
Thank you, yes I did read the entire original post and the changes. Also the differences between 0s 02 03.

I am already getting great results from the couple changes I made. I was really asking if the changes between yours and the ones I made are noticeably different for the end user (me) that it is worth all the build errors?

Anyway thank you I am trying to compile a build now with your changes.
[Android Software/Hacking General [Developers Only]] JustArchi:
Build errors so far are related to:

1. Used compiler

2. Used GCC version

3. O3/O2 applied to previous Os

Since you did all of this already, you can't get any errors.

And honestly I won't tell you if the rest makes a difference or not, this is not a placebo thread, YOU apply this and tell me if it makes a difference for you or not ;).
[Android Software/Hacking General [Developers Only]] jamus28:
Removing "inline" from before the undefined function in the cpp files worked! Thank you.

I was able to build without regressing to Os, and with linaro 4.8
[Android Software/Hacking General [Developers Only]] bigsupersquid:
Interesting.

I resynced repo (cm11, 4.4.3 base), make clobber, rm -rf ~/.ccache, ccache -C and got a full build at -O3 with justarchi repo of linaro 4.8 without any hangups in v8 like my first attempts. Maybe there were ccache remnants or something the first time.

Built fine, runs clean.

Appreciate the source and the information.

I haven't figured out how to boot the kernel yet with the 4.8 toolchain though. The posted solution is for armv7 device, mine is armv6 and when I put that patch in there it still won't boot far enough for a dmesg. Hangs on the factory splash like with no boot.img installed.

I can try using fastboot and force a soft reboot into a working kernel for a last_kmsg if it got far enough to record one, but that's all I can think of at the moment.

I wonder if it has anything to do with this comment here, when I compile with the default google toolchain I see this same warning come up in several places.

(from here)

Let me know if I'm derailing things in this thread and I'll quiet down.
[Android Software/Hacking General [Developers Only]] jsnweitzel:
Try this :

https://github.com/LiquidSmooth-Dev...mmit/a465d392c84869a22866317a277b6dc3c3b241f2

Might have already been pointed out by someone else. If so sorry for the repost
[Android Software/Hacking General [Developers Only]] jamus28:
I'm getting the graphical glitches reported previously with linaro 4.8

Screenshots in apps like playstore are corrupted. Some apps that use webview cant even load pictures at all (Newegg for one).

It's too bad, as the Rom is working well. I'll try sabermod.
[Android Software/Hacking General [Developers Only]] JustArchi:
Make sure that you're using correct memset.

When building kernel with Linaro 4.8+, make sure that you have following commits:

https://github.com/JustArchi/ArchiKernel/commit/6548bbdc4518a1a28b1853e829492f8106d01244

https://github.com/JustArchi/ArchiKernel/commit/79d94ff2b47f7818f3cea7575470d9292005123b

They should be kernel-independent and universal (not cause any side effects).

Without this, kernel may not boot when built with Linaro 4.8. This is mostly hitting users with fairly old base kernel, like my i9300 with 3.0.31. And of course it's strictly connected with the new GCC and Linaro.
[Android Software/Hacking General [Developers Only]] t4n017:
Yep, same happened on my build. But I don't really see a huge difference between Linaro and GCC 4.8, which doesn't have those graphical issues..
[Android Software/Hacking General [Developers Only]] Corel_vkl:
So im little confused :S

Im using stock rom on my moto g rooted have installed xposed,busy box can I flash this ?
[Android Software/Hacking General [Developers Only]] t4n017:
Flash what? :eek: . Please tell me you're trolling .
[Android Software/Hacking General [Developers Only]] Corel_vkl:
My bad sory im new to all of this i think it's a mod like pure performance or something like that . :)
[Android Software/Hacking General [Developers Only]] DorianX:
Sure just flash the zip provided on first post and your device will fly [emoji3]

Just kidding [emoji38], did you see any flashable zip? Did you read the OP?

Enviado desde mi HTC Explorer A310e mediante Tapatalk
[Android Software/Hacking General [Developers Only]] bigsupersquid:
Those patch cleanly over my base and build but still no boot.

I also tried combining both of them with the https://github.com/JustArchi/android_kernel_samsung_smdk4412/commit/803cd15 from the OP v3 commit page. Only https://github.com/JustArchi/ArchiKernel/commit/79d94ff2b47f7818f3cea7575470d9292005123b patches cleanly over the samsung kernel commit. Put those together, still no soup.

Afraid I'm over my head here. Not exactly sure what I'm looking for, and still can't get far enough into booting to pull any kind of dmesg or last_kmsg, which were the only ways I debugged the original porting process.

Unless...

since it's an armv6 device which will lock up or reboot if thumb2 code gets compiled in.

If I'm reading right, using r8 the way it is may exceed the capabilities of my thumb1 processor?

ldmeqfd	sp!, {r4-r8, pc} for example, when the docs I find say

For Thumb (format 2),

Rn and the register list registers must be in the range r0 to r7

I dealt with similar issues trying to patch the thumb2 cruft in ART, and if that's what's borking up my build i can try to work around that issue myself.

//edit2: well, turns out the patches cause no issues with thumb when compiled with gcc 4.7, so I must be off base there.

Now trying liquidsmooth UBER linaro 4.9 just for grins. Nope, that won't boot either.

As far as base kernel, I'm building a 3.0.8 but it's got everything relevant to my device forward-ported from 2.6.35, so it is indeed a pretty old one.

I see what you mean about it being a 4.8+ issue since a 4.7 build boots just fine. I'll google some more on linaro 4.8, memset, and booting 3.0 kernel.

//edit: oh, and I cleaned ccache and clobbered before building each time, to avoid carrying over issues from previous attempts.
[Android Software/Hacking General [Developers Only]] JustArchi:
I'm afraid that you need to use 4.7 then.

I bolded interesting thing for you. Basicly you just need to use 4.7 revision in 4.8 path, this way compiler will search for TARGET_GCC_VERSION 4.8 but will actually load 4.7.

P.S. This "hack" will work also with Google's and SaberMod's, you just need to use 4.7 toolchain and place it in arm-eabi-4.8 directory. Nothing else is required to do. All toolchains are in my manifest:

https://github.com/JustArchi/ArchiDroid/blob/2.X-EXPERIMENTAL/__dont_include/roomservice.xml
[Android Software/Hacking General [Developers Only]] bigsupersquid:
Thanks. I've been using a different workaround to build ROM with 4.8 and kernel with 4.7, since 4.8 works fine for everything except the kernel itself.

in BoardConfig.mk

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

I will try to patch the memset patches for armv6, if it works I'll post results/patches for others with 'prehistoric hardware' to use. If not, no harm trying, anyway.

I suspect at some point I'll lose buildability in later android releases if I can't fix it. my device's SoC has already been unsupported by Google, and obsoleted by LGE and Qualcomm, years ago. Any upgrades have been user-driven since 2012.

I really appreciate your support, I feel really noobish again digging this far into the build process, but I've already learned a fair bit from applying your optimizations, which is always a good thing.

Thanks again for sharing.

//edit: no issues with the patches themselves, I can build kernel including them with gcc 4.7 and it boots.
[Android Software/Hacking General [Developers Only]] JustArchi:
Don't worry mate, I'm building for i9300, which is going to be in similar state soon. My head hurts when I'm looking at number of blobs my device require in order to actually work with AOSP... :p. I'm not sure if there's anything more buggy and hackish than my smdk4x12 family.
[Android Software/Hacking General [Developers Only]] JustArchi:
Doesn't look like anything connected with the optimizations.
[Android Software/Hacking General [Developers Only]] fusionjack:
there is a flag that needs to be disabled. that flag is causing kernel fault (at least for exynos 4210 devices) when compiled with gcc 4.8.

can't remember the flag name as i forgot to push to my github, lol.
[Android Software/Hacking General [Developers Only]] bigsupersquid:
was it something like this?

ifneq ($(filter 4.8 4.8.% 4.9 4.9.%, $(TARGET_GCC_VERSION)),)
TARGET_arm_CFLAGS += -Wno-unused-parameter \
-Wno-unused-value \
-Wno-unused-function

TARGET_thumb_CFLAGS += -Wno-unused-parameter \
-Wno-unused-value \
-Wno-unused-function
endif

that's just adding flags, though, not disabling any.

//edit: nope, that patch had no effect, as expected.
[Android Software/Hacking General [Developers Only]] Codename13:
I applied these patches so I could build my kernel with SaberMod 4.8. It booted fine, but it was a bit laggy for a few minutes. I previously had used SaberMod 4.7 to compile my kernel, it worked fine, and there was no abnormal lag. Is SaberMod 4.8 by any chance not as optimized as 4.7?
[Android Software/Hacking General [Developers Only]] JustArchi:
You're starting asking for things I have no idea about.

I'm compiling kernel with all sets of flags and Linaro 4.9.1. No issues.