build android adb for arm processor - android-ndk

I want to use Android ADB tool on ARM platform. One of the commands in the build script is:
arm-eabi-g++
-I build/libs/host/include/host
-I build/libs/host/include
-I build/libs/host
-I out/host/linux-arm/obj/STATIC_LIBRARIES/libhost_intermediates
-I dalvik/libnativehelper/include/nativehelper
-I system/core/include
-I hardware/libhardware/include
-I hardware/libhardware_legacy/include
-I hardware/ril/include
-I dalvik/libnativehelper/include
-I frameworks/base/include
-I frameworks/base/opengl/include
-I frameworks/base/native/include
-I external/skia/include
-I tools/include
-I out/host/linux-arm/obj/include
-I prebuilt/ndk/android-ndk-r5b/platforms/android-9/arch-arm/usr/include
-c -fno-exceptions -Wno-multichar -fPIC
-include system/core/include/arch/linux-arm/AndroidConfig.h
-D_FORTIFY_SOURCE=0
-DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG
-DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Wsign-promo -DNDEBUG -UDEBUG
-MD -o out/host/linux-arm/obj/STATIC_LIBRARIES/libhost_intermediates/pseudolocalize.o
build/libs/host/pseudolocalize.cpp
I have made sure I have the latest ndk-r5b installed, which is supposed to resolve the STL problem. However, I am still getting the following error:
In file included from build/libs/host/pseudolocalize.cpp:1:
build/libs/host/include/host/pseudolocalize.h:4:18: error: string: No such file or directory
In file included from build/libs/host/pseudolocalize.cpp:1:
build/libs/host/include/host/pseudolocalize.h:6: error: 'string' in namespace 'std' does not name a type
build/libs/host/pseudolocalize.cpp: In function 'const char* pseudolocalize_char(char)':
build/libs/host/pseudolocalize.cpp:61: error: 'NULL' was not declared in this scope
build/libs/host/pseudolocalize.cpp: At global scope:
build/libs/host/pseudolocalize.cpp:71: error: 'string' does not name a type
Does anyone know how to fix this problem? BTW the building of the intel version of adb works fine by following this link:
http://lackingrhoticity.blogspot.com/2010/02/how-to-build-adb-android-debugger.html

pseudolocalize.cpp is not needed for adb. And NDK toolchain is intended to build with bionic(Android libc). adb requires glibc(GNU libc) to build.
I created a Makefile to compile adb for Linux/ARM. This Makefile makes statically linked adb executable binary for Linux/ARM, thus it works on Android/ARM as well.
standalone Makefile for adb
How to make.
Install Sourcery G++ Lite for ARM and GNU Make.
Download "Android source code".
Save Makefile as system/core/adb/Makefile.
cd system/core/adb; make.

If you need to build the ADB (version 1.0.31) for ARM take a look here.
The repository contains an all-in-one build script and also a pre-compiled binary for ARM.

I see the post is quite old, anyway it helped me.
I did not found
"Sourcery G++ Lite for ARM and GNU Make."
But manage to build/run on/for my ARMv7, following the other steps with gcc 4:4.6.3-1ubuntu5
N/A
Download "Android source code".
Save Makefile as system/core/adb/Makefile.
3b. Edit Makefile to CC= gcc and LD= gcc
cd system/core/adb; make.

You can simply run the command
sudo apt install adb
it can handle ARM architecture

Related

threading.h:10:24: fatal error installation error

