Best way to compile Busybox? - Android Q&A, Help & Troubleshooting

After searching around , it seems there are several ways to compile Busybox.
Codesourcery toolchain direct compile method
http://mobisocial.stanford.edu/news/2011/02/compile-busybox-on-android-os/
http://omappedia.org/wiki/Android_Installing_Busybox_Command_Line_Tools
Running make gives:
gcc: error trying to exec 'cc1': execvp: No such file or directory
What exact folder belongs in the path?
What exact statement belongs for the cross compiler prefix in make menuconfig?
Source integration method
https://github.com/Gnurou/busybox-android
This method wants you to include the files with the android source and rebuild.
Is there a way to instead compile this directly?
Scripted NDK compile method
http://matrixrewriter.com/wiki/tiki-index.php?page=Building+BusyBox+binaries+for+Android
This method goes well until near the end of the script when the script returns:
/usr/include/string.h.274: error: expected ')' before '!=' token
I am completely lost after searching for this error.
Which of these three methods, if any, is best? Is there another easier way?

Related

Compile binary for testing linux kernel exploit for arm architecture

Hi,
i'm an android app developer. I have an HTC Desire and I would test kernel issue for root my device.
For check kernel or software issue, I compile on my linuxbox (on Intel) and binary file run in the same arch that compile it.
In an arm device like my android phone, how can I compile c source file?
We will say: "With an arm croos toolchain!"...
I have read http://www.hermann-uwe.de/blog/buil...-with-binutils-gcc-newlib-and-gdb-from-source that explain how to build the toolchain, but binary compiler that this steps create not compile a simple "Hello World" program:
Code:
#include <stdio.h>
int main() {
printf("Hello, World!");
return 0;
}
because not have stdio.h header... O_O
So I have downloaded the GNU ARM toolchain binary for linux, but the compiler don't work because I can't run it on my linuxbox...
Why?
mmm... So I have copied the "include" directory from GNU Arm ToolChain to toolchain compiled from source (how explaine the link above).
now stdio.h is present but...
Code:
/tmp/ccfmzOMU.s: Assembler messages:
/tmp/ccfmzOMU.s:11: Error: junk at end of line, first unrecognized character is `@'
/tmp/ccfmzOMU.s:12: Error: junk at end of line, first unrecognized character is `@'
/tmp/ccfmzOMU.s:13: Error: too many memory references for `mov'
/tmp/ccfmzOMU.s:14: Error: no such instruction: `stmfd sp!,{fp,ip,lr,pc}'
/tmp/ccfmzOMU.s:15: Error: too many memory references for `sub'
/tmp/ccfmzOMU.s:16: Error: no such instruction: `ldr r0,.L3'
/tmp/ccfmzOMU.s:17: Error: no such instruction: `bl printf'
/tmp/ccfmzOMU.s:18: Error: expecting operand after ','; got nothing
/tmp/ccfmzOMU.s:19: Error: too many memory references for `mov'
/tmp/ccfmzOMU.s:20: Error: no such instruction: `ldmfd sp,{fp,sp,pc}'
How can i build binary elf file for my Desire architecture?
Thanks in andvance!
I am unable to link to any resources here due to them being behind a corporate firewall, but this link I found might help:
http://www.ibm.com/developerworks/linux/library/l-arm-toolchain/index.html
Here is a link to the tools:
http://www.codesourcery.com/sgpp/lite/arm/portal/[email protected]=lite
Let me know if this is not what you are looking for.
Yes, this is what I need.
Thanks!
Now I've tried to compile my hello world in C for ARM, but the binary not run on my desire... I think that I have compiled with a mistake mcpu parameter.
The result is that if I copy helloworld binary in /data/local path in my Desire, set execution permission and execute the program:
Code:
$ ./helloworld
./helloworld
./helloworld: not found
the output of 'ls -l' command show that helloworld file exist and have 'x' permission...
So I think that is an incompatibily issue of the binary file...
Which one "-mcpu" value is correct for the Qualcomm Snapdragon QSD8250 inside HTC Desire?
I've tried any arm7* but it's the same... "not found".
Any ideas?
@azatoth
I get the same on my hero. Tried to run it on a other arm device (Linksys NSLU2) the same "not found" appears
mopodo said:
@azatoth
I get the same on my hero. Tried to run it on a other arm device (Linksys NSLU2) the same "not found" appears
Click to expand...
Click to collapse
Do you have found a solution for that?
I have no real way to test this, but the Snapdragon is a Cortex-A8 I believe... Try the following:
Code:
-mcpu=cortex-a8 -mfpu=neon
I hope this works, let me know if the behavior changes...
Vermithrax said:
I have no real way to test this, but the Snapdragon is a Cortex-A8 I believe... Try the following:
Code:
-mcpu=cortex-a8 -mfpu=neon
I hope this works, let me know if the behavior changes...
Click to expand...
Click to collapse
don't work yet... the response is always the same: not found...
you are linking to the wrong libc, you have to link to bionic... Are you using the full android build compiler?

[Q] How to compile wpa_supplicant from AOSP

Hi,
I have downloaded the s2 kernel from github GalaxySII/samsung-kernel-galaxysii and can successfully compile with the Sourcery toolchain.
I want to compile wpa_supplicant 0.6 so that I can use the client (wpa_cli) on my phone. I have downloaded the source from the AOSP repository android-git-kernel-org/platform/external/wpa_supplicant_6
So I now have the source in directory called "external/wpa_supplicant_6" in the root directory of my s2 kernel source.
The .config file looks OK and I have edited Android.mk in external/wpa_supplicant_6/wpa_supplicant so that it contains the line:
WPA_BUILD_SUPPLICANT := true
In directory external/wpa_supplicant_6/wpa_supplicant I type "make" and get lots of errors about undeclared variables.
Can anyone suggest what my error is?
Thanks,
NT
I know that is a very old post, but is a good question.
I'm interested to build wpa_supplicant v2.3 and 2.1 without to rebuild the entire android os.
But, like you i've a huge amount of problems.

Best way to compile tcpdump?

References:
http://nerdjusttyped.blogspot.com/2...nology.com/index.php/Cross_Compiling_on_Linux
http://androidap.blogspot.com/2010/11/tcpdump-for-android.html
http://wiki.neurostechnology.com/index.php/Cross_Compiling_on_Linux
Is the Openmoko toolchain the best one to use for this? If so, which file from the link would I need for 64 bit Debian Squeeze?
http://downloads.openmoko.org/developer/toolchains/
ndk-build needs an Android.mk file so that is not going to work easily.
agcc only does .c files and not complicated projects with a makefile so that is not going to work easily. If it does please correct me.
this command:
CC=arm-linux-gcc./configure --host=arm-linux --with-pcap=linux
or this command:
CC=arm-angstrom-linux-gnueabi-gcc ./configure --host=arm-linux --with-pcap=linux
gives:
"error: C compiler cannot create executables".
So if I remove CC entirely:
./configure --host=arm-linux --with-pcap=linux
make
These lines will build and make libpcap ok and configure tcpdump ok. But when making tcpdump it fails with "error: ppi.h: No such file or directory".
Thanks for any help.

(Q) First time Compiling

Ok, I setup my 2 build boxes. One Ubuntu 11.10x64 and one Mint 11x86. Installed required packages and downloaded multiple toolchains. I have tried compiling on both machines and on both I get the same errors.
make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'. Stop.
make: *** Waiting for unfinished jobs....
CHK include/linux/version.h
I have tried make thunderc_perf_defconfig and get the same error. Copied .config from device dropped into source, same error.
Any ideas on what is going on? I'm new to this so any help would be great.
I don't known, maybe gcc
try checking your mount options?
Nope its not gcc; as I said I have installed all required packages including gcc + bison etc. My mount options? Is that the "export ARCH=arm" ? Where I have to set the default compiler? I'm new to the newer flavors of linux. The last distro I used was Mandrake 7.1 ;-) Now I am testing this on 2 builds; an x64 Ubuntu and a x86 Mint(Which is Ubuntu). I have to be missing something on both, but I have followed tutorials guides to the T and still get this error. I get more errors than this by the way. The compiler kicks back Kconfig saying unexpected line of code.
SgtPropain said:
Ok, I setup my 2 build boxes. One Ubuntu 11.10x64 and one Mint 11x86. Installed required packages and downloaded multiple toolchains. I have tried compiling on both machines and on both I get the same errors.
make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'. Stop.
make: *** Waiting for unfinished jobs....
CHK include/linux/version.h
I have tried make thunderc_perf_defconfig and get the same error. Copied .config from device dropped into source, same error.
Any ideas on what is going on? I'm new to this so any help would be great.
Click to expand...
Click to collapse
I ran a search on your error message about the missing rule to make auto.conf and found this:
https://bbs.archlinux.org/viewtopic.php?id=99089
It relates to the other poster's comment about checking your mount options. It's a short process to fix it.
And if it doesn't work maybe it will at least give you a new error message to research.
glarepate said:
I ran a search on your error message about the missing rule to make auto.conf and found this:
https://bbs.archlinux.org/viewtopic.php?id=99089
It relates to the other poster's comment about checking your mount options. It's a short process to fix it.
And if it doesn't work maybe it will at least give you a new error message to research.
Click to expand...
Click to collapse
just as i thought. that might have happened. its worth a try though.
SgtPropain said:
Nope its not gcc; as I said I have installed all required packages including gcc + bison etc. My mount options? Is that the "export ARCH=arm" ? Where I have to set the default compiler? I'm new to the newer flavors of linux. The last distro I used was Mandrake 7.1 ;-) Now I am testing this on 2 builds; an x64 Ubuntu and a x86 Mint(Which is Ubuntu). I have to be missing something on both, but I have followed tutorials guides to the T and still get this error. I get more errors than this by the way. The compiler kicks back Kconfig saying unexpected line of code.
Click to expand...
Click to collapse
Wrong...
Because you don't have .config file in the source. If you are building kernel from source, you must have the kernel config. That kernel config can be shared in the source code, it depends on that kernel developer, he can shared it in arch/arm/config, access to there then find that kernel defconfig. Or you can get the kernel config of that kernel with another method, but this method just can be applied if the kernel you want to build is for our device: flash that kernel then go to terminal then type:
Code:
su
(Accept the super user)
Code:
cp /proc/config.gz /sdcard
If it show "No such file or directory found" so you should ask that kernel developer for their .config.
If it doesn't show anything, go to sdcard and find if there is a file that named config.gz, it's the kernel config. Get back to terminal then type:
cd /sdcard
gunzip config.gz
Voila!
I actually tried that already.... I have been at this for about three days. XDA was my last resort as I like to figure things out on my own. However I'm stuck @ a brick wall. I have edited /etc/fstab and removed the bs mount options..remounted same error. Mind you I'm doing most of this from a Virtual Environment. Starting to think this is my issue, but it doesn't explain the same error on machine #2. Maybe I'm doing it right, possibly a bad git clone?
thachtunganh said:
Wrong...
Because you don't have .config file in the source. If you are building kernel from source, you must have the kernel config. That kernel config can be shared in the source code, it depends on that kernel developer, he can shared it in arch/arm/config, access to there then find that kernel defconfig. Or you can get the kernel config of that kernel with another method, but this method just can be applied if the kernel you want to build is for our device: flash that kernel then go to terminal then type:
Code:
su
(Accept the super user)
Code:
cp /proc/config.gz /sdcard
If it show "No such file or directory found" so you should ask that kernel developer for their .config.
If it doesn't show anything, go to sdcard and find if there is a file that named config.gz, it's the kernel config. Get back to terminal then type:
cd /sdcard
gunzip config.gz
Voila!
Click to expand...
Click to collapse
Yeah that would be great if I hadn't done that already. In my post I stated I had replaced the .config from my device. I have literately tried everything but doing this from base. IE not from a VM. I appreciate the help but its a "no go".
Beginning of my .config for proof
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.32.9-ck2
# Wed Apr 11 20:41:44 2012
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_GENERIC_GPIO=y
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_KTIME_SCALAR=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_ARCH_HAS_CPUFREQ=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
CONFIG_VECTORS_BASE=0xffff0000
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_CONSTRUCTORS=y
Setting up a third independent machine Ubuntu x86 testing..
where do you get that .config from?
pull /proc/config.gz
SgtPropain said:
pull /proc/config.gz
Click to expand...
Click to collapse
What device are you using, and what kernel are you using.
for the time being you can use prebuilt kernel...no need to build kernel from source....
williamcharles said:
for the time being you can use prebuilt kernel...no need to build kernel from source....
Click to expand...
Click to collapse
He isn't building ROM from source. He is learning how to build a kernel from source.
Sorry for the delay; had 2 deaths in the family.
I setup my third box and again I get the same results. I really don't know where I'm going wrong. This kinda makes me lean to, I have bad source code. I'm no pro C programmer; however when building I get Kconfig errors. I opened said file and the comments look all messed up. The compiler I think is reading the comments as code and kicking it back giving me this error.
by the way what are you compiling and please teach me compiling i want to learn it .
I'm compiling a modified kernel for the Optimus V. I can't teach you how to compile because I don't even know if I'm doing it right.

[ISSUE] Compile cyanoboot: No rule to make target

Hi,
I'm trying to compile the cyanoboot project found at: github.com/CMNookTablet/acclaim_cyanoboot. I have no experience with c++ compiling but I've followed the read-me and seem to have hit a brick wall. I've extracted the downloaded source files and navigated to them in cygwin, I then run the command:
make clean
which looks like it is successful. After that I run
make omap4430sdp_config
which also seems to work but doesn't create any files(not sure if it should?). Then, when I run the final make command I get the error:
makefile:98: /cygdrive/c/cyanoboot/config.mk: No such file or directory
make: *** No rule to make target `/cygdrive/c/cyanoboot/config.mk'. Stop.
This config.mk file definitely does exist, you can see it at the git hub link above and I haven't changed any files. I've been struggling with this for a few hours now and I just cant figure it out. Any help is much appreciated. Thanks.

Categories

Resources