yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] PWn3R:
No, I just did the copy paste of the changes. The linux x86 mk file and the x86_x64 mk file were broken after the copy paste. The commit you linked was missing by the time I realized there was an issue so I couldn't go look at it to expand to the whole file. There was a missing endif in the file somewhere but I didn't know where it was in the original file. What I did to fix that was to copy paste the entire file from the sabermod repo. That stopped those errors. I have added the folder that contains these files to $PATH using an export but that didn't fix it either. I then started pulling some of the files and copying them into /usr/include, but after doing that for about 60 files I'm not much further through the compile. I can hard reset my repo and rebuild my custom device tree and other changes, but I'd like to get this working :). Sorry I'm new to building Android and I'm trying to learn my way through everything.
[Android Software/Hacking General [Developers Only]] sparksco:
Oh yeah I just remembered you need to clone this repo also.

https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/

It's a updated host toolchain from Google.
[Android Software/Hacking General [Developers Only]] PWn3R:
Sparksco - thanks for the information, this is what i'm getting now - I removed ccache and did a make clean.

/usr/include/regex.h:24:31: fatal error: gnu/option-groups.h: No such file or directory

#include <gnu/option-groups.h>
[Android Software/Hacking General [Developers Only]] fergy:
As from above, You was copy sources from other location and try to build?

From other hand, can You please include complete logcat as I assume that You have some other problems on begin of this log.... Java in wrong version...maybe? Attach complete log.
[Android Software/Hacking General [Developers Only]] JustArchi:
This is interesting. This is one of the things I've noted as well but only some users have such problem (I don't, apparently) and I was pretty sure that it's googleapp-specific problem. Because I couldn't find anything similar in any other app.
[Android Software/Hacking General [Developers Only]] UtkarshGupta:
But what makes it unique to some devices ?

Maybe just like the chrome bug.

This info belongs to op.
[Android Software/Hacking General [Developers Only]] sidneyk:
Exactly what I'm seeing. After I booted up, I was able to move through the Omni settings so quick and set everything like I normally would before doing anything else. I wonder if it may be the High end graphics switch in the performance settings that's causing it? It didn't before, but who knows. Will check it out later when I get home.
[Android Software/Hacking General [Developers Only]] JustArchi:
I'm not sure, we would have to revert all flags one by one to find which one is faulty.

Interesting fact is that this problem exists only in google play store (afaik) and only in new 4.8 one, otherwise I'd already notice this and revert flags months ago when I was implementing them.

Perhaps this is really some old rare bug in the store and not the flags? I don't know.
[Android Software/Hacking General [Developers Only]] JustArchi:
Old inverted 4.6.X playstore, no issues whatsoever on latest ArchiDroid with all flags included.
[Android Software/Hacking General [Developers Only]] JustArchi:
What you have in build/core/base_rules.mk:134?
[Android Software/Hacking General [Developers Only]] fergy:
Hmm, maybe not so problematic, but did You remove things what need to be removed before clean build?

build/libs/host -> android/build/libs/host

build/libs/host: MODULE.HOST.STATIC_LIBRARIES.libhost already defined by android/build/libs/host

Did You make remove out folder before new build (rm -rf out from build folder terminal) ??

So:

---------- Post added at 12:21 AM ---------- Previous post was at 12:03 AM ----------

To correct Myself, no, You have an extra folder inside build enviroment, so that is a reason of Your error.

Probably (but not sure) when You was patch that, there are wrong path...

Path is android/SOMETHING and You don't have shooting path, so, take a look into Your build directory and remove everything under 'android' folder included folder itself. That is problem... You need to give correct path to Your working directory, and in Your case, remove that 'android' from path:

NOT:

<project path="android/frameworks/rs" name="justarchi/android_frameworks_rs" remote="github" revision="android-4.4" />

CORRECT:

<project path="frameworks/rs" name="justarchi/android_frameworks_rs" remote="github" revision="android-4.4" />