Fairly unknowledgable linux (ubuntu 14.04) user here. I'm trying to install a bioinformatics program called Bowtie2 - I get this error and not sure where it's coming from. They did quote this on their website which might have something to do with it, but didn't mention it as a dependency.
TBB is now the default threading library. We consistently found TBB to
give superior thread scaling. It is widely available and widely
installed. That said, we are also preserving a "legacy" version of
Bowtie that, like previous releases, does not use TBB. To compile
Bowtie source in legacy mode use NO_TBB=1. To use legacy binaries,
download the appropriate binary archive with "legacy" in the name.
sam#SumnerLab-Computer:~/Program_Files/bowtie-1.2$ make
g++ -w -O3 -m64 -DCOMPILER_OPTIONS="\"-O3 -m64 -Wl,--hash-style=both -DWITH_TBB -DPOPCNT_CAPABILITY -DNO_SPINLOCK -DWITH_QUEUELOCK=1 \"" -Wl,--hash-style=both -DWITH_TBB -DPOPCNT_CAPABILITY -DNO_SPINLOCK -DWITH_QUEUELOCK=1 \
-fno-strict-aliasing -DBOWTIE_VERSION="\"`cat VERSION`\"" -DBUILD_HOST="\"`hostname`\"" -DBUILD_TIME="\"`date`\"" -DCOMPILER_VERSION="\"`g++ -w -v 2>&1 | tail -1`\"" -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DPREFETCH_LOCALITY=2 -DBOWTIE_MM -DBOWTIE_SHARED_MEM -DNDEBUG -Wall \
-I SeqAn-1.1 -I third_party -I third_party \
-o bowtie-build-s ebwt_build.cpp \
ccnt_lut.cpp ref_read.cpp alphabet.cpp shmem.cpp edit.cpp ebwt.cpp bowtie_build_main.cpp \
-lpthread -ltbb -ltbbmalloc_proxy
In file included from pat.h:17:0,
from sequence_io.h:12,
from multikey_qsort.h:8,
from diff_sample.h:8,
from blockwise_sa.h:13,
from ebwt.h:27,
from ebwt_build.cpp:11:
threading.h:10:24: fatal error: tbb/mutex.h: No such file or directory
compilation terminated.
Makefile:259: recipe for target 'bowtie-build-s' failed
make: *** [bowtie-build-s] Error 1
Any ideas what the issue might be?
thanks
You'll probably need to install the package TBB development package, e.g. libtbb-dev.
On Ubuntu, run sudo apt-get install libtbb-dev
​sudo apt-get install libtbb-dev
​make

Compiling program with Open Source libFTDI

I use Asus router (based on ARMv7 proc) with Advanced Tomato installed
on it as my ARMv7 developer platform. I install compiler (gcc - 5.4.0-1)
plus dependencies and libFTDI (libftdi1 - 1.3-1) from OpenWRT Linux
repo. OpenWRT does not provide libftdi-dev so I copied ftdi.h file from libFTDI download page to /opt/include directly. I try to compile program taken directly from libFTDI samples. The
compiler command is:
gcc -v -Wl,-rpath=/opt/usr/local/lib -Wl,--dynamic-linker=/opt/lib/ld-linux.so.3 -L/opt/lib -O2 -pipe -march=armv7-a -mtune=cortex-a9-fno-caller-saves -mfloat-abi=soft -l ftdi1 d.c -o d
But compilation fails because:
/opt/bin/ld: cannot find -lftdi1
But there is /opt/usr/local/lib/libftdi1.so linked to libftdi1.so.2
My LD_LIBRARY_PATH looks like this:
/lib:/usr/lib:/usr/local/lib:/opt/lib:/opt/usr/lib:/opt/include:/opt/usr/local/lib:/opt/usr/include
So what the problem is?
I dont know why (probably bug) but for compiler taken from OpenWRT repo, MUST have wanted library in /opt/lib. So simply copy libftdi1.so.2.3.0 file and linking it to libftdi1.so resolved problem. That means that it does not use correctly LD_LIBRARY_PATH variable. Finally compilation command looks like this:
gcc -v -Wl,-rpath=/opt/usr/local/lib -Wl,--dynamic-linker=/opt/lib/ld-linux.so.3 -L/opt/lib -O2 -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -mfloat-abi=soft -l ftdi1 arco.c -o arco
From my point of view - topic closed

Linker error in Codelite with MinGW-w64

