[GUIDE][ICS] Compile Cyanogenmod 9 on Mac OS X Lion - Android Software Development

There are a lot of toturials for building CM9 on ubuntu or CM7 on Mac but I couldn't find a decent toturial for building CM9 on Mac (specially Lion). Development in AOSP/CM land is rapid and guides frequently need updating. I had to spend a little time to figure everything out and I decided to share it here.
This tutorial is for building CM9 (ICS) for Galaxy Nexus GSM (maguro) on Mac OS X Lion 10.7.3 using Xcode 4.3 and homebrew . You can easily make the instructions work for most other cm9 devices, but I wouldn't know anything about that.
DISCLAIMER: I'm not responsible if you blow yourself up, blah blah blah
However, I've tried to make this as noob friendly as possible because, well I'm a noob myself
Instrunctions:
UPADTE (MAY 29TH) : The Xcode 4.3 default compiler (llvm-gcc) used to be incompatible with CM9. Thanks to jocelyn and topprospect, the LLVM compatibility patches from mainline AOSP are now merged into CM9. Therefore, you can now use Xcode 4.3 and its command line tools without installing another compiler. However, since GCC is still the only officially supported compiler, incompatibilites with llvm-gcc could still be introduced with future updates. Therefore, if your build fails, it might be worth it to try installing and compiling with GCC 4.2. See the Troubleshooting section for more info.
Now that we have Xcode 4.3 and Xcode command line tools (CLT) installed, let's continue.
Open Terminal and run
Code:
java
if you don't have Java, you will get a prompt asking you to download and install Java. Go ahead and install it.
If you don't have adb and fastboot working, download the android-sdk from google (version r18 as of now) and put it in /usr/local/ and rename the folder to "android-sdk".
Install the homebrew package manager
Code:
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
To make sure that homebrew and android-sdk executables are in $PATH:
Code:
touch ~/.bash_profile && echo "PATH=/usr/local/bin:/usr/local/sbin:$PATH:/usr/local/android-sdk/tools:/usr/local/android-sdk/platform-tools" >> ~/.bash_profile
Relaunch Terminal for the change to take effect.
At this point you can run
Code:
brew doctor
to detect any problems there might be (Homebrew may instruct you to use the xcode-select utility to select the xcode installation path). Hopefully, your system is raring to brew
Now we have to install a bunch of packages:
Code:
brew install git coreutils findutils gnu-sed gnupg pngcrush repo
We now need to create a couple of symlinks so that the gnu versions of 'sed' and 'find' are used rather than the osx provided versions :
Code:
ln -s /usr/local/bin/gfind /usr/local/bin/find && ln -s /usr/local/bin/gsed /usr/local/bin/sed && ln -s /usr/local/bin/gstat /usr/local/bin/stat
It's time to create a case sensitive image which will hold our working directory:
Code:
hdiutil create -type SPARSE -fs "Case-sensitive Journaled HFS+" -size 40g -volname "android" -attach ~/Desktop/Android
Now we have a disk image in ~/Desktop/Android. Mount it if it's not mounted already. (Don't be picky about the size, the image will only take as much as space as its contents).
Now we need to create a working directory inside the mounted volume:
Code:
cd /Volumes/android && mkdir cm9 && cd cm9
We can initialize and download the source now:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b ics && repo sync && say 'finished'
Now we need to get the required proprietry files for our device. We can get these from the device itself. Connect your phone (make sure USB Debugging is enabled) and run the following (for maguro):
Code:
cd /Volumes/android/cm9/device/samsung/maguro/ && ./extract-files.sh
[If you see errors in the output from extract-files.sh, see the Troubleshooting section below]
For Google devices,we can also get them directly from google. For maguro, download the 3 files and extract them to /Volumes/android/cm9. Then,
Code:
cd /Volumes/android/cm9
/Volumes/android/cm9/extract-broadcom-maguro.sh
/Volumes/android/cm9/extract-imgtec-maguro.sh
/Volumes/android/cm9/extract-samsung-maguro.sh
We also need the prebuilts (like ROM manager and Term.apk):
Code:
/Volumes/android/cm9/vendor/cm/get-prebuilts
You can optionally tell the build to use the ccache tool. CCache acts as a compiler cache that can be used to speed-up rebuilds :
Code:
export USE_CCACHE=1 && /Volumes/android/cm9/prebuilt/darwin-x86/ccache/ccache -M 20G
Default is 1GB. Anything between 20GB-50GB should be fine.
Before starting the build, we need to workaround an issue with Lion and compiling the QEMU emulator.
[This step doesn't seem to be needed anymore. QEMU is automatically ignored on OS X/Darwin]
If you build now, you're probably gonna get kernel build errors regarding the missing elf.h header (this error might be device specific). Fortunately, we already have this file downloaded, so we only need to copy it to /usr/local/include:
Code:
cp /Volumes/android/cm9/external/elfutils/libelf/elf.h /usr/local/include
FINALLY, we are ready to build:
Code:
cd /Volumes/android/cm9 && source build/envsetup.sh && brunch
Pick your device from the list and enter the number. For maguro, you could use "brunch maguro" instead and skip the menu. Depending on your system, this will take 30min-4hours.
You should now see a beautiful zip file waiting to be flashed:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
​Troubleshooting:
The extract script for maguro seems to be a little outdated, as it doesn't pull the gps proprietary blob. You can either use the google provided scripts, or add koush's git repository for your device to your local_manifest.xml.
As explained above, the CM9 source is currently compatible with llvm-gcc. In the future, if llvm-gcc fails to build correctly, you should try installing and compiling using GCC4.2 (the Xcode 3 compiler). You can install apple-gcc4.2 from homebrew:
Code:
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb
This version of gcc can happily coexist with Xcode 4.x .
So now you have GCC 4.2 installed, but it won't be used unless we update the corresposing environment variables:
Code:
export CC=/usr/local/bin/gcc-4.2 && export CXX=/usr/local/bin/g++-4.2
Notice that using the export command is temporary. If you relaunch Terminal, you will need to set these again. However, this is a good thing, because changing these values permanently (by putting them in ~/.bash_profile) can interfere with other builds.
If you use this method, the build might fail while compiling "external/zlib/x86/adler32.c". It appears that a recent change in zlib has introduced an incompatibility with gcc 4.2. you have to revert the following 2 commits:
Code:
cd external/zlib
git revert dd6786cae3f4493faa6661d5f74db587932f15d7
git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
Alternatively, you can add topprospect's zlib on github (which has those commits reverted) to your local_manifast.xml. Simply run:
Code:
nano /Volumes/android/cm9/.repo/local_manifest.xml
and add the following line
Code:
<project name="dferg/android_external_zlib" path="external/zlib" remote="github" />
If you get a build error, and your error is not covered here, copy the last 20-30 lines of the build output AND the output from the following command into pastebin and post the link. Hopefully me or someone else will help you.
Code:
echo -e "\nENV:\n$(env)\n\nWHICH GCC\n:$(which gcc)\n\nWHICH G++:\n$(which g++)\n\nWHICH CC:\n$(which cc)\n\nWHICH C++:\n$(which c++)\n\nBREW DOCTOR:\n$(brew doctor)\n\nBREW LIST:\n$(brew list)\n\n/USR/BIN:\n$(ls -l /usr/bin | grep gcc)\n\n/USR/LOCAL/BIN:\n$(ls -l /usr/local/bin | grep gcc)\n\n"
​Notes/Extras:
To quickly setup your environment, add an alias like the following to ~/.bash_profile:
Code:
alias cm9env="hdiutil attach PATH-TO-DISK-IMAGE -mountpoint /Volumes/android && cd /Volumes/android/cm9 && source ./build/envsetup.sh && export USE_CCACHE=1"
alias cm9build="cm9env && make clobber && reposync && brunch maguro"
Now you can save time by using "cm9env" to get your environment setup or "cm9build" to compile a clean updated build.
To clear your output directory for a new build, run "make clobber". You probably don't need this if you've only changed a few lines of code.
To cherry pick yet-to-be-merged changes from the gerrit instance:
1. Pick an open commit from CM Gerrit
2. Under list of Patch Sets pick the latest and open cherry-pick tab
3. Check what Git repository the url is pointing e.g. http://review.cyanog...frameworks_base
4. In your CM9 working tree go to the corresponding directory, which in this case is something like ~/your-working-directory/frameworks/base/
5. Now simply paste the whole line seen in CM Gerrit cherry-pick tab e.g. "git fetch http://review.cyanog....rameworks_base refs/changes/00/13100/4 && git cherry-pick FETCH_HEAD"
It should be now included in your next compiled build. When doing repo sync again, cherry picks will be lost.[CREDIT Fihlvein from xda]
Click to expand...
Click to collapse
Enjoy your custom built CM9!

I updated OP with some updated info about Xcode 4.3.

Nice work man. Very helpful.

conantroutman said:
Nice work man. Very helpful.
Click to expand...
Click to collapse
thanks! I'll try to keep this topic updated as issues with mac are introduced/resolved.

Nice write up. Thanks.
Before I start again from scratch I have a question. Does this guide apply to previous versions of mac os x (mine is 10.6.8)? I used the official android initializing build environment page & cm7 wiki page for the instructions to setup my build environment.
Also, any tips to switch from macports to homebrew?
In the past I've had to cherry pick to get my OS X build environment set up for CM9. The compile from source fails because I started with macports instead of homebrew (bad idea). I tried to switch to homebrew without success. Any tips to switch from macports to homebrew?
For the sake of keeping this page on topic a pm response is ok if that is what you prefer.

Hi thanks for this !! Helpful one question what do i change so i can do AOSP instead of cm9??

grad061980 said:
Nice write up. Thanks.
Before I start again from scratch I have a question. Does this guide apply to previous versions of mac os x (mine is 10.6.8)? I used the official android initializing build environment page & cm7 wiki page for the instructions to setup my build environment.
Also, any tips to switch from macports to homebrew?
In the past I've had to cherry pick to get my OS X build environment set up for CM9. The compile from source fails because I started with macports instead of homebrew (bad idea). I tried to switch to homebrew without success. Any tips to switch from macports to homebrew?
For the sake of keeping this page on topic a pm response is ok if that is what you prefer.
Click to expand...
Click to collapse
Yes, this guide should work fine on Snow Leopard. It mostly depends on your Xcode version. If you have Xcode 3, you can skip step 1 entirely, since you already have gcc4.2 as part of Xcode.
If you have access to Xcode 4.2 and above, you will need to install gcc4.2 separately, as explained in the guide.
Now regarding Macports, I strongly suggest that you completely uninstall Macports before installing homebrew. Instructions are here: http://guide.macports.org/chunked/installing.macports.uninstalling.html
WonkyYew said:
Hi thanks for this !! Helpful one question what do i change so i can do AOSP instead of cm9??
Click to expand...
Click to collapse
Full instructions are available on android.com : http://source.android.com/source/initializing.html
If you are using this guide, you need to change the repo initialization command to :
Code:
repo init -u https://android.googlesource.com/platform/manifest
and then do repo sync. You can setup ccache as usual. I don't think AOSP has the "brunch command", so you have to use launch and then make.
Run "lunch" and select an option from the menu. You can find more info about the options here: http://source.android.com/source/building.html. For maguro, you should use "full_maguro-userdebug".
To start the build, use
Code:
make -j$(sysctl -n hw.ncpu)

@ArmanUV. Sounds good & thanks for the input. I'll give the link to macports uninstall a go.

Im a real noob, whats the advantage of compiling from source?

Thanks for the help man !

Hi, thanks for your guide, setting up the repo was no problem at all!
But: I'm getting the following error when building.
Code:
external/zlib/x86/adler32.c: In function ‘adler32_MMX’:
external/zlib/x86/adler32.c:747: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
external/zlib/x86/adler32.c:747: error: ‘asm’ operand has impossible constraints
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libz_intermediates/adler32.o] Error 1
make: *** Waiting for unfinished jobs....
Seems to be a problem with the compiler, but I'm on xcode 4.3 and I've installed gcc-4.2 and set the env vars. Any help?

