Commit ee57e14c authored by machenbach's avatar machenbach Committed by Commit bot

android: Use libc++ instead of stlport.

Useful for example for using atomicops_internal_portable.h on Android.

BUG=v8:4615
LOG=y

patch from issue 1525813002 at patchset 1 (http://crrev.com/1525813002#ps1)

Review URL: https://codereview.chromium.org/1637473003

Cr-Commit-Position: refs/heads/master@{#33804}
parent a13e0af5
...@@ -316,9 +316,8 @@ ...@@ -316,9 +316,8 @@
['android_ndk_root==""', { ['android_ndk_root==""', {
'variables': { 'variables': {
'android_sysroot': '<(android_toolchain)/sysroot/', 'android_sysroot': '<(android_toolchain)/sysroot/',
'android_stlport': '<(android_toolchain)/sources/cxx-stl/stlport/', 'android_stl': '<(android_toolchain)/sources/cxx-stl/',
}, },
'android_include': '<(android_sysroot)/usr/include',
'conditions': [ 'conditions': [
['target_arch=="x64"', { ['target_arch=="x64"', {
'android_lib': '<(android_sysroot)/usr/lib64', 'android_lib': '<(android_sysroot)/usr/lib64',
...@@ -326,14 +325,16 @@ ...@@ -326,14 +325,16 @@
'android_lib': '<(android_sysroot)/usr/lib', 'android_lib': '<(android_sysroot)/usr/lib',
}], }],
], ],
'android_stlport_include': '<(android_stlport)/stlport', 'android_libcpp_include': '<(android_stl)/llvm-libc++/libcxx/include',
'android_stlport_libs': '<(android_stlport)/libs', 'android_libcpp_abi_include': '<(android_stl)/llvm-libc++abi/libcxxabi/include',
'android_libcpp_libs': '<(android_stl)/llvm-libc++/libs',
'android_support_include': '<(android_toolchain)/sources/android/support/include',
'android_sysroot': '<(android_sysroot)',
}, { }, {
'variables': { 'variables': {
'android_sysroot': '<(android_ndk_root)/platforms/android-<(android_target_platform)/arch-<(android_target_arch)', 'android_sysroot': '<(android_ndk_root)/platforms/android-<(android_target_platform)/arch-<(android_target_arch)',
'android_stlport': '<(android_ndk_root)/sources/cxx-stl/stlport/', 'android_stl': '<(android_ndk_root)/sources/cxx-stl/',
}, },
'android_include': '<(android_sysroot)/usr/include',
'conditions': [ 'conditions': [
['target_arch=="x64"', { ['target_arch=="x64"', {
'android_lib': '<(android_sysroot)/usr/lib64', 'android_lib': '<(android_sysroot)/usr/lib64',
...@@ -341,11 +342,14 @@ ...@@ -341,11 +342,14 @@
'android_lib': '<(android_sysroot)/usr/lib', 'android_lib': '<(android_sysroot)/usr/lib',
}], }],
], ],
'android_stlport_include': '<(android_stlport)/stlport', 'android_libcpp_include': '<(android_stl)/llvm-libc++/libcxx/include',
'android_stlport_libs': '<(android_stlport)/libs', 'android_libcpp_abi_include': '<(android_stl)/llvm-libc++abi/libcxxabi/include',
'android_libcpp_libs': '<(android_stl)/llvm-libc++/libs',
'android_support_include': '<(android_ndk_root)/sources/android/support/include',
'android_sysroot': '<(android_sysroot)',
}], }],
], ],
'android_stlport_library': 'stlport_static', 'android_libcpp_library': 'c++_static',
}], # OS=="android" }], # OS=="android"
['host_clang==1', { ['host_clang==1', {
'host_cc': '<(clang_dir)/bin/clang', 'host_cc': '<(clang_dir)/bin/clang',
...@@ -1008,11 +1012,7 @@ ...@@ -1008,11 +1012,7 @@
}, # configurations }, # configurations
'cflags': [ '-Wno-abi', '-Wall', '-W', '-Wno-unused-parameter'], 'cflags': [ '-Wno-abi', '-Wall', '-W', '-Wno-unused-parameter'],
'cflags_cc': [ '-Wnon-virtual-dtor', '-fno-rtti', '-fno-exceptions', 'cflags_cc': [ '-Wnon-virtual-dtor', '-fno-rtti', '-fno-exceptions',
# Note: Using -std=c++0x will define __STRICT_ANSI__, which '-std=gnu++11' ],
# in turn will leave out some template stuff for 'long
# long'. What we want is -std=c++11, but this is not
# supported by GCC 4.6 or Xcode 4.2
'-std=gnu++0x' ],
'target_conditions': [ 'target_conditions': [
['_toolset=="target"', { ['_toolset=="target"', {
'cflags!': [ 'cflags!': [
...@@ -1025,19 +1025,16 @@ ...@@ -1025,19 +1025,16 @@
'-fno-short-enums', '-fno-short-enums',
'-finline-limit=64', '-finline-limit=64',
'-Wa,--noexecstack', '-Wa,--noexecstack',
# Note: This include is in cflags to ensure that it comes after '--sysroot=<(android_sysroot)',
# all of the includes.
'-I<(android_include)',
'-I<(android_stlport_include)',
], ],
'cflags_cc': [ 'cflags_cc': [
'-Wno-error=non-virtual-dtor', # TODO(michaelbai): Fix warnings. '-isystem<(android_libcpp_include)',
'-isystem<(android_libcpp_abi_include)',
'-isystem<(android_support_include)',
], ],
'defines': [ 'defines': [
'ANDROID', 'ANDROID',
#'__GNU_SOURCE=1', # Necessary for clone() #'__GNU_SOURCE=1', # Necessary for clone()
'USE_STLPORT=1',
'_STLP_USE_PTR_SPECIALIZATIONS=1',
'HAVE_OFF64_T', 'HAVE_OFF64_T',
'HAVE_SYS_UIO_H', 'HAVE_SYS_UIO_H',
'ANDROID_BINSIZE_HACK', # Enable temporary hacks to reduce binsize. 'ANDROID_BINSIZE_HACK', # Enable temporary hacks to reduce binsize.
...@@ -1046,10 +1043,9 @@ ...@@ -1046,10 +1043,9 @@
'-pthread', # Not supported by Android toolchain. '-pthread', # Not supported by Android toolchain.
], ],
'ldflags': [ 'ldflags': [
'-nostdlib',
'-Wl,--no-undefined', '-Wl,--no-undefined',
'-Wl,-rpath-link=<(android_lib)', '--sysroot=<(android_sysroot)',
'-L<(android_lib)', '-nostdlib',
], ],
'libraries!': [ 'libraries!': [
'-lrt', # librt is built into Bionic. '-lrt', # librt is built into Bionic.
...@@ -1060,12 +1056,12 @@ ...@@ -1060,12 +1056,12 @@
'-lpthread', '-lnss3', '-lnssutil3', '-lsmime3', '-lplds4', '-lplc4', '-lnspr4', '-lpthread', '-lnss3', '-lnssutil3', '-lsmime3', '-lplds4', '-lplc4', '-lnspr4',
], ],
'libraries': [ 'libraries': [
'-l<(android_stlport_library)', '-l<(android_libcpp_library)',
'-latomic',
# Manually link the libgcc.a that the cross compiler uses. # Manually link the libgcc.a that the cross compiler uses.
'<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)', '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
'-lc', '-lc',
'-ldl', '-ldl',
'-lstdc++',
'-lm', '-lm',
], ],
'conditions': [ 'conditions': [
...@@ -1082,22 +1078,22 @@ ...@@ -1082,22 +1078,22 @@
'-mfpu=vfp3', '-mfpu=vfp3',
], ],
'ldflags': [ 'ldflags': [
'-L<(android_stlport_libs)/armeabi-v7a', '-L<(android_libcpp_libs)/armeabi-v7a',
], ],
}], }],
['target_arch=="arm" and arm_version < 7', { ['target_arch=="arm" and arm_version < 7', {
'ldflags': [ 'ldflags': [
'-L<(android_stlport_libs)/armeabi', '-L<(android_libcpp_libs)/armeabi',
], ],
}], }],
['target_arch=="x64"', { ['target_arch=="x64"', {
'ldflags': [ 'ldflags': [
'-L<(android_stlport_libs)/x86_64', '-L<(android_libcpp_libs)/x86_64',
], ],
}], }],
['target_arch=="arm64"', { ['target_arch=="arm64"', {
'ldflags': [ 'ldflags': [
'-L<(android_stlport_libs)/arm64-v8a', '-L<(android_libcpp_libs)/arm64-v8a',
], ],
}], }],
['target_arch=="ia32" or target_arch=="x87"', { ['target_arch=="ia32" or target_arch=="x87"', {
...@@ -1109,7 +1105,7 @@ ...@@ -1109,7 +1105,7 @@
'-fno-stack-protector', '-fno-stack-protector',
], ],
'ldflags': [ 'ldflags': [
'-L<(android_stlport_libs)/x86', '-L<(android_libcpp_libs)/x86',
], ],
}], }],
['target_arch=="mipsel"', { ['target_arch=="mipsel"', {
...@@ -1122,7 +1118,7 @@ ...@@ -1122,7 +1118,7 @@
'-fno-stack-protector', '-fno-stack-protector',
], ],
'ldflags': [ 'ldflags': [
'-L<(android_stlport_libs)/mips', '-L<(android_libcpp_libs)/mips',
], ],
}], }],
['(target_arch=="arm" or target_arch=="arm64" or target_arch=="x64" or target_arch=="ia32") and component!="shared_library"', { ['(target_arch=="arm" or target_arch=="arm64" or target_arch=="x64" or target_arch=="ia32") and component!="shared_library"', {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment