yashsingh1/xdaforums huggingface dataset:
[Nexus 7 Android Development] sparksco:
Yeah I just like to keep my CPU's evenly distributed at all times. You could use them all and set your core usage to 50% and it would do the same thing, might even run better that way ;)

You can also change the percentage on-the-fly...
[Nexus 7 Android Development] yogi2010:
I have to leave my Acer alone and take a 6-7 hour nap to let it do a build, haha. With single-core and just 2 GB RAM, I'm blown away that it even does it, and doesn't take ALL day.... just half of it, haha. It works out tho to set it going right before going to bed.

I had no idea about building Android when I bought the PC, but I started learning about rooting, etc. and eventually found guides by you guys here at XDA. What a great site, I've learned SO much on it, thanks to all of you devs. and guide-writers!
[Nexus 7 Android Development] .torrented:
VMware Player only lets me use 4 at most :/ or I would
[Nexus 7 Android Development] azoller1:
Anyone know how to edit an image on virtual box to have more storage space? Cause I downloaded a pre made image from virtual box with Ubuntu but it only has 18gb of virtual memory anyone know how to increase it? Sorry for off topic...
[Nexus 7 Android Development] #define:
Hey guys, whats the difference between the main source folder, and the .repo folder inside it?? Both have different sizes.. For eg, my CM10 folder shows 5.7 gb(clean, no builds) and the .repo folder inside it is 11.9 gb large.. so does it download 11.9 gb, 5.7 gb or 17.6 gb??
[Nexus 7 Android Development] sparksco:
It only downloads .repo, the rest is your work tree source from .repo
[Nexus 7 Android Development] #define:
Ok.. so the .repo is downloaded, ie, 11.9 gb, and the 5.7 is the source we work on, basically "pulled" from the .repo folder in the main working directory, right??
[Nexus 7 Android Development] sparksco:
I don't understand what all the confusion is about for the source sizes. When you think about it it's not really very confusing at all...
[Nexus 7 Android Development] #define:
Actually some people over at my current device forum are saying that only the source is downloaded.. The .repo folder just emerges out of thin air.. And I'm still a bit new.. I'm trying to clear the confusion they have and are giving me.. :D
[Nexus 7 Android Development] sparksco:
You should watch what it's doing when you download the source and when it syncs the work tree. It's not rocket science. The .repo folder is always there as soon as you repo init. When you sync the first time the size of it will keep growing. Then when it syncs the work tree all the other folders/files will appear.
[Nexus 7 Android Development] Mac of York:
Failed to attach the USB device Asus Nexus 7 [9999] to the virtual machine Ubuntu.

USB device 'Asus Nexus 7' with UUID {a261bc89-83bc-4a79-bba7-a6d55ae3e21b} is busy with a previous request. Please try again later.

Result Code:

E_INVALIDARG (0x80070057)

Component:

HostUSBDevice

Interface:

IHostUSBDevice {173b4b44-d268-4334-a00d-b6521c9a740a}

Callee:

IConsole {db7ab4ca-2a3f-4183-9243-c1208da92392}

---

I am trying to attach my Nexus 7 to my Ubuntu 12.04 and I get this error. On my Laptop, I have 3 USB 2.0 ports and 1 USB 3.0 port. Could it be possible that this won't work in the 3.0 port? I'm not at my laptop right now (controlling it remotely with the N7 plugged in), so I can't check easily.

Anyone ran into this? Can't pull the proprietary files just yet due to this error.

EDIT: Solution -- used another port. Not compatible with a USB 3.0 port.
[Nexus 7 Android Development] eug89:
Do you know if there's a guide somewhere regarding building cm with gcc 4.7? Do I need to modify manifest.xml in order to download gcc 4.7 instead of the 4.6?