and so on, on all paths.
[Android Software/Hacking General [Developers Only]] Codename13:
Do different toolchain versions work with all custom ROMs? For instance, could I use a 4.9 toolchain to compile my ROM when I normally use 4.7/4.8?

Oops, turns out my low benchmark scores were being caused by a bad CPU governor that I had set as default. For some reason, SavagedZen was causing some performance issues on my device. I changed the governor to LulzActive and my AnTuTu scores are back up to around 4800. Wouldn't changing the -O3 flags to -Os cause the ArchiDroid optimizations to be somewhat useless? Is the -O3 flag not one of the main parts of this mod? Also, would anyone happen to know if there is such thing as -O4 flags and if Android can support it?
[Android Software/Hacking General [Developers Only]] fergy:
The compiler may accept CFLAGS like -O4, but it actually doesn't do anything with them. It only performs the optimizations for -O3, nothing more.

For -Os, well this is a good question... But it will activate all -O2 options... like -O3 but will disable some others (few are for x86 only) like

align-functions
align-jumps
align-loops
align-labels
reorder-blocks
reorder-blocks-and-partition
prefetch-loop-arrays

I agree that it optimize for size but in other hand, You loose improve of code locality.
[Android Software/Hacking General [Developers Only]] metalspring:
You might lose some optimization, but many times, smaller binaries simply run faster than big ones even if they are highly optimized, especially on older devices

Also there is a legitimate -O4 option but its for llvm/clang and is basically clangs version of -O3 plus link time optimization (-flto)

Speaking of which [MENTION=5161352]JustArchi[/MENTION] have you ever tried changing the optimizations for clang before? It doesnt accept many of the same cflags as gcc does, but there are a few useful ones that should work (i.e. -O3 or -O4 and -fstrict-aliasing).

See what I mean in the llvm_config.mk I have in this commit (ignore the CLANG_CONFIG_UNKNOWN_CFLAGS part of it since that is more for getting Link time opt to work for gcc)-

https://github.com/metalspring/android_build/commit/86536e2f19daf7624042e59dd20a20d1fbb0d8e1

Also, see this-

http://vaniraosp.goo.im/#/c/9197/
[Android Software/Hacking General [Developers Only]] fergy:
thank You. No, I wasn't try llvm. Usually I use -O2 but that's nice idea for testing.
[Android Software/Hacking General [Developers Only]] McDope:
I'm trying to compile PACman for yuga with this changes, but always fail with an undefined reference...

target SharedLib: hwcomposer.msm8960 (/home/mcdope/android/pacman/out/target/product/yuga/obj/SHARED_LIBRARIES/hwcomposer.msm8960_intermediates/LINKED/hwcomposer.msm8960.so)
/home/mcdope/android/pacman/out/target/product/yuga/obj/SHARED_LIBRARIES/hwcomposer.msm8960_intermediates/hwc_fbupdate.o:hwc_fbupdate.cpp:function qhwc::FBUpdateLowRes::preRotateExtDisplay(hwc_context_t*, hwc_layer_1*, overlay::utils::Whf&, hwc_rect&, overlay::utils::eMdpFlags&, int&): error: undefined reference to 'qhwc::configRotator(overlay::Rotator*, overlay::utils::Whf&, overlay::utils::Whf const&, overlay::utils::eMdpFlags const&, overlay::utils::eTransform const&, int const&)'
/home/mcdope/android/pacman/out/target/product/yuga/obj/SHARED_LIBRARIES/hwcomposer.msm8960_intermediates/hwc_fbupdate.o:hwc_fbupdate.cpp:function qhwc::FBUpdateLowRes::preRotateExtDisplay(hwc_context_t*, hwc_layer_1*, overlay::utils::Whf&, hwc_rect&, overlay::utils::eMdpFlags&, int&): error: undefined reference to 'qhwc::updateSource(overlay::utils::eTransform&, overlay::utils::Whf&, hwc_rect&)'
/home/mcdope/android/pacman/out/target/product/yuga/obj/SHARED_LIBRARIES/hwcomposer.msm8960_intermediates/hwc_fbupdate.o:hwc_fbupdate.cpp:function qhwc::FBUpdateLowRes::configure(hwc_context_t*, hwc_display_contents_1*, int): error: undefined reference to 'qhwc::configMdp(overlay::eek:verlay*, overlay::utils::PipeArgs const&, overlay::utils::eTransform const&, hwc_rect const&, hwc_rect const&, MetaData_t const*, overlay::utils::eDest const&)'
collect2: error: ld returned 1 exit status