ArmanUV,
Thanks so much for posting this guide. Very helpful!
Are you having any trouble with errors like this?
Code:
external/zlib/x86/adler32.c: In function ‘adler32_MMX’:
external/zlib/x86/adler32.c:747: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
external/zlib/x86/adler32.c:747: error: ‘asm’ operand has impossible constraints
Googling for this error implies that the fix is to use a version of GCC > 4.2. But there does not seem to be a GCC 4.4 in Homebrew.
Thanks again for the guide!
EDIT: Sorry for the double post with empyyy. Seems like there is someone else having my same issue!

topprospect said:
ArmanUV,
Thanks so much for posting this guide. Very helpful!
Are you having any trouble with errors like this?
Code:
external/zlib/x86/adler32.c: In function ‘adler32_MMX’:
external/zlib/x86/adler32.c:747: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
external/zlib/x86/adler32.c:747: error: ‘asm’ operand has impossible constraints
Googling for this error implies that the fix is to use a version of GCC > 4.2. But there does not seem to be a GCC 4.4 in Homebrew.
Thanks again for the guide!
EDIT: Sorry for the double post with empyyy. Seems like there is someone else having my same issue!
Click to expand...
Click to collapse
empyyy said:
Hi, thanks for your guide, setting up the repo was no problem at all!
But: I'm getting the following error when building.
Code:
external/zlib/x86/adler32.c: In function ‘adler32_MMX’:
external/zlib/x86/adler32.c:747: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
external/zlib/x86/adler32.c:747: error: ‘asm’ operand has impossible constraints
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libz_intermediates/adler32.o] Error 1
make: *** Waiting for unfinished jobs....
Seems to be a problem with the compiler, but I'm on xcode 4.3 and I've installed gcc-4.2 and set the env vars. Any help?
Click to expand...
Click to collapse
You guys seem to have the same issue. What sort of Xcode configuration are you using? Can you post the output from "which gcc","which g++", "gcc -v", "g++ -v" and "cc -v"?

ArmanUV said:
You guys seem to have the same issue. What sort of Xcode configuration are you using? Can you post the output from "which gcc","which g++", "gcc -v", "g++ -v" and "cc -v"?
Click to expand...
Click to collapse
I am on Lion 10.7.4 with Xcode 4.3.2. Here is the output that you asked for:
Code:
# echo -n "which gcc: "; which gcc; echo -n "which g++: "; which g++; echo ""; echo "gcc -v:"; gcc -v; echo ""; echo "g++ -v:"; g++ -v; echo ""; echo "cc -v:"; cc -v
which gcc: /usr/bin/gcc
which g++: /usr/bin/g++
gcc -v:
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
g++ -v:
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
cc -v:
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.3.0
Thread model: posix
They are pointing to LLVM, but my CC and CXX variables point to:
Code:
env|grep 4.2
CXX=/usr/local/bin/g++-4.2
CC=/usr/local/bin/gcc-4.2
Do I need to add something to PATH? I'm sure I just missed something obvious in your instructions.. Thanks for helping!

