Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1.x android #1307

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ deps/icu*.zip
deps/icu*.tgz
deps/icu-tmp
./node_modules
android-toolchain/
.svn/

# generated by gyp on Windows
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ To run the tests:
> vcbuild test
```

### Android / Android based devices, aka. Firefox OS

Be sure you have downloaded and extracted [Android NDK]
(https://developer.android.com/tools/sdk/ndk/index.html)
before in a folder. Then run:

```
$ ./android-configure /path/to/your/android-ndk
$ make
```

### `Intl` (ECMA-402) support:

[Intl](https://github.com/joyent/node/wiki/Intl) support is not
Expand Down
10 changes: 5 additions & 5 deletions android-configure
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
export TOOLCHAIN=$PWD/android-toolchain
mkdir -p $TOOLCHAIN
$1/build/tools/make-standalone-toolchain.sh \
--toolchain=arm-linux-androideabi-4.7 \
--toolchain=arm-linux-androideabi-4.9 \
--arch=arm \
--install-dir=$TOOLCHAIN \
--platform=android-9
export PATH=$TOOLCHAIN/bin:$PATH
export AR=arm-linux-androideabi-ar
export CC=arm-linux-androideabi-gcc
export CXX=arm-linux-androideabi-g++
export LINK=arm-linux-androideabi-g++
export AR=$TOOLCHAIN/bin/arm-linux-androideabi-ar
export CC=$TOOLCHAIN/bin/arm-linux-androideabi-gcc
export CXX=$TOOLCHAIN/bin/arm-linux-androideabi-g++
export LINK=$TOOLCHAIN/bin/arm-linux-androideabi-g++

./configure \
--dest-cpu=arm \
Expand Down
14 changes: 12 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -431,14 +431,20 @@ def is_arch_armv7():
return ('__ARM_ARCH_7__' in cc_macros_cache or
'__ARM_ARCH_7A__' in cc_macros_cache or
'__ARM_ARCH_7R__' in cc_macros_cache or
'__ARM_ARCH_7M__' in cc_macros_cache)
'__ARM_ARCH_7M__' in cc_macros_cache or
'__ARM_ARCH_7S__' in cc_macros_cache)


def is_arch_armv6():
"""Check for ARMv6 instructions"""
cc_macros_cache = cc_macros()
return ('__ARM_ARCH_6__' in cc_macros_cache or
'__ARM_ARCH_6M__' in cc_macros_cache)
'__ARM_ARCH_6M__' in cc_macros_cache or
'__ARM_ARCH_6J__' in cc_macros_cache or
'__ARM_ARCH_6K__' in cc_macros_cache or
'__ARM_ARCH_6Z__' in cc_macros_cache or
'__ARM_ARCH_6ZK__' in cc_macros_cache or
'__ARM_ARCH_6T2__' in cc_macros_cache)


def is_arm_hard_float_abi():
Expand Down Expand Up @@ -508,6 +514,10 @@ def configure_arm(o):
o['variables']['arm_thumb'] = 0 # -marm
o['variables']['arm_float_abi'] = arm_float_abi

if options.dest_os == 'android':
o['variables']['arm_fpu'] = 'vfpv3'
o['variables']['arm_version'] = '7'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all SDK-supported devices ARMv7?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No they aren't but V8 only compiled to me for ARMv7 devices using vfpv3 or up arguments (like VFPv3-D16, VFPv3-D32, etc) are supported to compile. ARMv6 should be compiled with VFPv2 that is not supported for V8 anymore.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, fair enough. If you can remove the unused function and squash the commits into a single commit with a nice commit log (see git log configure for examples), I'll land it for you.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we touching the armv6 block in this commit if this is specifically targetting only armv7?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added those macros just as plus to complete the list of ARM macros in compilers. Are not a must have to compile for Android but is good to have a complete list of macros.


# Print warning when snapshot is enabled and building on armv6
if is_arch_armv6() and options.with_snapshot:
warn('when building on ARMv6, don\'t use --with-snapshot')
Expand Down