yashsingh1/xdaforums huggingface dataset:
[Android Software Development] bhundven:
Ah, interesting. I was following the official docs. Not mixing brew & macports. This just happened to be the only place I found the same error.

--EDIT--

ArmanUV, I ended up giving up on macports and uninstalling it.

Thanks for the guide!
[Android Software Development] ArmanUV:
no problem :)

I didn't have a good experience with mac ports either. Homebrew is a lot less intrusive on the system.
[Android Software Development] bhundven:
I also had problems with libelf when building a kernel.

I found this article helpful.

I installed libelf:

brew install libelf

Then I made a new file /usr/include/elf.h with the following contents:

#include <gelf.h>

#define R_386_NONE 0
#define R_386_32 1
#define R_386_PC32 2
#define R_ARM_NONE 0
#define R_ARM_PC24 1
#define R_ARM_ABS32 2
#define R_MIPS_NONE 0
#define R_MIPS_16 1
#define R_MIPS_32 2
#define R_MIPS_REL32 3
#define R_MIPS_26 4
#define R_MIPS_HI16 5
#define R_MIPS_LO16 6

sudo ln -s /usr/local/Cellar/libelf/0.8.13/include/libelf /usr/include/libelf
sudo ln -s /usr/local/Cellar/libelf/0.8.13/include/gelf.h /usr/include/gelf.h

And was able to successfully cross-compile a kernel on my mac.

Hope that is helpful.
[Android Software Development] ArmanUV:
Did you try the method in OP? I used libelf from homebrew at first but I figured since CM has the required files already, we might as well use it. It's also a little easier:

cp /Volumes/android/cm9/external/elfutils/libelf/elf.h /usr/local/include

By the way, I think using /usr/local/include is better than /usr/include because it doesn't need sudo and it's easier to remove in case it causes issues (since you can just rm -rf /usr/local and get rid of everything including brew)
[Android Software Development] bhundven:
/me goes back and reads again :)

I agree with you on the /usr/local/include location for elf.h.

Thanks again!
[Android Software Development] Hooolm:
I know it's off topic, but I could use a hand with something.

I really need a "theme-aware" version of aapt for compiling my CM9 themes properly, so I was wondering if someone who has built CM9 on a Mac OS X installation could help me, by pulling the aapt binary out of it ...?

Here's hoping :)
[Android Software Development] ArmanUV:
I have no experience with that stuff but this awesome utility by jocylin is the holy grail of APK managers on Mac : http://xdaforums.com/showthread.php?t=1285130

I'm not sure if it contains aapt though.

If you couldn't find what you are looking for, PM the OP: http://xdaforums.com/member.php?u=238372
[Android Software Development] jazzy__b:
I'm still working through to my first successful build but I think a step may be missing for first-time builds. The device tree (device/asus/tf201 in my case) did not exist until I first ran brunch, meaning I could not run the extract files script. There may be a more official way to do this but I ran brunch then killed the build after it had fetched my device tree. I was then able to run the extract files script and re-run brunch.

Currently trying to figure out how to make it use my custom kernel config I created in kernel/asus/tf201/arch/arm/configs. Currently getting:

