I read about the requirements of NDK programming on Windows which said we require Cygwin.Read about Cygwin which said we require it coz it is a way to make Windows support some linux functionality.But my question is in which stage of programming(Where Exactly) Cygwin will be required and why? Addidtional info about this topic is most welcomed
Android NDK starting with revision 7 doesn't require Cygwin. See here: http://developer.android.com/sdk/ndk/index.html
You can now build your NDK source files on Windows without Cygwin by calling the ndk-build.cmd script from the command line from your project path. The script takes exactly the same arguments as the original ndk-build script. The Windows NDK package comes with its own prebuilt binaries for GNU Make, Awk and other tools required by the build. You should not need to install anything else to get a working build system.
It mentions you can not use ndk-gdb script without Cygwin. While that is true, you can actually use gdb executable directly without Cygwin, only then you'll need to set it up properly manually.
At least NDK-r8b, if you want to build your .so, you don't need Cygwin.
However, if you want to use ndk-gdb to debug your native code,you have to use Cygwin.
And, in my experiment, if you ndk-gdb your native under Cygwin to debug native code which is built from windows cmd, ndk-gdb seems cannot recognize the debug info. So, for debug purpose, I build native Cygwin.
Make command to execute Android.mk file.
Android.mk file consists of list of c/c++ files to be compiled and also the library name(.so).
(from NDK-r8e NDK-GDB document) At the moment 'ndk-gdb' requires a Unix shell to run. This means that Cygwin is required to run it on Windows. We hope to get rid of this limitation in a future NDK release.
Related
I am trying to debug a C++ Android application using Android NDK r20.
The project used to use the old way of building using ndk-build and the android.mk file.
Now the project is migrated to using gradle and cmake. Because of this, the ndk-gdb script no longer works, since it uses the old build system which expects an android.mk file.
So how am I supposed to debug from the command line using the latest ndk along with a gradle/cmake build system? Is there a new script that is provided?
ndk-gdb doesn't know how to do it out of the box right now. You can set up some symlinks in a gradle project to make the directory layout match a standalone ndk-build project which will let ndk-gdb work. See https://android.googlesource.com/platform/ndk/+/refs/heads/master/samples/NdkGdbSample/ for an example.
ndk-gdb doesn't work at all with CMake though.
See https://github.com/android-ndk/ndk/issues/1024 (I assume that's actually you that filed it). I don't know when we'll be able to do it, but what's described there is essentially what we'll do. We'll keep the existing script, get it to work with gradle projects, and (eventually) switch it to lldb under the covers.
Using Android Studio is your best bet for native debugging on Android right now.
I'm building gcc for Android on CentOS using the cross-compile toolchain generated by running the make-standalone-toolchain.sh script in the Android NDK, and the gcc source files from the downloaded Android NDK toolchain sources. The GMP sources were obtained by running the download_prerequisites script located in the gcc/contrib folder.
I've specified --build=x86_64-linux and --host=arm-linux-eabi, cross compile tools are set in the env variables, and specified when running configure. I've run ../gcc-4.7/configure, then make -d. Make fails when building gmp with /bin/sh. ./gen-fac_ui. Cannot execute binary.
The specific command is: ./gen-fac_ui $(BITS_PER_MP_LIMB) $(GMP_NAIL_BITS) >mpz/fac_ui.h || (rm -f mpz/fac_ui.h; exit 1)
I'm guessing the execution fails because I'm using cross-compile tools and the gen-fac_ui binary won't run on CentOS. My question is: is there another way to generate mpz/fac_ui.h as a work around?
I've also tried running make -d -i, which finishes successfully but seems to skip building key files...like gcc or g++
Short Answer:
I needed the native (i.e for CentOS) GCC tools to build and run gen-fac_ui.
Long Answer:
This is my post at the OSDev forum, where I basically asked the same question and got an answer. It also contains my error (and correction) of not having glibc-devel installed for the
native GCC toolchain.
In addition, since the base version of GCC for my build system was 4.4.7 and I was trying to cross-native build 4.7, I had to get the developer toolset, which can be installed via yum. Information on the toolset is here and easy install instructions are here
FWIW, I'm still not entirely sure how I was supposed to determine that gen-fac_ui needed to be made by a gcc native to the build machine...other than there was no other way I could find to generate fac_ui.h and other headers.
Part of my build script requires that I run ndk-build, which apparently isn't on the PATH on the Cloudbees box because it chokes on the command. Does Cloudbees have the NDK installed somewhere I can point to?
Short term solution could be to upload http://developer.android.com/tools/sdk/ndk/index.html linux tar.gz in your private repository on cloudbees and add a pre-build step to expand it from /private/ to /tmp.
I have a Linux library that needs to be compiled under Android. I understand that should be used to build this program: / home/user/android-ndk/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc and then compile a ndk-build . I think right? Assembly via the utility should work correctly?
You need to install the Native Development Kit (NDK) and read through the documentation in the NDK about the build process. The NDK basic info is at http://developer.android.com/sdk/ndk/index.html, and you'll need to install an appropriate version of Cygwin (if you're using Windows).
It comes with a prebuilt compiler, so you shouldn't have to rebuild that.
I was just suggested to port some signal processing code to use the Android NDK to speed up the process, but I'm wondering 1. where to install it to and 2. what tool-chain to use
I'd prefer not downloading the 3.5GB Mac Developer Tools if possible. I don't have access to an install cd that has it. Want to try and get this done asap. Does anyone know a way to get NDK development running quickly on OSX(snow leopard)?
A version of make is included with the Android NDK. Simply add {NDK install dir}/prebuilt/darwin-x86/bin to your PATH and you'll be able to build with the NDK.
Unzip the NDK package for Mac OS X anywhere, then add it to your path. That's all you need to build code with the NDK. The NDK includes its own GCC-based toolchain, so you don't even need to have Xcode installed.
Go to the samples in the NDK and type ndk-build in the console to build them.
If you install Xcode, that will install Make.