Any ideas somebody?
[Android Software/Hacking General [Developers Only]] kantjer:
I'm having the same error
[Android Software/Hacking General [Developers Only]] fergy:
warning: unknown warning option '-Wstrict-aliasing=3'; did you mean '-Wstring-plus-int'? [-Wunknown-warning-option]
warning: unknown warning option '-Werror=unused-but-set-variable'; did you mean '-Werror=unused-variable'? [-Wunknown-warning-option]
warning: unknown warning option '-Werror=maybe-uninitialized'; did you mean '-Werror=uninitialized'? [-Wunknown-warning-option]
warning: unknown warning option '-Wstrict-aliasing=3'; did you mean '-Wstring-plus-int'? [-Wunknown-warning-option]
warning: unknown warning option '-Werror=unused-but-set-variable'; did you mean '-Werror=unused-variable'? [-Wunknown-warning-option]
warning: unknown warning option '-Werror=maybe-uninitialized'; did you mean '-Werror=uninitialized'? [-Wunknown-warning-option]
warning: unknown warning option '-Wstrict-aliasing=3'; did you mean '-Wstring-plus-int'? [-Wunknown-warning-option]
warning: unknown warning option '-Werror=unused-but-set-variable'; did you mean '-Werror=unused-variable'? [-Wunknown-warning-option]
warning: unknown warning option '-Werror=maybe-uninitialized'; did you mean '-Werror=uninitialized'? [-Wunknown-warning-option]

CM11

lol
[Android Software/Hacking General [Developers Only]] dbolivar:
Hardcoded flags and other optimization flags

Wow this is HUGE, thanks [MENTION=5161352]JustArchi[/MENTION] ! I've also been doing a similar research for my custom firmware builds, but my "solution" was not as elegant as yours, nor I came that deep in comparing optimization flags etc.

One thing I noticed, though, is that some *.mk and Makefiles have hardcoded flags, especially -O level and -g (debug symbols), i.e. they don't take these values from core/combo/TARGET_linux-arm.mk, build/core/combo/arch/arm/armv7-a-neon.mk or whatever. Therefore, I've been doing a "hammer" approach, running a find & replace in all these files:

for i in `find . -type f -name "*.mk" -o -name "Makefile"`; do cp $i $i.bak; done
for i in `find . -type f -name "*.mk" -o -name "Makefile"`; do sed -i 's/-g //g' $i; done
for i in `find . -type f -name "*.mk" -o -name "Makefile"`; do sed -i 's/-O2 /-O3 /g' $i; done
for i in `find . -type f -name "*.mk" -o -name "Makefile"`; do sed -i 's/-Os /-O3 /g' $i; done

