Presentation from Massimiliano Torregiani (@MaxTorregiani) at the Intel Codefest Milano on February 13th 2014 at Mediateca
http://codefestmilano.bemyapp.com
2. Android SDK e NDK
Programmazione SDK
compile once, run everywhere
Programmazione NDK
some
compile once, run everywhere
oppure
oppure
2
3. Concetti di Xcompilazione
nativa
Sistema Host
E’ il sistema dove il compilatore è installato e su cui
avviene la compilazione
Sistema target
E’ il sistema dove l’eseguibile generato su host sara’
eseguito.
Cosa serve per la compilazione?
•
Toolchain (compilatore, linker, archiver, assembler, etc)
•
Header file delle librerie
•
Librerie standard, dei framework e altre librerie
accessorie cross-compilate per il sistema target
3
4. Pacchetto NDK di Google
Il pacchetto NDK fornito da Google comprende:
Target Architecture
• ARMv5TE
&
ARMv7-‐A
• MIPS
• X86
-‐
Intel
Atom
Target operative system
Tipo e versione compilatore
(e.g.
GCC
4.8)
4
7. Differenze tra architettura
ARM e X86
Memory Alignment
struct TestStruct {
int mVar1;
long long mVar2;
int mVar3;
};
GCC flag “-malign-double”
By Default
“Double Margin”
By default
No margin
7
8. Differenze tra architettura
ARM e X86
Memory
Big
or
li/le
endian
order
Alignment
(ARM
is
bi-‐endian)
Floating
Point
li/le-‐endian
assembly
ARMv5
à
So@
FP
opts
Intel
Atom
à
IA-‐32
ARMv7
à
Hardware
FPU
instrucJons,
Hardware
Based
instrucJons
(VFP)
FP
opts
SIMD
ARMv5
à
No
SIMD
ext
Intel
Atom
à
SSSE3
(Supplemental
extensions
ARMv7
à
NEON
ext
Streaming
SIMD
Extensions
3)
8