Thanks:p
[Nexus 7 Android Development] sparksco:
It's not supported by cm or aosp so I doubt you'll find any guides. Search Google maybe!?!? I think they just expect you to figure it out all on your own...
[Nexus 7 Android Development] eug89:
googled but couldn't find anything useful yet.
[Nexus 7 Android Development] sparksco:
Might be better off just using stock toolchain :D
[Nexus 7 Android Development] Mac of York:
Can anyone help me please? My build went on for a good while and then it stopped and I received this error.

host Java: dumpkey (/home/nick/android/system/out/host/common/obj/JAVA_LIBRARIES/dumpkey_intermediates/classes)

/bin/bash: jar: command not found

make: *** [/home/nick/android/system/out/host/common/obj/JAVA_LIBRARIES/dumpkey_intermediates/javalib.jar] Error 127

Not sure what to do at this point. :\

EDIT: Possible solution -- http://www.linuxquestions.org/questions/programming-9/why-is-jar-command-not-found-337630/

Did this, building now.
[Nexus 7 Android Development] eug89:
I've probably figured it out, just started to compile... let's see. If everything goes fine I should also see in the kernel info (with an app like cpuspy) that it's been compiled with gcc 4.7 right?
[Nexus 7 Android Development] sparksco:
What's your java version? Open jdk or sun java oracle? Your having a java error.
[Nexus 7 Android Development] Mac of York:
sun java sdk 6_0_34

I think I fixed it, trying to build now.

Edit: I fixed it, but now got another java error so I am building again. I'll keep fixing each java error (separate file this time) until I get this build! LOL
[Nexus 7 Android Development] sparksco:
You shouldn't have to fix each file for java unless you writing you own code changes and there's a issue with the code.
[Nexus 7 Android Development] azoller1:
Dang so this doesn't work on 32 bit, just wasted my time there
[Nexus 7 Android Development] Mac of York:
Got my first build!

Package complete: /home/nick/android/system/out/target/product/grouper/cm-10.1-20121231-UNOFFICIAL-grouper.zip

md5: b543b0a434c0b56d3f69846381733205

Woot :D So excited to flash this.
[Nexus 7 Android Development] fattire:
Congrats! hope it worked out...
[Nexus 7 Android Development] eug89:
I managed to compile using google's 4.7 toolchain, way easier than I thought:)
[Nexus 7 Android Development] Mac of York:
It works great, thanks for the awesome guide!
[Nexus 7 Android Development] sparksco:
Are you sure it's using it? You changed all the files in build?
[Nexus 7 Android Development] eug89:
This is what I did:

Downloaded google's 4.7 gcc from https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/ and https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/ cloning those git repositories in prebuilts/gcc/linux-x86/arm/

Then I modified build/envsetup.sh

arm) toolchaindir=arm/arm-linux-androideabi-4.6/bin

to

arm) toolchaindir=arm/arm-linux-androideabi-4.7/bin

and

unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/arm-eabi-4.6/bin

to

unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/arm-eabi-4.7/bin

With these changes it compiled without errors.

I'm sure the kernel was built with gcc 4.7, i checked in kernel info with cpuspy. I assume everything else was built with 4.7 too, is there a way to be sure?

Then I also tried using linaro's toolchain. I followed the same steps and kernel compilation failed, fixed it and now this is what I see in kernel info:

Was there something else that I needed to modify in build directory?
[Nexus 7 Android Development] apascual89:
Fixed the linaro kernel compilation how?
[Nexus 7 Android Development] sparksco:
Can't see your screenshot it's too blurry... So your using Google's ore linaro's? I prefer Google's, any benefits to using linaro's over Google's? They both use GCC 4.7...
[Nexus 7 Android Development] eug89:
I was getting this kind of errors:

/home/eug89/android/system/prebuilts/gcc/linux-x86/arm/android-toolchain-eabi-linaro/bin/arm-eabi-ld: error: arch/arm/boot/compressed/piggy.gzip.o: unknown CPU architecture
/home/eug89/android/system/prebuilts/gcc/linux-x86/arm/android-toolchain-eabi-linaro/bin/arm-eabi-ld: error: arch/arm/boot/compressed/lib1funcs.o: unknown CPU architecture