topprospect said:
I am on Lion 10.7.4 with Xcode 4.3.2. Here is the output that you asked for:
Do I need to add something to PATH? I'm sure I just missed something obvious in your instructions.. Thanks for helping!
Click to expand...
Click to collapse
Everything checks out. I'm away from my main machine so I can't run a test build, but I suspect that a recent change is causing problems.
Now, regarding the compiler, Setting CC/CXX *should* take care of everything, but I am currently not 100% sure that somewhere in a makefile, these environment variables aren't being ignored. Since I wrote the guide, I noticed a lot of clang warnings in the build, which means that CC/CXX is not honored and /usr/bin/cc and /usr/bin/c++ is being used.
A more robust method of making sure gcc-4.2 is being used is creating symlinks to gcc-4.2 and g++-4.2 :
Code:
ln -s /usr/local/bin/gcc-4.2 /usr/local/bin/gcc
ln -s /usr/local/bin/gcc-4.2 /usr/local/bin/cc
ln -s /usr/local/bin/g++-4.2 /usr/local/bin/c++
ln -s /usr/local/bin/g++-4.2 /usr/local/bin/g++
Obviousely, a systemic method like this has its downsides but it may be the only choice without having to change CM code (especially since I lack the knowledge to do so )
[I recently found out that master aosp is no longer using CC/CXX to find the compiler (see ./build/core/combo/). Instead, it uses "gcc" and "g++" directly, which means that llvm-gcc will be used no matter what env variable you have. Fortunately, unlike cm9, master aosp is supposed to build fine with llvm-gcc (except for qemu, which doesn't matter for device images). ]

ArmanUV said:
Everything checks out. I'm away from my main machine so I can't run a test build, but I suspect that a recent change is causing problems.
Now, regarding the compiler, Setting CC/CXX *should* take care of everything, but I am currently not 100% sure that somewhere in a makefile, these environment variables aren't being ignored. Since I wrote the guide, I noticed a lot of clang warnings in the build, which means that CC/CXX is not honored and /usr/bin/cc and /usr/bin/c++ is being used.
A more robust method of making sure gcc-4.2 is being used is creating symlinks to gcc-4.2 and g++-4.2 :
Code:
ln -s /usr/local/bin/gcc-4.2 /usr/local/bin/gcc
ln -s /usr/local/bin/gcc-4.2 /usr/local/bin/cc
ln -s /usr/local/bin/g++-4.2 /usr/local/bin/c++
ln -s /usr/local/bin/g++-4.2 /usr/local/bin/g++
Click to expand...
Click to collapse
Okay, just tried this. I created a new dir (/Volumes/Android/bin) that simply houses those softlinks you recommended. Then I put /Volumes/Android/bin at the beginning of my PATH. That should fix it without breaking the rest of the system, e.g. homebrew.
The GENERAL_REGS problem still exists though. Pretty sure b/c gcc 4.2.1 doesn't understand this construct properly (need a newer version of gcc).
So I backed out the change that introduced this adler32.c.
https://github.com/CyanogenMod/android_external_zlib/commit/13bf40af68236c961542bdee1d4b7c0176bf15a0
The compile is getting farther now. I have to run to work so I'll post later if it succeeds.
The weird thing is: This change was made back in December. Why would it have worked for you?

topprospect said:
The compile is getting farther now. I have to run to work so I'll post later if it succeeds.
Click to expand...
Click to collapse
Build works (and boots!) with the following:
Code:
cd external/zlib
git revert dd6786cae3f4493faa6661d5f74db587932f15d7
git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
Note the 1st revert is just to avoid massive conflicts seen when reverting the 2nd one by itself. The 2nd revert is the one that really matters here.
So this isn't really a solution.. Seems like we need to move to a newer version of gcc or figure out a patch to adler32.c that makes it gcc 4.2 compatible.

topprospect said:
Build works (and boots!) with the following:
Code:
cd external/zlib
git revert dd6786cae3f4493faa6661d5f74db587932f15d7
git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
Click to expand...
Click to collapse
The first revert works fine, however the second one gives me the following error:
Code:
$ git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
error: could not revert 13bf40a... Implement vectorized adler32 and optimized slhash
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
error: Could not parse conflict hunks in zlib.h

empyyy said:
The first revert works fine, however the second one gives me the following error:
Code:
$ git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
error: could not revert 13bf40a... Implement vectorized adler32 and optimized slhash
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
error: Could not parse conflict hunks in zlib.h
Click to expand...
Click to collapse
Well, run git status. You'll see that the only conflict is in the comments in zlib.h. So, you can just ignore it.

topprospect said:
Okay, just tried this. I created a new dir (/Volumes/Android/bin) that simply houses those softlinks you recommended. Then I put /Volumes/Android/bin at the beginning of my PATH. That should fix it without breaking the rest of the system, e.g. homebrew.
The GENERAL_REGS problem still exists though. Pretty sure b/c gcc 4.2.1 doesn't understand this construct properly (need a newer version of gcc).
So I backed out the change that introduced this adler32.c.
https://github.com/CyanogenMod/android_external_zlib/commit/13bf40af68236c961542bdee1d4b7c0176bf15a0
The compile is getting farther now. I have to run to work so I'll post later if it succeeds.
The weird thing is: This change was made back in December. Why would it have worked for you?
Click to expand...
Click to collapse
topprospect said:
Build works (and boots!) with the following:
Code:
cd external/zlib
git revert dd6786cae3f4493faa6661d5f74db587932f15d7
git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
Note the 1st revert is just to avoid massive conflicts seen when reverting the 2nd one by itself. The 2nd revert is the one that really matters here.
So this isn't really a solution.. Seems like we need to move to a newer version of gcc or figure out a patch to adler32.c that makes it gcc 4.2 compatible.
Click to expand...
Click to collapse
Nice find. I tried to compile this morning and I ran into the same issue. This is what I don't understand: I did a couple of builds about a week ago without running into this issue. But, the latest commits on zlib are from 2 months ago.
Amazingly, the Xcode 4.3 toolchain (clang and llvm-gcc) builds this external/zlib/adler32.c just fine.
An alternative to this problem is to install an up to date gcc 4.7 :
Code:
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/gcc.rb
and then create symlinks to gcc-4.7/g++-4.7. I have not tested this yet.

Related

cyanogenmod development

I want to port cyanogenmod to archos
Are there any developers who know how to download the source of cnm and archos firmware
I'm a game developer and I have no experience with drivers but we can compare are achos devices with other cnm supported devices, the nexus s has the same processor, so we don't have to create a driver for that
Compare list (Update 24 June)
processor is the same as in the droid 2
touchscreen = ?
sound hardware =
screen hardware =
You should take a look at the [DEVELOPEMENT] Cyanogen thread on the Dev subforum - think they'll be pretty happy to see you over there!
fisha21 said:
You should take a look at the [DEVELOPEMENT] Cyanogen thread on the Dev subforum - think they'll be pretty happy to see you over there!
Click to expand...
Click to collapse
Yes, but I'm a newcomer and I can't post a replay there
coen22 said:
Yes, but I'm a newcomer and I can't post a replay there
Click to expand...
Click to collapse
im the thread starter at the post above
Just post 6 posts and you can post at dev section
Lennb said:
im the thread starter at the post above
Just post 6 posts and you can post at dev section
Click to expand...
Click to collapse
Thx, but what do think of my idea
coen22 said:
Thx, but what do think from my idea
Click to expand...
Click to collapse
Im happy, if anyone want to help, but
we need a guy who really have android developement knowledge
Anyone?
I still can't reply to the main thread of cyanogenmod [DEV]
The first thing we have to do is a hardware research
the archos gen8 devices have a
First
Processor: Arm cortex-A8 <-- same as galaxy s, and nexus s
Screen: <--- ?
Then
Touchscreen: <--- ?
Later
Camera: <--- ?
Camera A43: <--- ?
WiFi: <--- ?
Sound: <--- ?
Software buttons
I think we should first make the processor and the screen working, then we are able to debug the device using adb
And we are able to view debug codes on archos
Because all drivers are included in the kernel, what would be the outcome of running say AOSP gingerbread on top of the current kernel?
Archos didn't make much changes to the kernel and the system compared to other manufactures like HTC and it's Sense ROM.
Sorry for this rant, but I cant help myself.
Guys, stop the nonsense regarding not being an android dev and thusnot being able to get anything done. Are you not capable of learning? Please dont reply with negative until you ve tried.
I'm a linuxadmin. It took me 2 hours to get a CM build just by following the instructions. How much longer would it take to rip the drivers ad add them to the image? My guess is that if you start with CM 6 (froyo?) you ll be done in a few days.
So please stop begging for an android dev and all the idle talk of how you think you might get things to work. Just get started with the cyanogenmod build guide already!
Again sorry for the rant
wvl0 said:
Sorry for this rant, but I cant help myself.
Guys, stop the nonsense regarding not being an android dev and thusnot being able to get anything done. Are you not capable of learning? Please dont reply with negative until you ve tried.
I'm a linuxadmin. It took me 2 hours to get a CM build just by following the instructions. How much longer would it take to rip the drivers ad add them to the image? My guess is that if you start with CM 6 (froyo?) you ll be done in a few days.
So please stop begging for an android dev and all the idle talk of how you think you might get things to work. Just get started with the cyanogenmod build guide already!
Again sorry for the rant
Click to expand...
Click to collapse
Ho year sure, downloading sources for a supported device and building the entire thing is not rocket science and can be easily done by following the wiki.
But building one for an unsupported device is an other story.
It requires a good knowledge and a lot of spare time.
The knowledge can be learned online but it requires a lot more spare time too and many of us don't have that spare time, unfortunately.
do you?
I'm not here to lecture people on how they spend their time. I simply want to point out that waiting for a dev to come along to fix your woes isn't the right way to get a project started. Besides, all the time spent on forum posts will nicely accumulate into a plentiful amount of time that can be spent on learning.
If there is an dev interested in building a rom, they will. No need to create some kind of placeholder containing information you think someone might want.
The open source way is to scratch your own itch.
Just on the technical side of things. If you port the cyanogen froyo version, you should simply be able to use the same drivers archos uses. So there isn't going to be any development involved, just compiling stuff.
As to your last question, I surely don't have to reply.
wvl0 said:
I'm not here to lecture people on how they spend their time.
Click to expand...
Click to collapse
I see , what are you here for ?
I simply want to point out that waiting for a dev to come along to fix your woes isn't the right way to get a project started. Besides, all the time spent on forum posts will nicely accumulate into a plentiful amount of time that can be spent on learning.
If there is an dev interested in building a rom, they will. No need to create some kind of placeholder containing information you think someone might want.
The open source way is to scratch your own itch.
Just on the technical side of things. If you port the cyanogen froyo version, you should simply be able to use the same drivers archos uses. So there isn't going to be any development involved, just compiling stuff.
As to your last question, I surely don't have to reply.
Click to expand...
Click to collapse
Well that was one of the useless posts found on this thread. Thank you for adding yours to the list
Hey guys, please join us at the Developer Thread.]
Its better to have only one thread
sibere said:
I see , what are you here for ?
Well that was one of the useless posts found on this thread. Thank you for adding yours to the list
Click to expand...
Click to collapse
Touché. I guess I'll just add what I learned then.
How to get your buildsystem up and running on Ubuntu Oneiric 64bit.
Before following this guide: http://wiki.cyanogenmod.com/index.php?title=Compile_CyanogenMod_for_Sholes
Do this first, just to avoid having to install individual packages later on:
Code:
add-apt-repository "deb http://archive.canonical.com/ maverick partner"
Code:
apt-get install bison build-essential curl flex g++-4.3-multilib gcc-4.3-multilib git-core g++-multilib gnupg gperf lib32ncurses5-dev lib32readline5-dev lib32z1-dev libc6-dev-i386 libesd0-dev libncurses5-dev libsdl1.2-dev libsdl-dev libwxgtk2.6-dev ncurses-dev pngcrush schedtool squashfs-tools sun-java6-jdk zip zlib1g-dev
I think I ran into compile issues with gcc-4.6, so I switched over to 4.4
Code:
rm /usr/bin/gcc
ln -s /usr/bin/gcc-4.4 /usr/bin/gcc
rm /usr/bin/g++
ln -s /usr/bin/g++-4.4 /usr/bin/g++
Then following this guide to get ADB running with your tablet:
http://forum.xda-developers.com/archive/index.php/t-892847.html
Now you can follow the Sholes build guide.
You might run into compile issues. This bug report includes a fix:
http://code.google.com/p/cyanogenmod/issues/detail?id=2455
and in case you run into this one:
frameworks/base/core/java/android/widget/ListView.java:3631: warning 13: Method android.widget.ListView.getCheckItemIds: (at)Deprecated annotation and (at)deprecated doc tag do not match
Checking API: checkapi-last
(unknown): error 17: Field org.apache.http.protocol.HTTP.EXPECT_CONTINUE has changed value from "100-Continue" to "100-continue"​
Solve it by:
The error here is that someone needs to change the "100-continue" line on line 63 of file external/apache-http/src/org/apache/http/protocol/HTTP.java to "100-Continue"​
And there's this one too:
Code:
host Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)
host SharedLib: libneo_cs (out/host/linux-x86/obj/lib/libneo_cs.so)
host C++: libutils <= frameworks/base/libs/utils/RefBase.cpp
frameworks/base/libs/utils/RefBase.cpp: In member function ‘void android::RefBase::weakref_type::trackMe(bool, bool)’:
frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] Error 1
make: *** Waiting for unfinished jobs....
Which can be fixed by edditing frameworks/base/libs/utils/Android.mk
Change the line:
Code:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
To:
Code:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
This should give you a few files that possibly can be flashed to our tablets:
Code:
Install system fs image: out/target/product/generic/system.img
Target ram disk: out/target/product/generic/ramdisk.img
Target userdata fs image: out/target/product/generic/userdata.img
Happy Hacking.
[edit]
Here's the result, just in case anyone is brave enough to flash it.
http://www.megaupload.com/?d=7PCNF69Z
[/edit]
[edit 2]
I guess the next step would be editing the img files to order to add the necessary drivers.
You need YAFFS2 support to mount these files. YAFFS2 isn't included in this version of ubuntu however.
So get yaffs2:
Code:
git clone ssh://www.aleph1.co.uk/home/aleph1/git/yaffs2
..and get a nice old kernel, considering the current version in git doesn't support 2.6.39 cleanly.
Code:
wget http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.35/linux-2.6.35.13.tar.bz2
untar your kernel sources.
then follow the instructions included with YAFFS:
Code:
cd yaffs-dir
./patch-ker.sh c m linux-tree
complains that linux-tree/fs/yaffs2 already exists
rm -rf linuux-tree/fs/yaffs2
./patch-ker.sh c m linux-tree
Copy your /boot/config-XXX to the directory you unpacked your kernel tarball.
run a:
Code:
make oldconfig
Now add YAFFS to your config using
Code:
make menuconfig
(Filesystems->Miscellaneous filesystems->yaffs)
..compile and reboot ubuntu into your own kernel containing yaffs2 support
mount your img files with
Code:
mount -o loop -t yaffs2 filename mountpoint
[/edit 2]
[edit 3]
So apparently building cyanogenmod doesn't mean you're building a full rom, you have to do the kernel seperately (as far as I can tell ATM):
http://wiki.cyanogenmod.com/index.php?title=Building_Kernel_from_source
there was no /proc/config.gz, so i ripped the urkdroid kernel .config file instead
also getting an arm toolchain working seemed tedious, so I followed the advice in on the wiki and got one from:
http://www.codesourcery.com/sgpp/lite/arm/portal/subscription3053
Had to tell the compile process where to find the arm compiler. Think I'm actually using one I downloaded from Ubuntu's repository instead of the one from the above link - oh well.
Code:
[email protected]:~/android/kernel/cm-kernel# make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- -j`grep 'processor' /proc/cpuinfo | wc -l`
[/edit 3]
wvl0 said:
Touché. I guess I'll just add what I learned then.
How to get your buildsystem up and running on Ubuntu Oneiric 64bit.
Before following this guide: http://wiki.cyanogenmod.com/index.php?title=Compile_CyanogenMod_for_Sholes
Do this first, just to avoid having to install individual packages later on:
Code:
add-apt-repository "deb http://archive.canonical.com/ maverick partner"
Code:
apt-get install bison build-essential curl flex g++-4.3-multilib gcc-4.3-multilib git-core g++-multilib gnupg gperf lib32ncurses5-dev lib32readline5-dev lib32z1-dev libc6-dev-i386 libesd0-dev libncurses5-dev libsdl1.2-dev libsdl-dev libwxgtk2.6-dev ncurses-dev pngcrush schedtool squashfs-tools sun-java6-jdk zip zlib1g-dev
I think I ran into compile issues with gcc-4.6, so I switched over to 4.4
Code:
rm /usr/bin/gcc
ln -s /usr/bin/gcc-4.4 /usr/bin/gcc
rm /usr/bin/g++
ln -s /usr/bin/g++-4.4 /usr/bin/g++
Then following this guide to get ADB running with your tablet:
http://forum.xda-developers.com/archive/index.php/t-892847.html
Now you can follow the Sholes build guide.
You might run into compile issues. This bug report includes a fix:
http://code.google.com/p/cyanogenmod/issues/detail?id=2455
and in case you run into this one:
frameworks/base/core/java/android/widget/ListView.java:3631: warning 13: Method android.widget.ListView.getCheckItemIds: (at)Deprecated annotation and (at)deprecated doc tag do not match
Checking API: checkapi-last
(unknown): error 17: Field org.apache.http.protocol.HTTP.EXPECT_CONTINUE has changed value from "100-Continue" to "100-continue"​
Solve it by:
The error here is that someone needs to change the "100-continue" line on line 63 of file external/apache-http/src/org/apache/http/protocol/HTTP.java to "100-Continue"​
And there's this one too:
Code:
host Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)
host SharedLib: libneo_cs (out/host/linux-x86/obj/lib/libneo_cs.so)
host C++: libutils <= frameworks/base/libs/utils/RefBase.cpp
frameworks/base/libs/utils/RefBase.cpp: In member function ‘void android::RefBase::weakref_type::trackMe(bool, bool)’:
frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] Error 1
make: *** Waiting for unfinished jobs....
Which can be fixed by edditing frameworks/base/libs/utils/Android.mk
Change the line:
Code:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
To:
Code:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
This should give you a few files that possibly can be flashed to our tablets:
Code:
Install system fs image: out/target/product/generic/system.img
Target ram disk: out/target/product/generic/ramdisk.img
Target userdata fs image: out/target/product/generic/userdata.img
Happy Hacking.
[edit]
Here's the result, just in case anyone is brave enough to flash it.
http://www.megaupload.com/?d=7PCNF69Z
[/edit]
[edit 2]
I guess the next step would be editing the img files to order to add the necessary drivers.
You need YAFFS2 support to mount these files. YAFFS2 isn't included in this version of ubuntu however.
So get yaffs2:
Code:
git clone ssh://www.aleph1.co.uk/home/aleph1/git/yaffs2
..and get a nice old kernel, considering the current version in git doesn't support 2.6.39 cleanly.
Code:
wget http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.35/linux-2.6.35.13.tar.bz2
untar your kernel sources.
then follow the instructions included with YAFFS:
Code:
cd yaffs-dir
./patch-ker.sh c m linux-tree
complains that linux-tree/fs/yaffs2 already exists
rm -rf linuux-tree/fs/yaffs2
./patch-ker.sh c m linux-tree
Copy your /boot/config-XXX to the directory you unpacked your kernel tarball.
run a:
Code:
make oldconfig
Now add YAFFS to your config using
Code:
make menuconfig
(Filesystems->Miscellaneous filesystems->yaffs)
..compile and reboot ubuntu into your own kernel containing yaffs2 support
mount your img files with
Code:
mount -o loop -t yaffs2 filename mountpoint
[/edit 2]
[edit 3]
So apparently building cyanogenmod doesn't mean you're building a full rom, you have to do the kernel seperately (as far as I can tell ATM):
http://wiki.cyanogenmod.com/index.php?title=Building_Kernel_from_source
there was no /proc/config.gz, so i ripped the urkdroid kernel .config file instead
also getting an arm toolchain working seemed tedious, so I followed the advice in on the wiki and got one from:
http://www.codesourcery.com/sgpp/lite/arm/portal/subscription3053
Had to tell the compile process where to find the arm compiler. Think I'm actually using one I downloaded from Ubuntu's repository instead of the one from the above link - oh well.
Code:
[email protected]:~/android/kernel/cm-kernel# make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- -j`grep 'processor' /proc/cpuinfo | wc -l`
[/edit 3]
Click to expand...
Click to collapse
That looks very good
wvl0 said:
Touché. I guess I'll just add what I learned then.
How to get your buildsystem up and running on Ubuntu Oneiric 64bit.
Before following this guide: http://wiki.cyanogenmod.com/index.php?title=Compile_CyanogenMod_for_Sholes
Click to expand...
Click to collapse
This may be my misunderstanding but I thought this guide only teaches you how to compile your own cyanogen build for the Motorola Sholes. It even states that you need a sholes with a working copy of cyanogenmod installed. This guide will only work for devices which are already supported by the cyanogenmod team, and is not a guide to build for unsupported devices. At least, that was my understanding from spending most of a day crawling around the cyanogenmod wiki.
Part of the build process involves pulling proprietary system files from the device. I guess one starting point would be to work out which files these are, then obtain the files from the archos. However, this stuff takes time to learn and I have very little to spare, like most. But then, neither am I asking someone else to do it, or sitting waiting for it.
If it comes, it comes...
Building for a compatible CPU architecture should at least give you a semi bootable ROM, after that you have to get the drivers in.
Considering we have the source and are using the same kernel versions, we can just recompile the drivers for our kernel.
wvl0 said:
Building for a compatible CPU architecture should at least give you a semi bootable ROM, after that you have to get the drivers in.
Considering we have the source and are using the same kernel versions, we can just recompile the drivers for our kernel.
Click to expand...
Click to collapse
Thank, you guys!
Could you please joyn my Thread for CM Developement, so other guys could help?
One thread is better than two
Finally, guys with Knowledge work on a CM, how can i help?
You could help by completely taking over, 'cause I don't want a cyanogen rom per se, I just want to show people that you don't have to be a developer to compile a rom.
wvl0 said:
You could help by completely taking over, 'cause I don't want a cyanogen rom per se, I just want to show people that you don't have to be a developer to compile a rom.
Click to expand...
Click to collapse
Okey, i understand^^
Could you tell me a few steps to compile the CM ?, i think the drivers we'll do later