(These changes may be undesireable for the kernel's Makefile, so we should restore the original file.)

If you just run the finds replacing sed for grep, you will notice how many files have these flags hardcoded.

Another optimization I've been doing, is changing build/core/combo/arch/arm/armv7-a-neon.mk and customizing arch_variant_cflags. Note that it is hardware-dependent, I tuned them for my hardware.

Add the following line after the last arch_variant_cflags in build/core/combo/arch/arm/armv7-a-neon.mk:

arch_variant_cflags := -march=armv7-a -mtune=cortex-a15 -mfpu=neon-vfpv4 -mfloat-abi=softfp -Wno-sign-compare -Wno-unused-parameter

Hope it helps optimize things even more!
[Android Software/Hacking General [Developers Only]] metalspring:
Changing all the makefiles cflags to match what is in TARGET_linux-arm.mk and select.mk would be a very bad idea. There are many parts of code that require certain cflags to function properly, and many parts of code may react very differently to those cflags. You'll most likely end up with a completely broken, slow build.

As for these, they should already be set and really apply more to kernel code than anything

march=armv7-a -mtune=cortex-a15 -mfpu=neon-vfpv4 -mfloat-abi=softfp

Fyi, you missed -mcpu=cortex-a15 :p

Not that it makes a big difference though
[Android Software/Hacking General [Developers Only]] dbolivar:
That's not right, I've been building several firmwares using this approach with ZERO issues. It's nothing radical that's being changed: just a higher optimization level and disabling debug symbols. If you are not comfortable with -O3, just use -O2. How could it possibly go wrong?

Where they should already be set? They are not, the arch variant cflags by default is set to much more conservative values.

-march=armv7-a is incompatible with -mcpu=cortex-a15 (try it and you'll see the compiler scream). Use one or another, however removing -march breaks the build. Therefore, the best approach is to keep it, but add the -mtune and -mfpu to hint the compiler about the possible hardware dependent optimizations it can do.
[Android Software/Hacking General [Developers Only]] fergy:
Off topic... How to set art compiler as default (as we talking about compiler) ?
[Android Software/Hacking General [Developers Only]] sparksco:
Looks like a problem with you build environment...
[Android Software/Hacking General [Developers Only]] Crostantin:
thank you so much!!!!! Finally is compiling !!!!

I am using the xenon commits, seems very close to your previous change for LS...exept for the enabling opt on vendor

btw, big thanks for your work!!!!
[Android Software/Hacking General [Developers Only]] NOTilyass:
best build with these optimizations for nexus 5 please ??
[Android Software/Hacking General [Developers Only]] jgcaap:
I'm going to give this a try soon. :) thanks
[Android Software/Hacking General [Developers Only]] sparksco:
It's not there anymore... I moved on from liquid after I realized what a bunch of children all the devs of that team are. Tried to help them a lot but instead was flamed to hell.

You can search around on SaberMod github I'm sure there's stuff that was ported to other ROMs. And will be added to other ROM forked repos in the future.
[Android Software/Hacking General [Developers Only]] ne0zone75:
For me too sadly, latest Play Store icons are still very weird on SlimKAT built for hammerhead with official Linaro 4.8.3 and your build optimizations applied (never seen it with SaberMod BTW...)

Any idea ?!

Best regards
[Android Software/Hacking General [Developers Only]] judas1977:
I have this error when building kernel. As far as i understand - it's kind of warning treated as error. How to make that build will ignore it?:)

../../../../../../kernel/lge/msm8226/drivers/cpufreq/cpufreq_interactive.c: In function ‘cpufreq_interactive_timer_resched’:
../../../../../../kernel/lge/msm8226/drivers/cpufreq/cpufreq_interactive.c:157:3: error: implicit declaration of function ‘get_cpu_idle_time’ [-Werror=implicit-function-declaration]
get_cpu_idle_time(smp_processor_id(),
^
cc1: some warnings being treated as errors

EDIT: ok, i'm stupid. I put wrong flag to ignore that error...

OK, now it says that's forbidden warning;). any solution for that bug?
[Android Software/Hacking General [Developers Only]] Madridii:
Hi,

Can we use this on cm-10.1? if yes, how?

thank you in advance
[Android Software/Hacking General [Developers Only]] sparksco:
I'd say no. These commits were used and tested on gcc 4.7 (cm-11), and cm-10.1 uses gcc 4.6. So a lot of the flags would be different. It's worth a shot though..
[Android Software/Hacking General [Developers Only]] desalesouche:
hi sir . may i request some help about these errors coming from Blisspop? it seems that rom use some of your commit.

for the moment libwebchromiuim can't be builded . device control is fcing, and idk what is wrong but they are using cm12 bootanimation.

i think problem with libwebchromium is related to may be bad symlink?

http://pastebin.com/LtTqteDK

thank you sir
[Android Software/Hacking General [Developers Only]] Khaon:
[MENTION=2394329]sparksco[/MENTION]

Maybe you could point me out to report this issue or at best help me out.

here is my problem:

I am using a rom build very close to sabermod's projects.

This is my repo https://github.com/Khaon/android_build/commits/cm-12.0

I am using O3, graphite and gcconly. I had to add like 50++ modules to your graphite list as I guess there are more modules here.

I would like to know which part of the code yields this bug.

If there is a better place/topic to disscuss such things would be nice to show me :D
[Android Software/Hacking General [Developers Only]] sgspluss:
If i try to get the 4.8 linaro toolchain which are quoted in OP, then i got following error

Also the same error got if i try to get the 4.9 linaro toolchain.

If i try it with google toolchain there arent be any problems at all...

Maybe anyone has an idea how can i get the linaro toolchain?
[Android Software/Hacking General [Developers Only]] wulsic:
I guess the reason is that archidroid doesnt have a repository anymore named linaro.

A fast peek in his github made me find this:

https://github.com/ArchiDroid/Toolchain?files=1

Just try to change linaro to Toolchain and you should be fine I suppose. I see you have secret plans :)

Verstuurd vanaf mijn LG-D802 met Tapatalk
[Android Software/Hacking General [Developers Only]] desalesouche:
SaberSunset Project

Hi all, compiling SaberSunset Project that i find quite interesting, for my device huawei u8860 (msm7x30) lead me to those errors.

http://pastebin.com/DjpD0FMJ

{standard input}: Warning: end of file not at end of a line; newline inserted

{standard input}:223: Error: ']' expected -- `ldr r9,[r0'

{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive

arm-linux-androideabi-gcc: internal compiler error: Killed (program cc1)

0x40be14 execute

../.././../gcc/gcc-SaberMod/gcc/gcc.c:2823

if anyone know the fix?

https://github.com/SaberSunset/manifest

thanks all
[Android Software/Hacking General [Developers Only]] sparksco:
I've heard of people using prebuilt chromium, but I've never had any issues with the source I'm using from SaberMod GitHub... so I don't really know what the prebuilt thing is all about.

Your source isn't even close to the same as what's on SaberMod GitHub. Maybe link to the repos on SaberMod you think yours resemble.
[Android Software/Hacking General [Developers Only]] sparksco:
You'll have to ask the project maintainer for SaberSunset
[Android Software/Hacking General [Developers Only]] jgcaap:
i'm new on building rom world... but i managed to get a machine up and running. Anyone is able to assist me on how merging CM12 work with Just archi commits? thanks
[Android Software/Hacking General [Developers Only]] desalesouche:
it seems it was an error with toolchains. dev changed them and now error is gone.

will you create your own rom one of these day?
[Android Software/Hacking General [Developers Only]] sparksco:
Nope, don't have time for all that. Anyways I looked at the github and he's not using changes from sabermod.
[Android Software/Hacking General [Developers Only]] jgcaap:
Anyone can help me on building a archi build? I feel kind of lost... And can't find the answer on the Internet...
[Android Software/Hacking General [Developers Only]] sgspluss:
Got weird graphical glitches on playstore while using linaro 4.8 from ArchiDroid/Toolchain.

Try it with and without the patch from OP.

With linaro 4.9 from ArchiDroid/Toolchain and the patch from OP is all fine no glitches.

Maybe anyone knows whats the problem with linaro 4.8?
[Android Software/Hacking General [Developers Only]] jgcaap:
While trying to find answers for my questions I was able to read on the first pages that was a problem with linaro. Have you tried another version of linaro?
[Android Software/Hacking General [Developers Only]] sgspluss:
The answer you can find in my post above.

But here again, yes try linaro 4.9 WITH patch from OP and works without glitches.

Just linaro 4.8 makes trouble with and without the patch.
[Android Software/Hacking General [Developers Only]] WhiteNeo:
You're talking about the arm-linux-androideabi toolchain, right? It's it that simple to compile the whole ROM with Linaro 4.9? :o
[Android Software/Hacking General [Developers Only]] jgcaap:
after understanding what to do, i had my first build error ! xD

target thumb C: libc_aeabi <= bionic/libc/arch-arm/bionic/__aeabi.c

clang: error: unknown argument: '-funsafe-loop-optimizations'

clang: error: unknown argument: '-ftree-loop-im'

clang: error: unknown argument: '-ftree-loop-ivcanon'

clang: error: unknown argument: '-fgcse-sm'

clang: error: unknown argument: '-fgcse-las'

clang: error: unknown argument: '-fweb'

clang: error: unknown argument: '-funsafe-loop-optimizations'

clang: error: unknown argument: '-fsection-anchors'

clang: error: unknown argument: '-ftree-loop-im'

clang: error: unknown argument: '-ftree-loop-ivcanon'

clang: error: unknown argument: '-fgcse-sm'

clang: error: unknown argument: '-fgcse-las'

clang: error: unknown argument: '-fweb'

clang: error: unknown argument: '-funsafe-loop-optimizations'

clang: error: unknown argument: '-fsection-anchors'

clang: error: unknown argument: '-ftree-loop-im'

clang: error: unknown argument: '-ftree-loop-ivcanon'

clang: error: unknown argument: '-fgcse-sm'

clang: error: unknown argument: '-fgcse-las'

clang: error: unknown argument: '-fweb'

target asm: libc_bionic <= bionic/libc/arch-arm/bionic/abort_arm.S

build/core/binary.mk:697: recipe for target '/home/jgcaap/cm/out/target/product/bacon/obj/STATIC_LIBRARIES/libcompiler_rt-extras_intermediates/lib/builtins/mulodi4.o' failed

make: *** [/home/jgcaap/cm/out/target/product/bacon/obj/STATIC_LIBRARIES/libcompiler_rt-extras_intermediates/lib/builtins/mulodi4.o] Error 1

Anyone have idea whats about? Thanks!
[Android Software/Hacking General [Developers Only]] m0d:
This looks useful,

If I am not mistaken it needs to be placed at 'vendor/*/prebuilt/common/etc/init.d' ?

I tried to use the script to log to sdcard, but so far have been unsuccessful: I changed 'logcat > /data/logcat.txt &' to 'logcat > /storage/sdcard1/logcat.txt &

Any ideas how to get it to log to sdcard, as I am trying to debug kernel that bootloops or does not boot to bootanimation and therfore need the external sd card to see the logs.

Is there any other way?

I also tried to add the following to init.qcom.rc, but it did not write to sdcard either:

on post-fs
# Test persistentLogging
mkdir /storage/sdcard1/logs 0775 system log
start persistentLogging

And below with the rest of defined services:

# Test persistentLogging
service persistentLogging /system/bin/logcat -r 1024 -n 9 -v threadTime -f /storage/sdcard1/logs/log
user system
group system log
disabled
[Android Software/Hacking General [Developers Only]] JustArchi:
Logcat is for debugging Android and why it's not booting. You can't debug kernel without some kind of UART.
[Android Software/Hacking General [Developers Only]] jgcaap:
Any chance you know what that error is about? Thanks..
[Android Software/Hacking General [Developers Only]] JustArchi:
Yes, I'm a magician with a crystal ball.
[Android Software/Hacking General [Developers Only]] jgcaap:
You could have given a more polite answer, even so thanks...
[Android Software/Hacking General [Developers Only]] JustArchi:
Not sure what you mean, my magical crystal ball tells me that you have memset issues which are fixable in the OP.
[Android Software/Hacking General [Developers Only]] jgcaap:
I did exactly as on the op. I'll try see this again on weekend.

Thanks