I fixed them looking at this commit for the galaxy nexus's kernel https://github.com/CyanogenMod/andr...mmit/ec1ac589d49081286164246fbaaba0012ae7ecac

I just modified arch/arm/boot/compressed/Makefile in the grouper kernel directory according to that

I first compiled with google's then I wanted to try linaro's. Honestly I can't feel substantial differences, any performance improvement could just be placebo.

For the screenshot try this link http://postimage.org/image/x1gyl4359/
[Nexus 7 Android Development] sparksco:
Ah yeah looks good I just hate seeing that "dirty" in the kernel version. Other than that looks great. I'm guessing eventually Google will add their own fix to the kernel to build with GCC 4.7
[Nexus 7 Android Development] eug89:
I forgot to commit the change before compiling... that's why the "dirty", right?

CM's kernel compiles fine with google's 4.7, it needs that patch only for linaro.
[Nexus 7 Android Development] Mac of York:
I hope it's not too much to ask, but can anyone please link me to a guide to start fiddling with things like adding/removing apps from this? Thank you!

PS: I did try to search and was having a hard time finding the right keywords to use...
[Nexus 7 Android Development] fattire:
Now that the official CM wiki is out, I'm suggesting people switch from my Google doc to the new version here.
[Nexus 7 Android Development] apascual89:
A good place to start is this post by our very own fattire :D

http://xdaforums.com/showthread.php?p=30802167#post30802167
[Nexus 7 Android Development] fattire:
I actually put this on the wiki as well... so anyone can build off it.
[Nexus 7 Android Development] sparksco:
Can you also put here on this thread and the cm wiki that it's only 64bit machines? Seems some people were confused about that.
[Nexus 7 Android Development] fattire:
You mean for ubuntu? Can you not build with 32? i don't even know I haven't tried :P
[Nexus 7 Android Development] sparksco:
No you can't that's the point :)

Google has it right on their website.

"For Gingerbread (2.3.x) and newer versions, including the master branch, a 64-bit environment is required. Older versions can be compiled on 32-bit systems."

:beer:
[Nexus 7 Android Development] fattire:
Okay it's added... thx.
[Nexus 7 Android Development] apascual89:
I built successfully using google's 4.7 toolchain. I used the tips from this post: http://xdaforums.com/showpost.php?p=36142136&postcount=663

I'm trying to build for my nexus 4 (mako) and the build keeps failing when building the kernel. If anyone wants to take a look, please let me know if you have any ideas.

http://pastebin.com/aV1fSdUN

Thanks
[Nexus 7 Android Development] sparksco:
Interesting thing I can't even find mako kernel on cm's github...

Is in-line kernel building officially supported for mako?
[Nexus 7 Android Development] apascual89:
Yes it is. https://github.com/CyanogenMod/lge-kernel-mako

For some reason sometimes it comes up using search on their giuthub and sometimes not.
[Nexus 7 Android Development] sparksco:
The repo was named different then I thought x)

Try:

sudo apt-get install gcc-4.7 g++-4.7

Then before building enter:

export CC=gcc-4.7
export CXX=g++-4.7

If that doesn't work you'll probably have to disable cifs. They pushed 20 new changes 3 hours ago and they might have broke something.
[Nexus 7 Android Development] apascual89:
OK thanks, just in case, if you don't mind. How would I disable cifs?
[Nexus 7 Android Development] sparksco:
Well I looked and it seems cifs has been enabled all along so is nothing cm changed. I think you can disable it by

export CONFIG_CIFS=n but not sure if that'll work or not.
[Nexus 7 Android Development] Mac of York:
I really apologize for asking another (perhaps stupid) question, but I can't for the life of me get my building to use ccache. I set it up as per instructions on http://source.android.com/source/building.html :