[ Tutorial / Reference ] Learning to Build for Galaxy Note

--
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
INTRODUCTION
There are several guides and tutorials that teach you how to build your own custom firmware from source.
To the trained eye, the steps to be followed are essentially the same.
But to users with relatively lesser experience in programming or software development/scripting of any kind, it often seems to be a daunting task.
One of the many reasons for this is that users usually have atleast 2 similar guides open side-by-side on their screens.
And when one or two lines of code/instruction do not match, all hell breaks loose.
This might not be the case with you, but it sure was with me.
This guide is based solely on my experience in starting from scratch, trying to build a ROM from CyanogenMod and AOKP sources​​
Before we proceed any further, I would like to clarify that this is NOT a definitive tutorial,
nor is it the best way to get started in ROM development.
There may be ‘kanging’ involved, zipping-unzipping as well.
Purists may take exception to some steps – but then they are purists for a reason.
My purpose is NOT to oppose what the better-skilled developers opine,
nor is it to encourage the said procedures.
However, in the event that I do mention using them –
be aware that the attempt is solely to provide a small impetus to enthusiastic learners, so that it may help them have some know-how on how to finally get started. ​
I intend to proceed slowly, rather than publishing the entire thing all at once
and then having confused users discussing Step 2 and Step 2002 at the same time.
In order to avoid this, the posts that follow will be updated in parts i.e
we shall together proceed ahead once a sizable majority of participants have successfully completed a chunk of required steps.
This, I feel, will ensure that the ensuing discussions are enjoyed and benefitted from by several more users at any given time.
REQUIREMENTS
We would be using the CM10 and AOKP sources as reference to learn building for our device.
For the purpose of this tutorial, we shall work together on the following environment –
◘ Ubuntu 12.04 64-bit
◘ A minimal requirement of a Quad-Core processor with >= 4 GB RAM
◘ A high-speed connection >= 2 mBps
◘ Solid State Drives are highly recommended.
◘ Google Toolbar
◘ Patience
◘ Patience
◘ And more Patience
​
Assuming that you would be syncing either one of the source trees, you would require
about 70-80GB of free space to sync repositories and compile a ROM from start to finish.
Users on Windows have an option of dual-booting.
If they are hesitant to do so, they can also run Ubuntu using a Desktop Virtualization Software.
However, in this case you would then require atleast 6GB of RAM, if not more,
to run both operating systems concurrently.
Users building on a remote server, I presume, would be spoilt for choices different Linux distributions available.
Be sure to have an SCP client in handy.
It is my humble request that we all follow good etiquettes and rules all the more strictly to ensure an enriching learning environment.
◘ Please do not troll here.
◘ The thread is not to be used for smug remarks or aspersions (as most of us are accustomed to)
◘ Code Snippets that will be posted on this thread using the code tag, as part of this thread, are supposed to be entered into the Linux terminal.
◘ You are requested to use Pastebin to post logs and build errors
◘ Please do not use any fancy fonts or bold typefaces.
◘ Please do not create Thank You posts if a particular solution solves your problem.
​
Each and every solution will be verified, and the author in turn will be requested to mark his post in Bold-Green.
Hence the last point above..
It is a given that this shall forever be a Work in Progress.
Things will be added, things will be removed as time flies by.
The only thing that should remain constant is the willingness to learn.
And the willingness to use Google Search.
BIBLIOGRAPHY
◘ [Tutorial] Compile JB on Ubuntu
◘ [TUTORIAL] So You Want To Build AOKP JB? [Ubuntu 12.04+]
◘ CyanogenMod WiKi
◘ Android Open Source Project
◘ Frequent IRC chats with Pier and bajee11
◘ Google chats with other kind developers, users and friends
--
Part 1: Setting-up Build Environment
--
A Build Environment is the state of the machine being used for development, including the directory structure and environment variables for your particular project. ​
Additionally, the command-line build environment for the platform and projects is your build release directory.
And so it follows that though we have our Ubuntu installations done, we are still required
to install additional packages to set-up a build environment suited for our purpose.
OpenJDK is an open-source implementation of the Java Platform, Standard Edition, and related projects.
We shall use OpenJDK-6. Type the following in your terminal -
Code:
$ sudo apt-get install openjdk-6-jdk
At the end of this step you might get a message in terminal related to the need
to update certain elements to complete installation of required packages.
For this, simply run
Code:
$ apt-get update
Python is a general-purpose, interpreted high-level programming language,
whose design philosophy emphasizes code readability.
It may already be installed on your system. But no harm in checking -
Code:
$ [B]sudo apt-get install python[/B]
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Code:
$ [B]sudo apt-get install git-core[/B]
The Android software development kit (SDK) includes a comprehensive set of development tools.
These include a debugger, libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials.
There are 2 ways to install this.
If your Ubuntu setup is on your Home PC and you have GUI access,
you can download the package from here
http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz
To do the same via command line, type this in your terminal -
Code:
$ [B]wget http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz[/B]
This will download the very same package for you to the current working directory.
Now, you have to extract the folder inside the archive, and place it in your home directory.
To do this, enter the following command in your terminal -
Code:
$ [B]tar -xvzf[/B] <filename>.<extension>
For example, if your archive is named android-sdk_linux.tar.gz
where
android-sdk_linux = filename
tar.gz = extension
you will type -
Code:
$ [B]tar -xvzf android-sdk_linux.tar.gz[/B]
Once your folder is extracted, move it to your home directory. Search Google on how to do it.
Next step is to define the path.
For this, go to your home folder and look for a file named .bashrc
For users having the comfort of a GUI, press Ctrl + H incase the file is not visible.
Remote users can use their SCP Client to find the file easily.
Open the file to edit it, and at the bottom paste the following lines -
Code:
# Android tools
export PATH=${PATH}:~/<folder_name>/tools
export PATH=${PATH}:~/<folder_name>/platform-tools
export PATH=${PATH}:~/bin
In the same manner and place, look for the file named .profile and add the following lines at the end -
Code:
PATH="$HOME/<folder_name>/tools:$HOME/<folder_name>/platform-tools:$PATH"
Once, done you now have the Android SDK successfully installed. :good:
In the end, you have to install the remaining packages and libraries and dependencies and what not.
This varies as per the version of the Ubuntu installation.
Since we are (hopefully) on Ubuntu 12.04 (64-bit) , we need to enter the following command in our terminal -
Code:
$ $ s[B]udo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386[/B]
and then
Code:
$ [B]sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so[/B]
In the even that you get errors relating to unavailability of g++ and gcc
run the following in terminal -
Code:
$ [B]apt-get install gcc[/B]
Code:
$ [B]apt-get install g++[/B]
and then repeat the previous steps.
I would also advise that you install the following as well (more on it later) -
Code:
$ [B]apt-get install lzma[/B]
Code:
$ [B]apt-get install screen[/B]
With the above done, all that is left to do is to initialize the repository that you require and then sync it to your machine or remote server. This we do in the next part.
--
Part 2: Fetching sources
--
Repo is a repository management tool that was built on top of Git
.
Repo unifies the many Git repositories when necessary, does the uploads to the revision control system, and automates parts of the Android development workflow.
Repo is not meant to replace Git, only to make it easier to work with Git in the context of Android.​
More information on the subject can be found here.
In our context, we need to download repositories of the correct Android branch (ICS, JB etc) for which we want to build.
But whose branch?
That is completely upto you to decide.
The first step is to 'download and install the repo binaries'. Issue the following commands in terminal -
Code:
$ [B]mkdir ~/bin[/B]
$[B] PATH=~/bin:$PATH[/B]
$ [B]curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo[/B]
$ [B]chmod a+x ~/bin/repo[/B]
With this done, we now make a new folder in our home directory where we would be downloading our rom sources by initializing the relevant repo
Code:
$ [B]mkdir myrom[/B]
$ [B]cd myrom[/B]
For CM10
Code:
$ [B]repo init -u git://github.com/CyanogenMod/android.git -b jellybean[/B]
For AOKP
Code:
$ [B]repo init -u git://github.com/AOKP/platform_manifest.git -b jb[/B]
You will most likely be prompted for certain details like name, email etc. Fill those in and proceed to the next step.
Once you have the above completed ( repo has been initialized in /....) it is time to sync! :good:
Simply issue the command -
Code:
$ [B]repo sync[/B]
You might have come across variations like
Code:
$ repo sync [B]-j4[/B]
or
Code:
$ repo sync [B]-j16[/B]
Essentially, all are performing the same function. Only difference is that by adding that little -j
we are specifying how many jobs we want to run concurrently, which is in a way directly related
to the number of cores powering your machine.
I have a quad-core, he has a dual-core, what should we use?
Go ahead and see for yourself.
Your first sync (rather a download) would likely take around 45 minutes to 1 hour, if you have a decent internet connection.​
The first time I decided to do this, I wasn't aware of how big the repositories could be, or what sort of an internet connection one would require.
As long as it was an unlimited data plan (yes we have limited data plans in our country), it would be fine I thought.
I had the screen active for around 6 hours without any signs of stopping, until I was finally put out of my misery by good friend antiochasylum -
me: Wow
It takes us a day to download movies
20kbps. Its party time if I can get anything
above 100kbps
Matt: Holy ****. Lol. Mrs Antis galaxy s2 lte gets 5500 down.
Blows the **** outta my note
me: :sniff:
Click to expand...
Click to collapse
Sit back and enjoy.
Do not get all tensed if the text on your screen suddenly stops moving OR is stuck at some place.
Unless and until you are back to the bash shell with a definite error message explaining why repo sync was interrupted - you are all good. :laugh:
--
rvd
reserved
one more
last
And this one is for me..... Thanks a lot dude... will keep watching this space..
Thank you so much, this is great for us newbies :highfive:
Wow, wanted to learn since longthanks
Great idea toxic, you might've just encouraged me to start compiling and building again
Sent from my GT-N7000 using XDA Premium HD app
thanks
Grrr888888. thank you very much :good:
Thank you, with my computer it gonna take forever compiling , it's is only dual core 2,1 ghz :silly:.
But since i've got patient, i'm gonna try.
PS: I have plans to install gentoo on the same team at some point in the future so this will be easy in comparison.
Please share this with other users who might be interested so that all can benefit.
Thanks
Sent from my GT-N7000 using xda premium
While setting up Ubuntu via VM for windows i am able to run though entire installation procedure but getting an critical error after i restart when the installation is complete..
sorry, this may not be exactly related with the topic directly but i thought i might find my answer here..
Sent from my GT-N7100 using Tapatalk 2
What would the error message be? I mean what exactly does it say?
Sent from my GT-N7000 using xda premium
http://pastebin.com/VLtJzaqd
Ubuntu log for your ready reference.
sunny2303 said:
http://pastebin.com/VLtJzaqd
Ubuntu log for your ready reference.
Click to expand...
Click to collapse
It seems he SATA controller in your VM has only one port configured and is unavailable to make hotplugging work.​
Make sure you are not trying to run your installation from a Guest/Limited account.
Also, in case you're trying to run Ubuntu from a CD instead of copying files to the the hard disk, you may face some problems.
Sent from my GT-N7000 using xda premium
Thanks this solution worked You were right the isse was with SATA controller.. I had not assigned it. After assigning it under settings, it worked.
Now I have moved slightly ahead... at the path setting stage
export PATH=${PATH}:~/<folder_name>/tools
export PATH=${PATH}:~/<folder_name>/platform-tools
export PATH=${PATH}:~/bin
while we are writing this in .bashrc are we supposed to replace <folder_name>/ with actual folder name? like say extracted folder name is android-sdk-linux which is placed under home.. so should we write <android-sdk-linux> ?