I'm trying to use MinGW-W64 instead of MinGW in Codelite. When I compile simple "hello, world" project it's all right. But when I try to link some libraries, I get a strange linker error. Project with exactly same settings compiles by MinGW with any problems. There are build output for both variants:
MinGW GCC 4.8.1
`C:\Windows\system32\cmd.exe /C D:/apps/mingw/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ code - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'D:/Projects/codelite/code'
codelite-cc D:/apps/mingw/bin/g++.exe -c "D:/Projects/codelite/code/src/main.cpp" -Wfatal-errors -g -O0 -pedantic -W -std=c++11 -Wall -o ./Debug/src_main.cpp.o -I./inc/
D:/apps/mingw/bin/g++.exe -o bin/code #"code.txt" -L./lib/ -lopengl32
mingw32-make.exe[1]: Leaving directory 'D:/Projects/codelite/code'
====0 errors, 0 warnings====`
MinGW-W64 GCC 5.2.0
`C:\Windows\system32\cmd.exe /C D:/apps/mingw-w64/mingw32/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ code - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'D:/Projects/codelite/code'
codelite-cc D:/apps/mingw-w64/mingw32/bin/g++.exe -c "D:/Projects/codelite/code/src/main.cpp" -Wfatal-errors -g -O0 -pedantic -W -std=c++11 -Wall -o ./Debug/src_main.cpp.o -I./inc/
D:/apps/mingw-w64/mingw32/bin/g++.exe -o bin/code #"code.txt" -L./lib/ -lopengl32
g++.exe: error: #code.txt -L./lib/: No such file or directory
mingw32-make.exe[1]: *** [bin/code] Error 1
code.mk:78: recipe for target 'bin/code' failed
mingw32-make.exe[1]: Leaving directory 'D:/Projects/codelite/code'
mingw32-make.exe: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
====1 errors, 0 warnings====`
This looks like a bug in your toolchain and not in CodeLite.
There is a space between the "#code.text" and -L./lib and for some reason g++ does not see it...
I put my money on the mingw32-make tool. You can tell CodeLite to use the mingw32-make.exe from the 4.8.1 version (which worked): settings->build settings->compilers->[YOUR COMPILER NAME]->Make
Another option is to disable the option that tells CodeLite to generate Makefile that passes the object list via file to the compiler:
Settings->Build Settings->compilers->[YOUR COMPILER NAME]->Advanced tab and uncheck the option: pass object list to the linker via file
Lately i too have found the similar problem. Later i was able to figure out the issue. We just to need to go to the project settings under change makefile generator default to codelite makefile generator i think that will work.

Cross Compile gsoap 2.8. for arm

i want to cross compile gsoap for arm-linux and this is my configuration command
./configure CC="arm-linux-gcc" CROSS_COMPILER="arm-linux-" ARCH="arm" --host=arm-linux LR="arm-linux-lr" LD="arm-linux-ld" LDFLAGS="-static" --enable-static --enable-samples --disable-openssl --prefix=/usr/local/gsoap-2.8 CXX="arm-linux-g++"
and i get this error after running make
arm-linux-gcc -DHAVE_CONFIG_H -I. -I../.. -DWITH_YACC -DWITH_LEX -DSOAPCPP_IMPORT_PATH="\"/usr/local/gsoap-2.8/share/gsoap/import\"" -DLINUX -g -O2 -MT soapcpp2-soapcpp2_yacc.o -MD -MP -MF .deps/soapcpp2-soapcpp2_yacc.Tpo -c -o soapcpp2-soapcpp2_yacc.o test -f 'soapcpp2_yacc.c' || echo './'soapcpp2_yacc.c
mv -f .deps/soapcpp2-soapcpp2_yacc.Tpo .deps/soapcpp2-soapcpp2_yacc.Po
/bin/bash ../../ylwrap soapcpp2_lex.l .c soapcpp2_lex.c -- /bin/bash /home/glassess/local/arm/gsoap-2.8/missing --run flex
make[4]: * [soapcpp2_lex.c] Error 1
so whats wrong,i must compile yacc and bison my self for arm-linux
so whats wrong,i must compile yacc and bison myself for arm-linux
You need to install flex for your build environment in order to be able to be executed by make (then not the cross-compiled one).
When I cross compile gSOAP the build output looks like:
/bin/bash ../../ylwrap soapcpp2_lex.l lex.yy.c soapcpp2_lex.c -- flex -l
In yours there is no flex command.
Probably configure flex detection failed.
You probably need to check if flex is available from your build environement, running flex -h or which flex.
compile dont need continue more for me, because i just need lib file and its create before this error