$ export USE_CCACHE=1
$ export CCACHE_DIR=/<path_of_your_choice>/.ccache
$ prebuilts/misc/linux-x86/ccache/ccache -M 50G

But my builds never speed up. Did I miss something completely obvious? Thanks!

EDIT: D'oh, added the first two lines to my .bashrc file. Trying it out now... lol.
[Nexus 7 Android Development] sparksco:
Why would you want ccache global in .bashrc?
[Nexus 7 Android Development] Mac of York:
That's the only way to get it to work, right? Otherwise... what would I do? :/ I wasn't getting hits before I did this.

EDIT: Tells me to do so here:

http://xda-university.com/as-a-developer/getting-started-building-android-from-source
[Nexus 7 Android Development] sparksco:
Getting hits? Entering it in terminal before building should do the same thing. Your having you PC use ccache all the time now not just when building android.
[Nexus 7 Android Development] Mac of York:
Alright, I'll give that a try, thanks. I entered these before brunch grouper and it seems to be working-- thanks.
[Nexus 7 Android Development] eug89:
@sparksco

Looking a bit what's inside the build folder I found the TARGET_linux-arm.mk file in /android/system/build/core/combo.

Inside this file, among other things, I don't understand what these lines exactly do:

# You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else
ifeq ($(strip $(TARGET_TOOLS_PREFIX)),)
TARGET_TOOLCHAIN_ROOT := prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-4.6
TARGET_TOOLS_PREFIX := $(TARGET_TOOLCHAIN_ROOT)/bin/arm-linux-androideabi-
endif

Do I need to change the path for the 4.7 compiler also in this file?

I would also like to try building with -O3 optimizations. I found this commit in your github repo https://github.com/pbeeler/android_build/commit/f89bcfb8e5b1b4e8320d0a3e2d89b668b1988596

Now I'm trying to build it with those changes but I suppose there's something else I need to patch in order to compile with -O3, right?
[Nexus 7 Android Development] sparksco:
Yes there's other things like compiler flags for dalvik-cache that you need to change that is in this commit for the 4.7 toolchain.

https://github.com/pbeeler/android_build/commit/0a4dd113d357a1ca387f215d9235c5b3ead851a6

I used linaro's patches to enable -O3 compiler flags, but I'm also using strict-aliasing. The strict-aliasing is enabled by default but it can be disabled with a board config option. But those changes and commits are for my aosp ROM source build so I'm not sure if they'll cherry-pick into cm or not. I did squash the compilers commits into one commit so it should be easier to pick in.
[Nexus 7 Android Development] eug89:
So, from what I understood, changing the compiler path in envsetup.sh it's not enough and changing it in the other files like in your commit is also needed.

Then, in order to build with -O3 optimizations, I would need some other patches from linaro. Searching in your github repos I should find them?
[Nexus 7 Android Development] sparksco:
Yeah. I'm also using the linaro compiler checks even though I'm using Google's toolchain.

https://github.com/pbeeler/android_build/commit/32ab80c10a6f39bf62c680977dfd3aa1d06781d4

https://github.com/pbeeler/android_build/commit/0c65023073d1253f2cf6f53cbd1e1a3784043231

https://github.com/pbeeler/android_build/commit/f89bcfb8e5b1b4e8320d0a3e2d89b668b1988596
[Nexus 7 Android Development] eug89:
Now I'm trying to build with google's 4.7 toolchain again but compilation stops almost immediately and every time with a different error. This time I modified all the needed files in the build folder like in your commit. Even if I try with linaro's now I have the same problem. This is what I did https://github.com/Eug89/android_build/commit/23d7f74f2ef0fbf4c523077ea4f3d1359a8dcd6c

Modifying only envsetup.sh everything goes fine, and at least the kernel gets compiled with gcc 4.7, like i've shown some posts ago in that screenshot.

Ive also found this how-to on xda for building with linaro's toolchain http://xdaforums.com/showthread.php?t=1988315