make[3]: *** No rule to make target `tegra3_android_jazzybconfig'. Stop.
[Android Software Development] jazzy__b:
Looks like we also need to symlink /usr/local/bin/gstat to /usr/local/bin/stat to avoid this:

AS arch/arm/boot/compressed/piggy.gzip.o
AS arch/arm/boot/compressed/lib1funcs.o
stat: illegal option -- c
usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...]
stat: illegal option -- c
usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...]
stat: illegal option -- c
usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...]
stat: illegal option -- c
usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...]
LD arch/arm/boot/compressed/vmlinux
/Volumes/android/cm9/prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-ld:--defsym _image_size=: syntax error
make[4]: *** [arch/arm/boot/compressed/vmlinux] Error 1
make[3]: *** [arch/arm/boot/compressed/vmlinux] Error 2
make[2]: *** [zImage] Error 2
make[1]: *** [sub-make] Error 2
make: *** [TARGET_KERNEL_BINARIES] Error 2
[Android Software Development] empyyy:
I'm getting the same error when building for the HTC One X. Have you fixed it yet?
[Android Software Development] jazzy__b:
Yes you need to make the symlink.

ln -s /usr/local/bin/gstat /usr/local/bin/stat

Sent from my Samsung Galaxy S II
[Android Software Development] ArmanUV:
That seems to be device specific because I never get this error when building for maguro. I'll update the guide with the gstat symlink because It won't hurt. The GNU versions of coreutils are better than OS X ones anyway :)
[Android Software Development] randy92:
I already set up and downloaded the sources..etc. I want to learn more about building and adding custom things to the rom..how do i do it? completely new to compiling roms and stuff but really want to learn..any one know any tutorials?
[Android Software Development] dhemke17:
I'm not sure you will really find a tutorial. Just go to github and review the commits people have made to their rooms in the build section, frameworks_base , and settings repos. You can find how to add all sorts if features by just reading a little bit.
[Android Software Development] randy92:
Need Help

I had compiled and builded before but now its not working anymore

Error

No private recovery resources for TARGET_DEVICE crespo

make -C kernel/samsung/crespo O=/Volumes/android/cm9/out/target/product/crespo/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=" /Volumes/android/cm9/prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-" headers_install

target SharedLib: libc (out/target/product/crespo/obj/SHARED_LIBRARIES/libc_intermediates/LINKED/libc.so)

Install: /Volumes/android/cm9/out/target/product/crespo/system/lib/libdl.so

host C: libz <= external/zlib/adler32.c

CHK include/linux/version.h

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....

I tried the fix from the troubleshoot but still wont work

any help?
[Android Software Development] dhemke17:
Have you compared the file, alder32.c to any other from versions? There may have been some changes that went wrong.
[Android Software Development] randy92:
i didnt change anything just tried building again but kept getting same error..

where would the file be?

nevermind found the file..what would i need to do correct error?
[Android Software Development] dhemke17:
Compare line 747 to another copy of the file. Check the file up on github
[Android Software Development] ArmanUV:
What is your build env? Please post the out put from the script in OP troubleshooting section (right before you start your build). You shoulnd't get this error if you're using the recommended Xcode 4.3.x environment. What does your local_manifest look like?
[Android Software Development] Slavestate:
I know this is an ICS thread but, Im having the exact same issue building CM10 over here as well. Machine is a Mac Pro quad 2.0 running Mac OS 10.6.8 (Lion can go F itself at my house heh). XCode 3 is all up to date as is everything else. I dont use homebrew though, I followed the setup instructions at CyanogenMod's wiki and am using Darwin Ports for all that stuff, PATH is setup correctly for that too. I ran the script in the troubleshooting section of the OP and heres the output:

I see some double entries in my PATH in there but that may be from running envsetup.sh or the lunch command one too many times, my terminal session has been open for a couple days so the PATH thats active is still from my last attempt at compiling a day or two ago.

I did the fix where I added the external zlib to my local_manifest but still same error. Just tried to do the reverts on it and couldnt even get the first one to go. Gave me this error:

As far as my local_manifest goes.. I just added the repos from Team Hacksung for CM10 so that file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="teamhacksung/buildscripts" path="buildscripts" remote="github" revision="jellybean">
<copyfile dest="build.sh" src="samsung/build.sh" />
</project>
<project name="teamhacksung/android_device_samsung_i777" path="device/samsung/i777" remote="github" revision="jellybean" />
<project name="teamhacksung/android_device_samsung_galaxys2-common" path="device/samsung/galaxys2-common" remote="github" revision="jellybean" />
<project name="teamhacksung/android_kernel_samsung_smdk4210" path="kernel/samsung/smdk4210" remote="github" revision="jellybean" />
<project name="TheMuppets/proprietary_vendor_samsung" path="vendor/samsung" remote="github" revision="jellybean" />
<project name="CyanogenMod/android_hardware_samsung" path="hardware/samsung" remote="github" revision="jellybean" />
<project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" revision="ics" />
</manifest>

If anybody has any ideas Im all ears! :D It was mentioned in our CM10 thread that a couple users have never been able to fix this error on their Macs and basically told me to just setup an Ubuntu VM but hey if I can get it to build natively on the Mac even better for me!
[Android Software Development] GaresTaylan:
I cant get past this section: cd /Volumes/android/cm9/device/samsung/maguro/ && ./extract-files.sh

When I run this Im told no directory exists. This is for a Samsung Galaxy Tab 7.7, SCH-i815

What do I need to do?
[Android Software Development] ArmanUV:
that directory is for maguro (gsm galaxy nexus). You have a different device.

And I'm guessing your device has official CM support? Otherwise you can't build (unless you add the device specific repos to your local manifest)
[Android Software Development] Pradeep:
Very nice work man... Thanks :))

Small question.... Does it apply to cm10 also??
[Android Software Development] gVibeR:
Works for CM9 and CM10

I think I can answer. Yes. It should apply to CM10 too.

I say this because I have hit every single error discussed in this thread while building CM10...and I have fixed each and every errors by using tips in this thread.

Hope that helps others searching ..

---------- Post added at 01:11 AM ---------- Previous post was at 12:54 AM ----------

BTW the dferg repo does not exist anymore...so that part of the Troubleshooting section will not be valid.

This error:

external/zlib/x86/adler32.c: In function ‘adler32_MMX’:
external/zlib/x86/adler32.c:907: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
external/zlib/x86/adler32.c:907: error: ‘asm’ operand has impossible constraints

Still exists using Xcode's default compiler, still not sure about using HomeBrew's GCC 4.7 because with Xcode installed Lion chooses /usr/bin no matter what ENV variables I have set including $PATH. Weird ?

Ok...I think this may help. I listed this folder and grepped on 4.2:

ls -al /Applications/Xcode.app/Contents/Developer/usr/bin/ | grep 4.2

Then went to /usr/bin and force relinked everything to look like what the above folder looked like.

lrwxr-xr-x 1 root admin 12 Sep 23 00:10 g++ -> llvm-g++-4.2
lrwxr-xr-x 1 root admin 12 Sep 23 00:10 gcc -> llvm-gcc-4.2
lrwxr-xr-x 1 root admin 8 Sep 23 00:10 gcov -> gcov-4.2
lrwxr-xr-x 1 root admin 28 Sep 23 00:10 gcov-4.2 -> ../llvm-gcc-4.2/bin/gcov-4.2
lrwxr-xr-x 1 root admin 32 Sep 23 00:10 llvm-cpp-4.2 -> ../llvm-gcc-4.2/bin/llvm-cpp-4.2
lrwxr-xr-x 1 root admin 32 Sep 23 00:10 llvm-g++ -> ../llvm-gcc-4.2/bin/llvm-g++-4.2
lrwxr-xr-x 1 root admin 32 Sep 23 00:10 llvm-g++-4.2 -> ../llvm-gcc-4.2/bin/llvm-g++-4.2
lrwxr-xr-x 1 root admin 32 Sep 23 00:10 llvm-gcc -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2
lrwxr-xr-x 1 root admin 32 Sep 23 00:10 llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2

It seems that Apple is devoted to LLVM and CLANG. The only way to not use LLVM/CLANG is to use HomeBrew to get your own build of apple-gcc42 using GCC, then remove Xcode and build everything with HomeBrew manually. Like I stated above...I found much difficulties forcing my own version of GCC when Xcode is installed...Lion kept using /usr/bin/gcc despite not having that in my PATH and have specific CC/CXX exported.

Again...Very weird.
[Android Software Development] modgadgets:
HELP - SOS

including vendor/cm/vendorsetup.sh

device/samsung/tuna/BoardConfig.mk:19: device/samsung/tuna/BoardConfig.mk: Too many open files

build/core/config.mk:151: *** No TARGET_CPU_ABI defined by board config: . Stop.

Device maguro not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).

Traceback (most recent call last):

File "build/tools/roomservice.py", line 42, in <module>

result = json.loads(urllib2.urlopen(githubreq).read())

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen

return _opener.open(url, data, timeout)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open

response = meth(req, response)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response

'http', request, response, code, msg, hdrs)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 438, in error

return self._call_chain(*args)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain

result = func(*args)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 521, in http_error_default

raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

urllib2.HTTPError: HTTP Error 403: Forbidden

device/samsung/tuna/BoardConfig.mk:19: device/samsung/tuna/BoardConfig.mk: Too many open files

build/core/config.mk:151: *** No TARGET_CPU_ABI defined by board config: . Stop.

** Don't have a product spec for: 'cm_maguro'

** Do you have the right repo manifest?

No such item in brunch menu. Try 'breakfast'

Hi Mate, I am following your steps and want to make ROM for my nexus. I have downloaded Maguro binaries and placed in the right folder. Above is the error I am getting please suggest what should be the next step to fix it. It has downloaded closed to 50 Gb as well in the mounted Android Disk. Please suggest where I am going wrong so that same can be fixed and we can proceed. Also in the breakfast Menu I am not getting Maguro & this is the error I get on typing brunch maguro. Thanks.
[Android Software Development] modgadgets:
Help

including vendor/cm/vendorsetup.sh

device/samsung/tuna/BoardConfig.mk:19: device/samsung/tuna/BoardConfig.mk: Too many open files

build/core/config.mk:151: *** No TARGET_CPU_ABI defined by board config: . Stop.

Device maguro not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).

Traceback (most recent call last):

File "build/tools/roomservice.py", line 42, in <module>

result = json.loads(urllib2.urlopen(githubreq).read())

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen

return _opener.open(url, data, timeout)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open

response = meth(req, response)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response

'http', request, response, code, msg, hdrs)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 438, in error

return self._call_chain(*args)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain

result = func(*args)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 521, in http_error_default

raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

urllib2.HTTPError: HTTP Error 403: Forbidden

device/samsung/tuna/BoardConfig.mk:19: device/samsung/tuna/BoardConfig.mk: Too many open files

build/core/config.mk:151: *** No TARGET_CPU_ABI defined by board config: . Stop.

** Don't have a product spec for: 'cm_maguro'

** Do you have the right repo manifest?

No such item in brunch menu. Try 'breakfast'

Hi Mate, I am following your steps and want to make ROM for my nexus. I have downloaded Maguro binaries and placed in the right folder. Above is the error I am getting please suggest what should be the next step to fix it. It has downloaded closed to 50 Gb as well in the mounted Android Disk. Please suggest where I am going wrong so that same can be fixed and we can proceed. Also in the breakfast Menu I am not getting Maguro & this is the error I get on typing brunch maguro. Thanks.
[Android Software Development] gabrielking9:
If i want get the required proprietary files from the device itself. Must i use STOCK ROM?
[Android Software Development] killer2239:
I was able to get the build to work one time after setting up. I am using toro and using mr1-staging instead of the ics branch when I set it up. The error I am getting now when trying to resync and build is...

... and don't forget the bacon!

Which would you like? [full-eng] 69
build/core/config.mk:160: *** TARGET_ARCH not defined by board config: device/samsung/toro/BoardConfig.mk. Stop.
Device toro not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Found repository: android_device_samsung_toro
CyanogenMod/android_device_samsung_toro already exists
Syncing repository to retrieve project.

Repository synced!
Looking for dependencies
Done
build/core/config.mk:160: *** TARGET_ARCH not defined by board config: device/samsung/toro/BoardConfig.mk. Stop.

** Don't have a product spec for: 'cm_toro'
** Do you have the right repo manifest?

No such item in brunch menu. Try 'breakfast'

Here is the code I am trying to run...

cd /Volumes/android/cm101 && source build/envsetup.sh && brunch
[Android Software Development] Zimeron:
It tells you the error, you need to specify TARGET_ARCH in the board config file, this is new for 4.2. I believe it's omap for the device.
[Android Software Development] gagan97:
First of all thnks for the guide.. i was trying to setup ubuntu as there was no guide for mac.. but now no worries.. BTW does anybody know how many GB's is the source code .. I don't have very high speed internet connection and its been going on and on and on .. how long will it tak to download :(
[Android Software Development] PaullieVicious:
You should re-update the OP for CM-10.1 and OS X 10.8.x as this was/is a great tutorial!! I'm actually syncing source now and going to attempt a build and so far I used parts of your write up with some updated info that I'm aware of and so far so good... Oh oh also not to mention I'm kinda sorta new to OS X.... I've always used Linux for everything Android and did some Hackintoshing and attempted to do my Android work there but compiles would kill the system and hot boot the Hackintosh cuz I don't think it was using both CPU cores and the machine was running extremely hot... I mean hot like you put your hand by the fan and the hot air would literally burn your hand.. LOL I'm actually surprised it didn't fry the board or something...
[Android Software Development] inffy:
So what changes are neede to get CM10.1 to build on Mountain Lion (OSX 10.8?)
[Android Software Development] PacerguyDon:
Bump for any updates for Mountain Lion and CM 10.1 info.

Tia!!
[Android Software Development] Zimeron:
It shouldn't take any extra work to build CM10 or 10.1 on Mountain Lion if you have CM9 compiling. It was a smooth transition for me at least.
[Android Software Development] inffy:
Should be straight forward

http://xdaforums.com/showthread.php?t=2087318
[General Questions and Answers] shahrukhraza:
hello people.

i just had a tiny question about an unlocked phone. i was wondering that if i get an unlocked phone (like the galaxy nexus) and i dont put any sim in it will i be able to use the wifi? because i dont want to pay monthly but i want the galaxy nexus. so my question is that can i use an unlocked galaxy nexus just for wifi?

thanks in advance.
[General Questions and Answers] Allanitomwesh:
I believe so,on airplane mode. But then,kinda pointless to have a phone that doesn't call ya? On an unlocked phone you can swap sims anytime you like to any network you like without being bound by contract. Get the extra sim cards and exploit off peak moments.

Imetumwa kutoka Ideos kutumia XDA
[General Questions and Answers] shahrukhraza:
yes thank you for the answer! and for your advice for the sim i forgot to tell you that im a 13 year old and i dont really need a phone right now. but i really want the galaxy nexus, and i have got a lot of money. im like *WHAT DO I BUY?* and then BOOM! the boom was because i saw the gnex only for 399 and now here i am with this question :D ;)
[General Questions and Answers] Allanitomwesh:
Well then, do proceed,It'll work. Though Galaxy Tab 7.0 Plus has a wifi only version. That makes more sense,more screen to play with and no sim card. Again, your cash,just hate to see a good phone not used as a phone.

Imetumwa kutoka U8150 kutumia XDA
[General Questions and Answers] nhoxz:
yes ! i should use wifi !
[Motorola Photon 4G] vitaminjay1982:
I'm looking for a holster with a clip to fit the commuter series for the photon. I didn't want the defender or the bs case clip combo sprint sells.

This case is perfect for me. Just missing a clip.

Thought about getting a metal clip and mounting it to the case itself.
[Motorola Photon 4G] fendergrab:
Nite Ize has a holster that will fit. It's the cargo wide holster. It's tough and holds it really secure, works perfectly for my photon in a trident case, which is a bit bigger than the commuter.
[Motorola Photon 4G] vitaminjay1982:
Link? That sounds perfect.
[Motorola Photon 4G] fendergrab:
http://www.niteize.com/collections/rugged-phone-cases/products/clip-case-cargo-wide
[Motorola Photon 4G] slimcane:
I was looking for the exact same thing. I took a chance on the Seidio HLMTPHTASA Active Holster. It fits perfectly!

Here it is on Amazon.com
[Galaxy Note GT-N7000 Themes and Apps] lfaitas:
I am using ics stunner and wanted to have the MIUI theme for settings, phone, and contacts etc... not the launcher.. is that possible?
[Galaxy Note GT-N7000 Themes and Apps] Kangal:
You can't get for Settings. To do that, you must install an actual Miui ROM.

For the contacts and phone, you can install replacements that look/function like it. I can't think of it off the top of my head, but there are some.

I don't know why you would want those two things from Miui ROM, I think they're pretty meh (unless there was a drastic change soon), the best portions of Miui is the Theme Manager, Lockscreen, Launcher (its unique), Music and Settings portions.
[Galaxy S II Q&A, Help & Troubleshooting] olster:
Hello,

Now the Galaxy S3 is on its way and has the new features like touchwiz!

Do we know if there is any news of the new touchwiz to be ported to the S2?
[Galaxy S II Q&A, Help & Troubleshooting] themadba:
Well the phone hasn't even been released to the public yet (on sale), so I would assume not yet. But wait till the developers get their hands on it, and I reckon magic will happen :)

I don't like it though, I think ICS is so much more simple and lovely, but that's my opinion. Maybe I'm also jealous I have to wait another year for an upgrade :P

Chris.
[Android Q&A, Help & Troubleshooting] harshs91:
i want to know that can we flash a HVGA (480×320) resolution custom rom to a QVGA (320×240) resolution mobile, if all other specs are same??
[Android Q&A, Help & Troubleshooting] -DarkKnight-:
nolpe

nope one has twice the pixels as the other if you flash it then ur phone will either not boot or will look disfigured if it does boot

and even if the specs are *exactly* the same you still need custom device drivers and lib files before you can make the rom work