[Step by Step] Build ICS/JB Kernel

I have created a new thread with a script to build the kernel. Full credit for the script goes to the amazing mapkel. Without him there would be no script.
[Script] Build ICS/JB Kernel
This thread will remain as a Step by Step guide. Either method works fine but the script method is much simpler.
This is an informative guide and I decline responsibility for any damage to your device.
Do not attempt to build this kernel if you are going to complain to devs about issues.
That being said, I designed this so that even those with little knowledge can follow the exact commands and will run into no issues. If you have issues building, post here and I will try to assist you.
The following is a complete tutorial to building the kernel.
Credits:
Kernel Devs: krystianp, lehjr, Epinter, and mmontuori for making this kernel; without them there is no kernel.
Big thanks to benouch for the idea and basic outline of this tutorial.
Another big thanks to zen25205 for help with building the kernel and getting the Linaro Toolchain.
A final big thanks to mchinand for suggesting using "${HOME}" (no need to change for username anymore)
Kernel Kitchen
Thanks to:
quetzalcoatl2435
nlabrad
You need to install Ubuntu 12.04 64bit (Google for instructions)
1. Download linaro.zip (toolchain) from here: http://www.mediafire.com/?ok2paef7uhx2ji8
2. Download kitchen.zip from here: https://mega.co.nz/#!Uc4D0YiD!bs-f4FLWQTu7Q8FQziY0o3GWRPJWGBl-6-Hhm6nta-k
3. Download kernel-working.zip from here: http://www.mediafire.com/?wtavk4yb24x3lj1
4. Download misc.zip from here: http://www.mediafire.com/?q693gipql6a6ty8
If there are any issues with this guide, or if you have any issues building the kernel, post here and I will assist you as best I can.
The following is for Arch Linux Only. Ignore if you are using Ubuntu
Code:
pacman -Syu
pacman -S base-devel
pacman -S git
pacman -S bzip2
pacman -S unzip
Ubuntu Users Start Here
If you get an error on apt-get (something about package not found), enable all software sources in Ubuntu Software Center.
Stage 1 (first time only). Go to Stage 2 if you have already built the kernel.
Open a terminal and run the following commands:
Code:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
Code:
sudo apt-get install git
Create a folder named “olympus” in your home directory:
Code:
mkdir ${HOME}/olympus/
Extract the downloaded .zip files to the “olympus” folder (you can use the file manager or the following commands):
Code:
unzip ${HOME}/Downloads/linaro.zip -d ${HOME}/olympus/
unzip ${HOME}/Downloads/kitchen.zip -d ${HOME}/olympus/
unzip ${HOME}/Downloads/kernel-working.zip -d ${HOME}/olympus/
unzip ${HOME}/Downloads/misc.zip -d ${HOME}/olympus/
There should now be 4 folders in ${HOME}/olympus/: “linaro”, “kitchen”, “kernel-working” and “misc”.
In a terminal:
Code:
cd ${HOME}/olympus/
Code:
git clone git://github.com/CyanogenMod-Atrix/android_kernel_motorola_olympus.git
Stage 2 (start here if you are building again).
Code:
cd ${HOME}/olympus/android_kernel_motorola_olympus/
Get the latest updates from git:
Code:
git remote update
Now run the following commands to build the kernel:
Code:
export CROSS_COMPILE=${HOME}/olympus/linaro/bin/arm-unknown-linux-gnueabi-
Code:
make clean && make mrproper
Code:
make -j2 ARCH=arm tegra_olympus_defconfig
Code:
make -j2 ARCH=arm
Now start packing the new kernel and modules:
Code:
cp ${HOME}/olympus/android_kernel_motorola_olympus/arch/arm/boot/zImage ${HOME}/olympus/kitchen/kernel-tools/input/
Code:
cp ${HOME}/olympus/misc/CM9/boot.img ${HOME}/olympus/kitchen/kernel-tools/input/
(Replace CM9 with CM10 for CM10)
Code:
cd ${HOME}/olympus/kitchen/kernel-tools/
Code:
./menu
Press Enter Key
Select Option 1
Press Enter Key (again)
Select Option 1 (again)
Type “olympus” and press Enter Key
Press "Ctrl+C"
Code:
cp ${HOME}/olympus/kitchen/kernel-tools/output/bootimg-contents/initrd.img ${HOME}/olympus/kitchen/kernel-tools/input/
Code:
cd ${HOME}/olympus/kitchen/kernel-tools/
Code:
./menu
Press Enter Key
Select Option 1
Press Enter Key (again)
Select Option 3
Type “olympus” and press Enter Key
Press "Ctrl+C"
Run the following commands:
Code:
cp ${HOME}/olympus/kitchen/kernel-tools/output/boot.img ${HOME}/olympus/kernel-working/
Code:
find ${HOME}/olympus/android_kernel_motorola_olympus/drivers/ -name *.ko -exec cp -f {} ${HOME}/olympus/kernel-working/system/lib/modules/ \;
Code:
cd ${HOME}/olympus/kernel-working/
Code:
zip -r new_kernel.zip *
The “new_kernel.zip” file will be located at ${HOME}/olympus/kernel-working/new_kernel.zip
This is a flashable zip that you can flash on top of MROM CM9 and the ROMs that the devs will be releasing.
You will have the latest kernel changes by building it yourself.
Thanks for the tutorial. Just a quick question, why did you include the kernel modules in the kernel-working.zip; aren't they going to be overwritten with the newly compiled ones?
I can do it in debian?
mchinand said:
Thanks for the tutorial. Just a quick question, why did you include the kernel modules in the kernel-working.zip; aren't they going to be overwritten with the newly compiled ones?
Click to expand...
Click to collapse
They were useless. I have reuploaded. New link in OP.
Ufoex said:
I can do it in debian?
Click to expand...
Click to collapse
I have not tested. You can try and report back. If it works I will update the thread.
Usually devs stick to Ubuntu for Android development.
Seeing as Ubuntu is based off Debian, it should work.
atrix4g18 said:
They were useless. I have reuploaded. New link in OP.
Click to expand...
Click to collapse
I think it is better to only include what is necessary in the zips. Not for space/bandwidth reasons (they were small as you said), but more for understanding the process and knowing what's essential to build a flashable kernel.
mchinand said:
I think it is better to only include what is necessary in the zips. Not for space/bandwidth reasons (they were small as you said), but more for understanding the process and knowing what's essential to build a flashable kernel.
Click to expand...
Click to collapse
100 Percent agree. I appreciate the suggestion. As I said the new kernel-working.zip is updated without those files. Check OP.
Thanks
You forgot "sudo apt-get install git".
Oh, and if you get an error on apt-get (something about package not found), enable all software sources in Ubuntu Software Center.
quetzalcoatl2435 said:
You forgot "sudo apt-get install git".
Oh, and if you get an error on apt-get (something about package not found), enable all software sources in Ubuntu Software Center.
Click to expand...
Click to collapse
Second Post Updated. Thanks. (I don't think anyone will have the apt-get error, but if they do I will let them know).
I got that error on apt-get, which is why I mentioned it.
It was weird, I had to enable local (CD) sources to make apt-get work. It had to read the source list from the CD first before downloading the packages.
It might be a wonky install, though. I just put it here in case anyone faces the same problem.
what?
Does the kernel already includes Linaro?
omg Kristian said he'll look at it, so did he? :crying: Happy:crying:
crazymania56 said:
what?
Does the kernel already includes Linaro?
omg Kristian said he'll look at it, so did he? :crying: Happy:crying:
Click to expand...
Click to collapse
No this is only the Linaro Toolchain used to build the kernel.
Other tutorials would have you download the Android NDK for the toolchains within.. This tutorial uses the Linaro Toolchain instead.
quetzalcoatl2435 said:
I got that error on apt-get, which is why I mentioned it.
Click to expand...
Click to collapse
Added to second post. Thanks. Also made a list of credits in the OP and you are in it.
Hi, i'm trying this in Arch, i looked for the equivalent packages that are needed in ubuntu and seems that Arch has some of them in the arch-devel group of packages and the *-dev packages are included in the non-dev (arch doesn't splits the packages in dev and nondev).
So, i started unziping, and when i'm unzipping the linaro.zip, some files are overwritten, (it asks if i want to overwrite them or not), i chose yes to overwrite.
I'm compiling, so far no problems, i'll update after i finish.
nlabrad said:
Hi, i'm trying this in Arch, i looked for the equivalent packages that are needed in ubuntu and seems that Arch has some of them in the arch-devel group of packages and the *-dev packages are included in the non-dev (arch doesn't splits the packages in dev and nondev).
So, i started unziping, and when i'm unzipping the linaro.zip, some files are overwritten, (it asks if i want to overwrite them or not), i chose yes to overwrite.
I'm compiling, so far no problems, i'll update after i finish.
Click to expand...
Click to collapse
Good to know.
If it works get into the specifics and I can edit the guide or make a second one for Arch. With full credit to you of course.
Im writing this as it compiles
-No errors in make clean && make mproper
-No errors in make mrom_deconfig
The errors must be in the make.
There are a few warnings, unused functions, unused variables, uninitialized variables, i see a few modules being built, but the extension is ".o" not ".ko", for example dhd_something.o
"arch/arm/boot/compressed/head.S: Assembler messages:
arch/arm/boot/compressed/head.S:[num]: Warning: (null) (it appears a like 30 times.
Then i see, for example
"LD [M] drivers/char/hw_random/rng-core.ko" so i guess it was compiled.
Ok nevermind, the find command DOES FIND the files, but i thought that it didn´t because im used to run cp with -v, and i saw no output and i got confused.
ITS OK THEN.
Something else, after running the kitchen, its faster to press CTRL-C instead of closing/opening the terminal.
Plus you have the log of what you've been doing so far.
No current issue, the modules were compiled, i got confused.
I have the kernel zip ready to be tested.
CTRL-C will work in any bash terminal, which is the one that Ubuntu uses.
Instead of closing the terminal, it just ends the current running process (in this case, the kitchen script will end, and you get the prompt ready again).
My english is weak so if you need to change some grammar of this next few lines, feel free to do so:
So far, to compile it in Arch you need to run: (or check if you already have the packages)
pacman -Syu
pacman -S base-devel
pacman -S git
pacman -S bzip2
pacman -S unzip
Then follow the tutorial normally.
Is MROM CM9 = MROM ICS?
nlabrad said:
No current issue, the modules were compiled, i got confused.
I have the kernel zip ready to be tested.
CTRL-C will work in any bash terminal, which is the one that Ubuntu uses.
Instead of closing the terminal, it just ends the current running process (in this case, the kitchen script will end, and you get the prompt ready again).
My english is weak so if you need to change some grammar of this next few lines, feel free to do so:
So far, to compile it in Arch you need to run: (or check if you already have the packages)
pacman -Syu
pacman -S base-devel
pacman -S git
pacman -S bzip2
pacman -S unzip
Then follow the tutorial normally.
Is MROM CM9 = MROM ICS?
Click to expand...
Click to collapse
Updated Second Post. Take a look.

[Guide][9/3/2015] Building CM12 for the Nexus 6 Shamu

Building CM12 from source for the Nexus 6 Shamu!
Thanks goes to @scrosler and @GROGG88 and @sykopompos for their amazing guide
[Guide][1/19/2015] Buulding AOSP for the Nexus 6!​
This guide will walk you through, how to build CM12 for the Nexus 6 from source. To complete this, you will need a PC with either virtual box setup and Ubuntu or duel boot Windows and Ubuntu. I recommend duel booting as it gets better results.​
Ideally your PC will need a minimum of an I5 processor and 8GB of ram. I won't go into too much detail on how to setup Ubuntu on your PC. For this guide, you do need to know the basic commands and how to use Ubuntu.
This guide is very similar in process to @scrosler and @GROGG88 and @sykopompos amazing guide here: [Guide][1/19/2015] Building AOSP for the Nexus 6! Through the use of their guide and asking a lot of questions on their thread, I was able to learn how to build AOSP from source. My guide is to complement their guide and show you how to build CM12, I found switching from AOSP to CM12 fairly easy, but there were a few changes in the process.
For my guide I will be using CM12 build guide as reference for the commands. How To Build CyanogenMod Android for Google Nexus 6 ("shamu") Even their guide is not 100% up to date, so I had to make a few changes.
Disclaimer:
I am not responsible for any damage done to your device, thermal nuclear war etc. Please use at your own risk. Your warranty may be affected if you install a custom rom. I am also not responsible if you go over your payment plan when downloading the source code. It is large over 16gb so be careful!
Click to expand...
Click to collapse
So assuming you have Ubuntu 14.* set up, you will need to now set up your build environment:
First on their guide it talks about installing the SDK tools. You do not need these to build the ROM. You only really need ADB commands. I installed fastboot as well.
Install ADB command
Code:
sudo apt-get install android-tools-adb
Install Fastboot command
Code:
sudo apt-get install android-tools-fastboot
Install Java
Code:
sudo apt-get install openjdk-7-jdk
Setting up the build enviroment
Code:
bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-6-jdk openjdk-6-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev
If you have a 64bit PC install the following:
Code:
g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev
Setting your build directory - This can be any folder you want. for my example I will use android as my root folder. Remember that Ubuntu is case sensitive when switching folders.
Code:
mkdir -p ~/bin
mkdir -p ~/android
Install Repo
Code:
curl [URL]https://storage.googleapis.com/git-repo-downloads/repo[/URL] > ~/bin/repo
chmod a+x ~/bin/repo
Put the ~/bin directory in your path of execution - In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):
Code:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
Now for the good bit! We are about to download the source for cm12. Warning: The download is large and will take a long time to download. I have a 38mb fiber connection and unlimited data plan, so it is ok for me to download. I believe the download is 16gb+ in size, so you will have to take this into consideration. Note: I will not be held responsible if you go over your payment plan with your service provider. This is were I have had to start changing the guide a bit as CM's document is for building CM11. It has not been updated to CM12 yet.
Identify Yourself to the Repo
Code:
git config --global user.email "[email protected]"
git config --global user.name "yourpreferredusername"
Initialize the CyanogenMod source repository
Code:
cd ~/android [B]- this is your root folder[/B]
repo init -u [URL]https://github.com/CyanogenMod/android.git[/URL] -b cm-12.0
Download the source code - Note this will take a while, as mentioned it is over 16gb in size. Even with my connection it takes about an hour and a half to download, so time for coffee!
Code:
repo sync
If repo sync errors and stops during download, don't worry you can simply run the command again and it will pick up were it left off. If you get a lot of errors during download, I recommend using
Code:
repo sync -j1
This seems to download the source better. When you have completed the download run it again, to make sure it completes with out any errors. This way you know you have downloaded the full source code.
Backup your home directory
Also at this point, what I do is make a backup using the inbuilt backup software in ubuntu. This backs up my entire home directory to a secondary hard drive I have set up in my PC. This way if I have any issues and need to start from scratch, I can simply delete my android directory, then restore from backup. I then have a fresh working copy and don't have to spend time downloading source from CM12 again. I would also recommend this as part of scrosler's guide as well, when you have finished downloading AOSP source.
Vendor and device specific files
Now this is were the cm12 guide starts to differ a bit from AOSP. AOSP you have to download the vendor files and extract them and then add in missing ones as well. CM12 differs here. At this point I would recommend having CM12 on your Nexus 6. It uses ADB to pull files from your phone and set up the device specific files and the vendor files. I found having CM12 on the phone made life easier at this point. You can use my ROM as an example here: [ROM][5.0.2][CM12 - Android L][LRX22G] Version 1.0.0 - [8/03/2015] - Native LED's
Code:
cd ~/android
source build/envsetup.sh
breakfast shamu
Extract proprietary blobs
Now ensure that your Nexus 6 is connected to your computer via the USB cable and that you are in the ~/android/device/moto/shamu directory, then run the extract-files.sh script
Code:
cd ~/android/device/moto/shamu
./extract-files.sh
Turn on caching to speed up build
You can speed up subsequent builds by adding: the following command to your to your .bashrc file To do this close your terminal window and then reopen and type ./.bashrc - A text editor will open. Add this line to the bottom of the page.
Code:
export USE_CCACHE=1
Close the text editor and save the file
Then in the command window type the following. CM12 recommend 50GB, but you can change to what ever you want.
Code:
prebuilts/misc/linux-x86/ccache/ccache -M 50G
Building CM12!!!!
Now you are all set to start building CM12. You have everything you need. So run the following commands:
Code:
cd ~\android
source build/envsetup.sh
brunch shamu
Thats it! CM12 is now building. This will take some time to build. I do recommend a duel boot PC as it works better than in Virtual Box. Even in my PC it takes about an hour and a half to do a fresh build and about 15 minutes to do a dirty build.
So once the build finishes you now have a flash-able version of CM12 from their latest source that you can flash on your Nexus 6 - Congratulations - you are now among the elite who can build their own ROM from source
The zip file is stored in the following directory:
Code:
cd ~/android/out/target/product/shamu/cm-12-20150308-UNOFFICIAL-shamu.zip
The file name will depend on the day you build the ROM, so it may be slightly different.
Here is an example output of a successful build of CM12!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
​ Note of caution here:
Now that you have built CM12 as in AOSP I would not recommend flashing at this stage, it will make the following changes to your phone:
Install stock recovery
Encrypt your phone
To get around these we will need to make the following changes. See post 2 on how to make the changes.
As mentioned in post 1, after building CM12 you dont really want to flash it yet. It will:
Install stock recovery
Encrypt your phone - This is optional you can leave it to encrypt, but it is best to give the user the choice to do so or not.
In this post, I will also show you how to make other changes, eg: changing default wallpaper etc. I have a GitHub setup for this and all you need to do, is cherry-pick the commands into your folder, then compile the rom. My main source for all my changes are located here: https://github.com/StephenRJ - you are free to use these changes, but please give credit if you do.
Disable recovery.
Code:
cd ~/android/system/core/rootdir
git init
git fetch https://github.com/StephenRJ/cm12_system_core_rootdir.git
git cherry-pick f413ac907961c07f07f767ceb568deb4881e9f57
This next cherry-pick command will all the user the option of setting encryption on the phone, rather than it being automaticly encrypted.
Disable encryption
Code:
cd ~/android/device/moto/shamu
git init
git fetch https://github.com/StephenRJ/cm12_device_moto_shamu.git
git cherry-pick 7459b0d54102fbee27f363e7612b83f614a0f8c4
Now you have both of these disabled, you will need to do a fresh build again. To do this, I simply delete the out folder. Open file manager and go to android - then delete the folder out. This will let you make a full build again.
Close your terminal window and reopen.
Start a fresh build
Code:
cd ~/android
source build/envsetup.sh
brunch shamu
Now you can flash CM12 on your Nexus 6 Shamu Congratulations!!!!!
I will continue to add more fixes here has I find them.
Here are a couple of video tutorials I have found on setting up a basic Ubuntu enviroment.
Virtual Box: https://www.virtualbox.org/wiki/Downloads
Ubuntu ISO: http://www.ubuntu.com/download/desktop
Tutorial on setting up Virtual box on Windows 7 / 8
Duel boot Windows 8 and Ubuntu - Prefered method
Disclaimer
I am not responsable for anything that happens to your PC during the install of Ubuntu. I recommend taking a full backup first before installing a second operating system. Do this at your own risk. If your are not sure about installing different oprating systems, use the first method as it is safer
Click to expand...
Click to collapse
Change Log
Version 1.0.0
- Initial release
Please feel free to share here and help each other. I hope this guide is as useful to users as scrosler's has been. With out his help and guide, I would have never have been able to learn how to build AOSP for this amazing phone. I hope this guide gives more users the chance to build CM12 as well.
Using this guide, I have built and released a ROM. Please have a look here: [ROM][5.0.2][CM12 - Android L][LRX22G] Version 1.0.0 - [8/03/2015] - Native LED's
Please feel free to try it and report back!
I would suggest using a local manifest and getting your vendor files from TheMuppets repo. That way you stay up to date on any changes that are made.
Thanks for the tip. Could you explain a bit more on how to do that? I had installed an existing stock CM12 rom on the phone and then used the commands to remotely pull the files from it.
Stephen said:
Thanks for the tip. Could you explain a bit more on how to do that? I had installed an existing stock CM12 rom on the phone and then used the commands to remotely pull the files from it.
Click to expand...
Click to collapse
CM's wiki has a pretty good guide.
http://wiki.cyanogenmod.org/w/Doc:_Using_manifests#The_local_manifest
Also, not sure the recovery thing mentioned is an issue. I've been building CM for this device for nearly 2 months and have had no issues with TWRP being replaced.
Excellent guide! Now I just need a Nexus 6... :silly:
I love seeing useful tutorials being posted. That's why I got involved in @scrosler's thread. Nice job!!
akellar said:
Also, not sure the recovery thing mentioned is an issue. I've been building CM for this device for nearly 2 months and have had no issues with TWRP being replaced.
Click to expand...
Click to collapse
Agreed. I was just about to post that too. Most custom ROMs remove the stock recovery so custom recoveries don't get overwritten.
Very cool ill try this tomorrow! Can you maybe add a section on how to find and add nice cherrypicks?
Regarding the recovery I added that in on the safe side. I know if you download the full stock cm12 from their website it does change the recovery and encrypt the device.
I will be adding a few more cherry picks at some stage, I am working on something rather cool at the minute.
Thanks for doing this. I've followed a few guides but every one wasn't quite correct. I can't wait to test this out soon.
- Aaron
Very well done Stephen! I read as many of these as I can and always learn something new. This is very well written and I hope all of us can add and help each other as we progress with the N6!:good:
Hey,
I have built AOSP for Nexus devices for a long time, but have yet to run into this issue.
When I run "brunch shamu", it fails, referancing generic "goldfish"? is that just a generic device name?
Here is the build process:
[email protected]:~/android$ source build/envsetup.sh
including device/moto/shamu/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-mips/vendorsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including vendor/cm/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/cm/bash_completion/git.bash
including vendor/cm/bash_completion/repo.bash
[email protected]:~/android$ brunch shamu
including vendor/cm/vendorsetup.sh
Looking for dependencies
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.0.2
CM_VERSION=12-20150315-UNOFFICIAL-shamu
TARGET_PRODUCT=cm_shamu
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.16.0-31-generic-x86_64-with-Ubuntu-14.10-utopic
HOST_BUILD_TYPE=release
BUILD_ID=LRX22G
OUT_DIR=/home/npjohnson/android/out
============================================
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.0.2
CM_VERSION=12-20150315-UNOFFICIAL-shamu
TARGET_PRODUCT=cm_shamu
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.16.0-31-generic-x86_64-with-Ubuntu-14.10-utopic
HOST_BUILD_TYPE=release
BUILD_ID=LRX22G
OUT_DIR=/home/npjohnson/android/out
============================================
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
"ebtables is disabled on this build"
find: `dummy': No such file or directory
build/core/base_rules.mk:154: *** system/device/generic/goldfish/audio: MODULE.TARGET.SHARED_LIBRARIES.audio.primary.goldfish already defined by device/generic/goldfish/audio. Stop.
Not sure, haven't seen that error before. Have you added any extra mods into the rom? One of those could be causing the issue. It could also be an issue with CM12 its self. Some times they do add code in and it can cause errors.
I would try downloading source again and see if there is any difference.
Stephen said:
Not sure, haven't seen that error before. Have you added any extra mods into the rom? One of those could be causing the issue. It could also be an issue with CM12 its self. Some times they do add code in and it can cause errors.
I would try downloading source again and see if there is any difference.
Click to expand...
Click to collapse
Will do. I am building on Ubuntu 14.10. That should be OK to use correct? Fresh install, then followed steps in the OP.
npjohnson said:
Will do. I am building on Ubuntu 14.10. That should be OK to use correct? Fresh install, then followed steps in the OP.
Click to expand...
Click to collapse
Yes. Oh what setup are you using. Virtual Box or duel boot. I did have problems with Virtual box and switched to duel boot. Found it to be more stable.
Stephen said:
Yes. Oh what setup are you using. Virtual Box or duel boot. I did have problems with Virtual box and switched to duel boot. Found it to be more stable.
Click to expand...
Click to collapse
Dual boot.
Any idea why my builds come in at around 387MB but the official nightlies are ~443MB?

[BUILD][6.0.1][CAF][LA.HB.1.3.1] How to build Marshmallow using Arch Linux

System Requirements
Arch Linux x86-64
Oxygen OS(extracted image or installed)
adb installed and drivers setup
non-root user
sudo setup for your user (you can install packages as root as a workaround)
40GB free storage
4GB+ ram
Required Packages
First off you're gonna want to make sure you're completely up to date and fetch the packages required to build, with the command below.
Code:
#sudo pacman -Syyu gcc-multilib git gnupg flex bison gperf sdl wxgtk squashfs-tools curl ncurses zlib schedtool perl-switch zip unzip libxslt python2-virtualenv bc lib32-zlib lib32-ncurses lib32-readline jdk7-openjdk rsync maven repo
Then you're going to need to fetch some apps from the AUR. First add their GPG key.
Code:
#gpg --keyserver pgp.mit.edu --recv-keys C52048C0C0748FEE227D47A2702353E0F7E48EDB
Now you can fetch them with a tool like yaourt or manually install the two packages.
lib32-ncurses5-compat-libs
ncurses5-compat-libs
Code:
#yaourt --aur lib32-ncurses5-compat-libs ncurses5-compat-libs
Setting up build enviroment and syncing
This part will assume you're building in a folder called "android" in your home directory, and requires the above packages to be installed.
Run these commands to install repo in a folder called "bin" in your home directory. Then for a single terminal session set the new "bin" folder as a binary folder in bash.
Code:
#mkdir ~/bin
#export PATH=~/bin:$PATH
#curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
#chmod a+x ~/bin/repo
Make a folder to store and build android, then enter it.
Code:
#mkdir ~/android
#cd ~/android
Setup a virtual python 2.7 enviroment in your "android" folder as repo doesn't work with 3+.
Code:
#virtualenv2 venv
#ln -s /usr/lib/python2.7/* ~/android/venv/lib/python2.7/
#source venv/bin/activate
Now it's time to sync the sourcecode with your python 2.7 and repo setup. The following code will sync CAF android 6.0.1 from oneplus. The "4" can be removed or replaced with any whole number becides zero depending on your connection speed. You may omit the "-c" if you have problems syncing or need more than the defined branches.
Code:
#repo init -u https://github.com/OnePlusOSS/android.git -b oneplus3T/6.0.1
#repo sync -j4 -c
You can also use my repo if you prefer. I'm working on improving the mess oneplus gave us.
Code:
#repo init -u https://github.com/droidman/android.git -b oneplus3T/6.0.1
#repo sync -j4 -c
Compile Your Build
Assuming your in your virtual python 2.7 and followed the first part of the guide, set openjdk 7 as your active java.
Code:
#export JAVA_HOME=/usr/lib/jvm/java-7-openjdk
Fix broken provided glib.
Code:
cp /usr/bin/ld.gold prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/bin/ld
If you're rooted and have adb installed, you may want to fetch your prebuilt files from the latest marshallow Oxygen OS or caf based rom. You may also extract them from a Oxygen OS system image but build will not complete without prebuilts.
Code:
#cp ~/android/.repo/manifests/pull_library.sh ~/android/pull.sh
#sh pull.sh
Intialize the enviroment and select a platform. You may build "msm8996-userdebug" or "msm8996-user".
Code:
#source build/envsetup.sh
#lunch msm8996-userdebug
Time to build! Find the number of threads on your cpu and set 1-2x that as "x". You may also omit "OTAackage" if you prefer to have fastboot/twrp flashable images instead of a zip, (system.img, boot.img, etc).
Code:
#make -jx OTApackage
Your compiled files and flashable zip or images will be located in "~/android/out/target/product/msm8996".
How to rebuild!
Cd into directory, sync repo, and setup enviroment.
Code:
#export PATH=~/bin:$PATH
#export JAVA_HOME=/usr/lib/jvm/java-7-openjdk
#cd ~/android
#source venv/bin/activate
#repo sync -j4 -c
#source build/envsetup.sh
#lunch msm8996-userdebug
Clean the out directory.
Code:
#make clobber
Build. (setup to make a recovery flashable zip with a 8 thread processor.)
Code:
#make -j16 otapackage
Thanks for the clean guide
Very nice and thanks for posting it. If you'd rather use whatever you've got installed on a box or VM (to pick one out of a hat, U16.04) , just google "how to build marshmallow {from your distro}". (where you fill in your distro's name & version (opt)).
For example, initial parts of "this page(see link)" might be good for 16.04 LTS users :: http://forum.xda-developers.com/chef-central/android/guide-how-to-setup-ubuntu-16-04-lts-t3363669
All the commands following the basic setup of development environment in the OP "should" work on any distro, starting with the fetch from git. Also, thanks for your personal github code.
Anyway, good job. Cheers.
I've synced your git version of oneplus' git. The problem I've having and not getting past looks like this: Oops, I guess I lost the clipboard from the VM. It was basically as if it hasn't got the dashd prebuilt or blob or whatever it was looking for. I grabbed the prebuilts via my phone running 3.5.3 which seemed to work fine.
Is your current github code building without trouble for you? I should probably re-sync. Thanks.
hachamacha said:
I've synced your git version of oneplus' git. The problem I've having and not getting past looks like this: Oops, I guess I lost the clipboard from the VM. It was basically as if it hasn't got the dashd prebuilt or blob or whatever it was looking for. I grabbed the prebuilts via my phone running 3.5.3 which seemed to work fine.
Is your current github code building without trouble for you? I should probably re-sync. Thanks.
Click to expand...
Click to collapse
The prebuilt script is currently broken, i manually copied over the files that failed with a file manager. You can also mount a system.img from a compiled oxygenOS, Oneplus Open Source or AOOP as ext4 to manually copy over the files too!
namanjr said:
The prebuilt script is currently broken, i manually copied over the files that failed with a file manager. You can also mount a system.img from a compiled oxygenOS, Oneplus Open Source or AOOP as ext4 to manually copy over the files too!
Click to expand...
Click to collapse
Oh cool. I can do that (the system.img). My question then is "where are the files on in the mounted system.img" and "do they go to "prebuilts" at top level or to "vendor" (which level, since I see vendor repeat two levels down)?
Thanks.
hachamacha said:
Oh cool. I can do that (the system.img). My question then is "where are the files on in the mounted system.img" and "do they go to "prebuilts" at top level or to "vendor" (which level, since I see vendor repeat two levels down)?
Thanks.
Click to expand...
Click to collapse
I just extracted the entire root of the system.img to "SOURCECODE/vendor/oneplus", easier than manually going through to see what files to copy over!
namanjr said:
I just extracted the entire root of the system.img to "SOURCECODE/vendor/oneplus", easier than manually going through to see what files to copy over!
Click to expand...
Click to collapse
Great. Thanks so much for the help. I'll give that a shot next.
---------- Post added at 11:01 AM ---------- Previous post was at 10:25 AM ----------
hachamacha said:
Great. Thanks so much for the help. I'll give that a shot next.
Click to expand...
Click to collapse
OK, that worked. I just had to , for some reason, use the samsung simg2img (sparse to full) util in order to mount it as ext4/loop.
Thanks again.
edit: solved
Now that I can do a make -j {target}, I've got another question:
The target OTApackage (or is it otapackage) doesn't appear to be a valid choice for me. I get a "Target doesn't exist" error if I use make -j{N} otapackage (or OTApackage). I'd like very much to be able to create the install .zip rather than have to collect & bundle all the bits & pieces. I've tried with the original OnePlus .git and your .git as well.
Thanks much.
hachamacha said:
Now that I can do a make -j {target}, I've got another question:
The target OTApackage (or is it otapackage) doesn't appear to be a valid choice for me. I get a "Target doesn't exist" error if I use make -j{N} otapackage (or OTApackage). I'd like very much to be able to create the install .zip rather than have to collect & bundle all the bits & pieces. I've tried with the original OnePlus .git and your .git as well.
Thanks much.
Click to expand...
Click to collapse
Did you setup the enviroment and run lunch? It's all lowercase! Can you post the error it gives?
namanjr said:
Did you setup the enviroment and run lunch? It's all lowercase! Can you post the error it gives?
Click to expand...
Click to collapse
Oh yeah: On the same VM, I can build versions of CM, no troubles. I've got OpenJava 7 JDK and all the right stuff. I ran lunch (It's something like either #25 or 26 on the menu, and no problems with any of that.
After quite awhile, it comes back with the "no rule to build target otapackage (whatever it was)" . I'll run a build right now and get the exact error:
Jeez! Of course, this is the time it picks to just go right past where it usually gets the error. I'm pretty sure I know what happened. I was using it as you'd printed it in the guide ^^, OTApackage, which in a case sensitive system , doesn't mean a thing. I'll post again if it dies 2 hours down the line. I should move this operation to my Linux box with SSD's but it's in use at the moment.
Thanks again.
edit: Lunch output ::
$lunch msm8996-userdebug
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=6.0.1
TARGET_PRODUCT=msm8996
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=kryo
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.4.0-51-generic-x86_64-with-Ubuntu-16.04-xenial
HOST_BUILD_TYPE=release
BUILD_ID=MXB48T
OUT_DIR=out
Click to expand...
Click to collapse
Damn. I just realized you had this covered as well, but I missed it first time around.
My compile finally blew out about 1/2 way through with a libart.so build error, so I did this (before I re-read your guide):
Code:
$ln -s prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/bin/ld /usr/bin/ld.gold
And we're off to the next error! ;
I believe someone has already mentioned a problem with dashd not being found, im getting the "no rule to make target..." error regarding dashd, tried to pull /sbin/dashd but the file doesn't exist. What can I do
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
hamzahrmalik said:
I believe someone has already mentioned a problem with dashd not being found, im getting the "no rule to make target..." error regarding dashd, tried to pull /sbin/dashd but the file doesn't exist. What can I do
Click to expand...
Click to collapse
Did you unpack system.img from 3.5.3 (you can check the disaster recovery thread in q&a here) and then copy the entire contents into $source/vendor/oneplus? Before I had just used a cable and adb enabled in Linux and I died at dashd as well. After I got the system.img prebuilts, it was fine.
Note: My experience:: System.img wasn't mountable as a $mount -t ext4 -o loop ... device , not recognized as that type file, so I found simg2img (For whatever reason, Samsung uses "sparse" image files and apparently so does OP) to modify system.img to a normal non-sparse system.img and then mount -t ext4 -o loop ./system.img /{mountpoint} worked fine and I copied from there to ./vendor/OnePlus/ (however it's spelled , it's the only "oneplus" folder under vendor.
hachamacha said:
Did you unpack system.img from 3.5.3 (you can check the disaster recovery thread in q&a here) and then copy the entire contents into $source/vendor/oneplus? Before I had just used a cable and adb enabled in Linux and I died at dashd as well. After I got the system.img prebuilts, it was fine.
Note: My experience:: System.img wasn't mountable as a $mount -t ext4 -o loop ... device , not recognized as that type file, so I found simg2img (For whatever reason, Samsung uses "sparse" image files and apparently so does OP) to modify system.img to a normal non-sparse system.img and then mount -t ext4 -o loop ./system.img /{mountpoint} worked fine and I copied from there to ./vendor/OnePlus/ (however it's spelled , it's the only "oneplus" folder under vendor.
Click to expand...
Click to collapse
Thanks. Can't find the thread you are referring to, so I just downloaded a 3.5.3 rom zip and I'll see what I can find
Sent from my ONEPLUS A3003 using Tapatalk
hamzahrmalik said:
Thanks. Can't find the thread you are referring to, so I just downloaded a 3.5.3 rom zip and I'll see what I can find
Sent from my ONEPLUS A3003 using Tapatalk
Click to expand...
Click to collapse
Sorry: I couldn't find it for a moment either. Here it is and if you get the .zip file in the thread that the OP user has on a torrent, then you can just unzip and use any of the 3.5.3 .img files. The other .zip files all use the newer .zip style of patching every file from things like system.img.new, etc.
http://forum.xda-developers.com/oneplus-3t/help/oneplus-3t-factory-restore-utility-t3511287
That's the thread.
hachamacha said:
Sorry: I couldn't find it for a moment either. Here it is and if you get the .zip file in the thread that the OP user has on a torrent, then you can just unzip and use any of the 3.5.3 .img files. The other .zip files all use the newer .zip style of patching every file from things like system.img.new, etc.
http://forum.xda-developers.com/oneplus-3t/help/oneplus-3t-factory-restore-utility-t3511287
That's the thread.
Click to expand...
Click to collapse
Finally got that downloaded. How do i mount? I tried mount -t ext4 -o loop ./system.img but that doesnt work. You said something about covnerting to non-sparse, how do i do that?
Thanks
hamzahrmalik said:
Finally got that downloaded. How do i mount? I tried mount -t ext4 -o loop ./system.img but that doesnt work. You said something about covnerting to non-sparse, how do i do that?
Thanks
Click to expand...
Click to collapse
There's a linux util called simg2img (or I think it means (sparse image to full image). Then you can do the mount you just tried above. It fails on the 'sparse' image. I'm not sure why the hell OP is using Samsung's sparse image but maybe it's more common than I know. I just happened upon it and it was installed on my version of Ubuntu from when I was building CMNN.N versions for other phones.
I can upload it if you like (or try). OK: I booted linux and zipped it so unzip simg2img.zip >> /usr/bin (or whatever you're using as an executable path).
hachamacha said:
There's a linux util called simg2img (or I think it means (sparse image to full image). Then you can do the mount you just tried above. It fails on the 'sparse' image. I'm not sure why the hell OP is using Samsung's sparse image but maybe it's more common than I know. I just happened upon it and it was installed on my version of Ubuntu from when I was building CMNN.N versions for other phones.
I can upload it if you like (or try). OK: I booted linux and zipped it so unzip simg2img.zip >> /usr/bin (or whatever you're using as an executable path).
Click to expand...
Click to collapse
Thank you very much, I'll give that a go
Sent from my ONEPLUS A3003 using Tapatalk
I'm curious as to what 'builders' think is the best solution (assuming you have this problem, or this type of problem on other modules) :
Problem:: (can't build libart.so) (sorry, don't have the error anymore but it has to do with ./prebuilts/*/*/.../*/ld not pointing to a version that is in sync with what's going on to the tree.
A solution(s): ln -s /usr/bin/ld.gold ./prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/ld
(why?) - I found this as a workaround in a) the original OP, b) the changesets for the problem in CM jerritt. Also setting env var "WITHOUT_HOST_CLANG=TRUE". I have yet to find a decent answer for why this might be working.
Currently: I can build the thing, but there are ~23 or so occurrences of ./ld in the ./prebuilts tree. Is that really the best solution , changing each of these things to be soft pointers to /usr/bin/ld.gold?
If anyone has a better answer (or a real answer), would love to hear it. Yes, it builds, but the reason this seems so hokey is because if you did, for example, a "make clobber" before a build to clean out the trash, you'd be back at square one. Of course, you could make it part of a script..
edit: gerritt refs: (they are quite "old" so the problems been around in CM for quite awhile. We're just building stock here.
https://review.cyanogenmod.org/#/c/120824/
https://android-review.googlesource.com/#/c/223100/
Click to expand...
Click to collapse
edit2: Return of --version or -v from /usr/bin/ld, ld.gold to see the difference:
Code:
/usr/bin/ld -v
GNU ld (GNU Binutils for Ubuntu) 2.26.1
[email protected]:~/sandbox/op3t$ /usr/bin/ld.gold -v
GNU gold (GNU Binutils for Ubuntu 2.26.1) 1.11
Edit 3: Explanation of ld.gold:
http://llvm.org/docs/GoldPlugin.html
Click to expand...
Click to collapse

Categories

Resources