They only modify envsetup.sh.

What's the difference modifying the toolchain path only in envsetup.sh and also on the other files (TARGET_linux-arm.mk, dumpvar.mk etc)?
[Nexus 7 Android Development] sparksco:
What repos are the errors on? There's only a few patches needed to build with GCC 4.7

On your github it looks fine. It makes sure that that toolchain gets used for everything.
[Nexus 7 Android Development] eug89:
This is how compilation stopped last time I tryed http://pastebin.com/DEu5SJ9g
[Nexus 7 Android Development] sparksco:
system/security is failing with c++11 -Werror (narrowing conversions inside {}). I have all the patches on my github for every possible error. This is a good thing though because now you know it's compiling with the right toolchain for everything.

https://github.com/pbeeler/android_system_security/commit/baaaa740b0230cdb78f1641c27d960051bebf822
[Nexus 7 Android Development] eug89:
Thanks, that fixed that error:) Now I just fixed another error in bionic, let's see what comes next...

EDIT: Compilation stopped again, so I decided to cherry-pick all the linaro patches I find in your repos first...
[Nexus 7 Android Development] CheesyNutz:
having troubles on the

i would assume i would need to use

sudo apt-get install then this line ? i get
[Nexus 7 Android Development] eug89:
Thanks to your help, and all those commits in your github repos, I managed to compile using gcc 4.7 (google's) with -O3 compiler flags, strict aliasing and ISO C++11 mode :good:

Actually it's fun to compile, look what breaks the build, cherry-pick(unfortunately I don't have the knowledge to write code myself), resolve conflicts, etc.

I also tried, with the same configuration, to build using linaro's toolchain but it stops after just 2 minutes with this error:

make: *** No rule to make target "/home/eug89/android/system/out/host/linux-x86/obj/STATIC_LIBRARIES/libbfd_intermediates/export_includes", needed by "/home/eug89/android/system/out/host/linux-x86/obj/EXECUTABLES/opannotate_intermediates/import_includes". Stop.

Do you have any idea?

EDIT: Strangely MX player doesn't work anymore saying that my device is not compatible...

@sparksco, do you know if there's something related to strict aliasing or compiling with -O3 that could have break MX player?
[Nexus 7 Android Development] yogi2010:
Do you guys use the ClockworkMod images that are built with the ROM? I see it's up to version 6.0.2.7, non-touch. Not sure what has changed.
[Nexus 7 Android Development] .torrented:
Nah I have just been using the Official Recovery from the site not the one that gets built...

However...

I need some help troubleshooting an issue im getting when I build... Ive Installed Ubuntu 12.10 and got everything so far set up correctly

I followed the CM wiki wfw and all... I get to the part where I need to ./extract-files.sh and it goes for a few seconds and then starts spitting out File not found about halfway? Could this be an issue with not having java version 6 installed? It's telling me i have Version 7 installed.
[Nexus 7 Android Development] yogi2010:
I'm not sure about the java versions, but did you uninstall anything from /system/lib from the ROM on your device? I used to run into problems building for the G2 when i would remove the wifi calling lib. Other than that i'm not sure what might cause that.
[Nexus 7 Android Development] apascual89:
# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_EABI_TOOLCHAIN=
local ARCH=$(get_build_var TARGET_ARCH)
case $ARCH in
x86) toolchaindir=x86/i686-linux-android-4.6/bin
;;
arm) toolchaindir=arm/arm-linux-androideabi-4.6/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-4.6/bin
;;

Ok, one question on the prebuilts? what are the "x86" and the "mips". Earlier it was referenced to change the path for the arm prebuilts, but nothing was mentioned about these other two, do these not apply?
[Nexus 7 Android Development] sparksco:
I don't think grouper uses those but I added them to my manifest and changed my source to point to the new toolchains just in case.
[Nexus 7 Android Development] .torrented:
No i didn't remove anything i was just going through the steps. I got it to work on 10.04 but i wanted to use 12.10 and I'm so for not having much success
[Nexus 7 Android Development] eug89:
Thanks again sparksco, I've cherry-picked dozens of commit from your repos in order to build cm with gcc-4.7, -O3 and strict aliasing. I've noticed that compiling with C++11 breaks MX player (and probably other apps), in fact you don't use it in your builds.