help installing libpcap on cygwin

i was trying to install libpcap under cygwin on windows 7 but i had this error:
$ ./configure
.
.
.
.
.
configure: error: see the INSTALL for more info
how can i solve this?
i am using libpcap-1.0.0 which is the latest version.
http://mathieu.carbou.free.fr/wiki/index.php?title=How_to_install_Winpcap_/_Libpcap_under_Cygwin
libpcap develop pack can be found from
http://www.winpcap.org/devel.htm
steps in detail as follows:
Setup Winpcap
Download and unzip the pack. We will use for this example WpdPack_4_0_1.zip.
Copy libraries like this:
WpdPack\Lib\libpacket.a to cygwin\lib\
WpdPack\Lib\libwpcap.a to cygwin\lib\
Create a folder cygwin\usr\include\pcap\
Copy all headers from WpdPack\Include to cygwin\usr\include\winpcap\
Be sure you have installed Winpcap libraries and that they are in your path by typing:
which packet.dll
which wpcap.dll
For me they are in /cygdrive/c/WINDOWS/system32/
Building example using Cygwin
Open a cygwin prompt to WpdPack\Examples-pcap\basic_dump\ and execute:
basic_dump:
CFLAGS="-g -Wall -mno-cygwin -I /usr/include/pcap"
LIBS="-lwpcap"
PROG="basic_dump"
gcc $CFLAGS -c $PROG.c
gcc $CFLAGS -o $PROG.exe $PROG.o $LIBS
./$PROG.exe
basic_dump_ex:
CFLAGS="-g -Wall -mno-cygwin -I /usr/include/pcap"
LIBS="-lwpcap"
PROG="basic_dump_ex"
gcc $CFLAGS -c $PROG.c
gcc $CFLAGS -o $PROG.exe $PROG.o $LIBS
./$PROG.exe
iflist:
CFLAGS="-g -Wall -mno-cygwin -I /usr/include/pcap"
LIBS="-lwpcap"
PROG="iflist"
gcc $CFLAGS -c $PROG.c
gcc $CFLAGS -o $PROG.exe $PROG.o $LIBS
./$PROG.exe
pcap_filter (and others):
I think you can catch the pattern ;) Only replace PROG=... by the program name and it should compile.
UDPdump:
CFLAGS="-g -Wall -mno-cygwin -I /usr/include/pcap"
LIBS="-lwpcap -lwsock32"
PROG="UDPdump"
gcc $CFLAGS -c $PROG.c
gcc $CFLAGS -o $PROG.exe $PROG.o $LIBS
./$PROG.exe
You can test by doing a Time Synchronization with pool.ntp.org for
example.
The libpcap source includes part, but not all, of the Windows support. The mechanisms used to capture network traffic are very OS-dependent (which is why libpcap exists - to hide that detail from applications).
On UN*Xes, the mechanism is part of the OS, so libpcap doesn't have to provide that mechanism.
On Windows, there's no such mechanism in the OS, so WinPcap combines a kernel-mode driver, a low-level library that talks to the driver, and a module for libpcap that uses the low-level library.
The libpcap source doesn't include the driver or the low-level library, so it's not sufficient to build a version of libpcap for Windows.
As the other answers indicate, you need WinPcap.
I know this is a late reply, but I just went through the same install issues on Windows 7.
On Windows, you should use Winpcap: http://www.winpcap.org/

Resources