Like I wrote in my previous post, the only thing I haven't managed to do is building with linaro's toolchain...
[Nexus 7 Android Development] .torrented:
I got my problem fixed... I didnt realize that 1) I had to have my N7 plugged in and 2) I had my DNA plugged (for internet) and it had USB Debugging enabled... haha oops

Does anybody know if this matters?

You are attempting to build with an unsupported version
of java.

Your version is: java version "1.7.0_09".
The correct version is: Java SE 1.6.

Please follow the machine setup instructions at
https://source.android.com/source/download.html
[Nexus 7 Android Development] sparksco:
I don't get this part, how am I not using it in my builds? I think I know what I do/don't do in my builds lol. I haven't noticed any issues with mxplayer. You don't have to keep saying thanks, there's a thanks button for that...
[Nexus 7 Android Development] eug89:
Ok, I'm not going to thank you again:)

For the c++11 thing, if I don't get it wrong, setting

export DEBUG_NO_STDCXX11=yes

disables c++11.

I was looking at this commit https://github.com/pbeeler/android_build/commit/82f30957709cc53e20e2cd2a3435df4871dd5b18

Also, this kind of confirms that c++11 breaks mxplayer https://groups.google.com/forum/?fromgroups=#!topic/mx-videoplayer/YiD3q_jL0u0
[Nexus 7 Android Development] sparksco:
You can figure it out :)

You seem to know all the answers already so IDK why you keep asking me questions about it...

Actually MX player's main module is built with -std=gnu++11 option exception interfacing module to Android's core module.
[Nexus 7 Android Development] eug89:
I only want to learn from someone that knows more than me.

I just wanted to point out that compiling with

$(call cc-option,-std=gnu++11)

breaks mx player

I could probably have missed something though
[Nexus 7 Android Development] sparksco:
I know the commit message says add option to disable, and I'm not the author of it. But if you look at the code it's actually disabling it by default.

ifneq ($(DEBUG_NO_STDCXX11),yes)

TARGET_GLOBAL_CPPFLAGS += $(call cc-option,-std=gnu++11)

endif

DEBUG_NO_STDCXX11=yes

Sets the flag -std=gnu++11
[Nexus 7 Android Development] eug89:
OK, sorry if I'm so stubborn... But with ifneq, if the two arguments are equal then the next line is ignored. I would agree with you if the operator was ifeq. I assume -std=GNU++11 si to enable c++11
[Nexus 7 Android Development] sparksco:
You are right. I just did a build without setting DEBUG_NO_STDCXX11=yes

and nothing seems different at all. Mxplayer still works fine. Probably because aosp already added a bunch of c++11 mode fixes in android 4.2 but only GCC 4.7 supports this feature. If you use GCC 4.6 toolchain you won't be able to use it.
[Nexus 7 Android Development] eug89:
So there's something different in CM or I could have missed a commit, if I compile with c++11 I can't get mxplayer to work
[Nexus 7 Android Development] sparksco:
No clue works fine for me either way...
[Nexus 7 Android Development] eug89:
One last doubt I want to clear, then I'm going to have a break from all of this stuff:

When we build android are we only using the compiler located in the /prebuilts folder or also the compiler installed in the host machine?

I'm asking this because of these lines I see in your build script:

# GCC (You must have GCC 4.7 installed on your linux machine for this to work)

export CC=gcc-4.7;

export CXX=g++-4.7;

I probably still have gcc-4.6 on my Ubuntu installation, could this be a problem when compiling with c++11 standard or what I'm saying is just non-sense?