Skip to content

Commit

Permalink
Bump Android NDK to r17b (#20357)
Browse files Browse the repository at this point in the history
Summary:
This PR bumps Android NDK version to r17b (latest). Cleaned up redundant **LOCAL_EXPORT_CPPFLAGS** rules in .mk files
Pull Request resolved: #20357

Differential Revision: D9068424

Pulled By: hramos

fbshipit-source-id: 8578637e38e807288b819a36cb75ea9feefcc09f
  • Loading branch information
dulmandakh authored and facebook-github-bot committed Jul 30, 2018
1 parent 1b09bd7 commit 6117a6c
Show file tree
Hide file tree
Showing 21 changed files with 27 additions and 69 deletions.
14 changes: 7 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@ aliases:

- &restore-cache-ndk
keys:
- v3-android-ndk-r10e-{{ checksum "scripts/android-setup.sh" }}
- v3-android-ndk-r17b-{{ checksum "scripts/android-setup.sh" }}
- &save-cache-ndk
paths:
- /opt/ndk
key: v3-android-ndk-r10e-{{ checksum "scripts/android-setup.sh" }}
key: v3-android-ndk-r17b-{{ checksum "scripts/android-setup.sh" }}

- &restore-cache-downloads-buck
keys:
- v3-buck-v2018.06.25.01-{{ checksum "scripts/circleci/buck_fetch.sh" }}}
- v3-buck-v2018.06.25.01-
- v3-buck-v2018.07.23.01-{{ checksum "scripts/circleci/buck_fetch.sh" }}}
- v3-buck-v2018.07.23.01-
- &save-cache-downloads-buck
paths:
- ~/buck
- ~/okbuck
key: v3-buck-v2018.06.25.01-{{ checksum "scripts/circleci/buck_fetch.sh" }}
key: v3-buck-v2018.07.23.01-{{ checksum "scripts/circleci/buck_fetch.sh" }}

- &restore-cache-watchman
keys:
Expand Down Expand Up @@ -136,7 +136,7 @@ aliases:
name: Install BUCK
command: |
if [[ ! -e ~/buck ]]; then
git clone https://github.com/facebook/buck.git ~/buck --branch v2018.06.25.01 --depth=1
git clone https://github.com/facebook/buck.git ~/buck --branch v2018.07.23.01 --depth=1
fi
cd ~/buck && ant
buck --version
Expand Down Expand Up @@ -365,7 +365,7 @@ android_defaults: &android_defaults
- ADB_INSTALL_TIMEOUT: 10
- _JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
- GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-XX:+HeapDumpOnOutOfMemoryError"'
- ANDROID_NDK: '/opt/ndk/android-ndk-r10e'
- ANDROID_NDK: '/opt/ndk/android-ndk-r17b'
- BUILD_THREADS: 2

macos_defaults: &macos_defaults
Expand Down
4 changes: 2 additions & 2 deletions ContainerShip/Dockerfile.android-base
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ LABEL maintainer="Héctor Ramos <[email protected]>"
ARG SDK_VERSION=sdk-tools-linux-3859397.zip
ARG ANDROID_BUILD_VERSION=26
ARG ANDROID_TOOLS_VERSION=26.0.3
ARG BUCK_VERSION=v2018.06.25.01
ARG NDK_VERSION=10e
ARG BUCK_VERSION=v2018.07.23.01
ARG NDK_VERSION=17b
ARG NODE_VERSION=8.10.0
ARG WATCHMAN_VERSION=4.9.0

Expand Down
1 change: 0 additions & 1 deletion RNTester/android/app/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
android.useDeprecatedNdk=true
org.gradle.parallel=true
org.gradle.configureondemand=true
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
Expand Down
2 changes: 0 additions & 2 deletions ReactAndroid/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ POM_NAME=ReactNative
POM_ARTIFACT_ID=react-native
POM_PACKAGING=aar

android.useDeprecatedNdk=true

MOCKITO_CORE_VERSION=1.10.19
POWERMOCK_VERSION=1.6.2
ROBOLECTRIC_VERSION=3.0
Expand Down
1 change: 1 addition & 0 deletions ReactAndroid/src/main/jni/Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ NDK_MODULE_PATH := $(APP_MK_DIR)$(HOST_DIRSEP)$(THIRD_PARTY_NDK_DIR)$(HOST_DIRSE
APP_STL := gnustl_shared

# Make sure every shared lib includes a .note.gnu.build-id header
APP_CFLAGS := -Wall -Werror
APP_CPPFLAGS := -std=c++1y
APP_LDFLAGS := -Wl,--build-id

Expand Down
6 changes: 0 additions & 6 deletions ReactAndroid/src/main/jni/first-party/fb/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,13 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include

LOCAL_CFLAGS := -DLOG_TAG=\"libfb\" -DDISABLE_CPUCAP -DDISABLE_XPLAT -fexceptions -frtti
LOCAL_CFLAGS += -Wall -Werror
# include/utils/threads.h has unused parameters
LOCAL_CFLAGS += -Wno-unused-parameter
ifeq ($(TOOLCHAIN_PERMISSIVE),true)
LOCAL_CFLAGS += -Wno-error=unused-but-set-variable
endif
LOCAL_CFLAGS += -DHAVE_POSIX_CLOCKS

CXX11_FLAGS := -std=c++11
LOCAL_CFLAGS += $(CXX11_FLAGS)

LOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)

LOCAL_LDLIBS := -llog -ldl -landroid
LOCAL_EXPORT_LDLIBS := -llog

Expand Down
6 changes: 0 additions & 6 deletions ReactAndroid/src/main/jni/first-party/fbgloginit/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)

LOCAL_CFLAGS := -fexceptions -fno-omit-frame-pointer
LOCAL_CFLAGS += -Wall -Werror

CXX11_FLAGS := -std=c++11
LOCAL_CFLAGS += $(CXX11_FLAGS)

LOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)

LOCAL_LDLIBS := -llog

Expand Down
5 changes: 1 addition & 4 deletions ReactAndroid/src/main/jni/first-party/yogajni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ LOCAL_SRC_FILES := \

LOCAL_C_INCLUDES := $(LOCAL_PATH)/jni

LOCAL_CFLAGS += -Wall -Werror -fvisibility=hidden -fexceptions -frtti -O3
CXX11_FLAGS := -std=c++11
LOCAL_CFLAGS += $(CXX11_FLAGS)
LOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)
LOCAL_CFLAGS += -fvisibility=hidden -fexceptions -frtti -O3

LOCAL_LDLIBS += -landroid -llog
LOCAL_STATIC_LIBRARIES := libyogacore
Expand Down
5 changes: 1 addition & 4 deletions ReactAndroid/src/main/jni/react/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ LOCAL_SRC_FILES := \
LOCAL_C_INCLUDES := $(LOCAL_PATH)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../..

LOCAL_CFLAGS += -Wall -Werror -fvisibility=hidden -fexceptions -frtti
CXX11_FLAGS := -std=c++11
LOCAL_CFLAGS += $(CXX11_FLAGS)
LOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)
LOCAL_CFLAGS += -fvisibility=hidden -fexceptions -frtti

LOCAL_LDLIBS += -landroid
LOCAL_SHARED_LIBRARIES := libfolly_json libfb libjsc libglog_init libyoga libprivatedata
Expand Down
2 changes: 0 additions & 2 deletions ReactAndroid/src/main/jni/third-party/boost/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(LOCAL_PATH)/boost_1_63_0
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/boost_1_63_0
CXX11_FLAGS := -std=c++11
LOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)

LOCAL_MODULE := boost

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ LOCAL_SRC_FILES := \

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)

CXX11_FLAGS := -std=c++11 -Wno-unused-variable -Wno-unused-local-typedefs
CXX11_FLAGS := -Wno-unused-variable -Wno-unused-local-typedefs
LOCAL_CFLAGS += $(CXX11_FLAGS)
LOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)

include $(BUILD_STATIC_LIBRARY)
14 changes: 5 additions & 9 deletions ReactAndroid/src/main/jni/third-party/folly/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,19 @@ LOCAL_SRC_FILES:= \
folly/Unicode.cpp \
folly/Conv.cpp \
folly/Demangle.cpp \
folly/detail/MallocImpl.cpp \
folly/StringBase.cpp \
folly/dynamic.cpp \
folly/detail/MallocImpl.cpp \
folly/StringBase.cpp \
folly/dynamic.cpp \

LOCAL_C_INCLUDES := $(LOCAL_PATH)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)

LOCAL_CFLAGS += -fexceptions -fno-omit-frame-pointer -frtti
LOCAL_CFLAGS += -Wall -Werror -std=c++11

CXX11_FLAGS := -std=c++11
LOCAL_CFLAGS += $(CXX11_FLAGS)

FOLLY_FLAGS := -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1
FOLLY_FLAGS := -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1
LOCAL_CFLAGS += $(FOLLY_FLAGS)

LOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS) $(FOLLY_FLAGS)
LOCAL_EXPORT_CPPFLAGS := $(FOLLY_FLAGS)

LOCAL_MODULE := libfolly_json

Expand Down
3 changes: 1 addition & 2 deletions ReactAndroid/src/main/jni/third-party/glog/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/.. $(LOCAL_PATH)/glog-0.3.5/src/
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. $(LOCAL_PATH)/glog-0.3.5/src/

LOCAL_CFLAGS += \
-Wall \
-Wwrite-strings \
-Woverloaded-virtual \
-Wno-sign-compare \
Expand All @@ -27,6 +26,6 @@ LOCAL_CFLAGS += \
-D_END_GOOGLE_NAMESPACE_="}"


LOCAL_MODULE := glog
LOCAL_MODULE := glog

include $(BUILD_SHARED_LIBRARY)
5 changes: 1 addition & 4 deletions ReactCommon/cxxreact/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
LOCAL_CFLAGS := \
-DLOG_TAG=\"ReactNative\"

LOCAL_CFLAGS += -Wall -Werror -fexceptions -frtti
CXX11_FLAGS := -std=c++11
LOCAL_CFLAGS += $(CXX11_FLAGS)
LOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)
LOCAL_CFLAGS += -fexceptions -frtti

LOCAL_STATIC_LIBRARIES := jschelpers
LOCAL_SHARED_LIBRARIES := libfb libfolly_json libjsc libglog
Expand Down
5 changes: 1 addition & 4 deletions ReactCommon/jschelpers/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
LOCAL_CFLAGS := \
-DLOG_TAG=\"ReactNative\"

LOCAL_CFLAGS += -Wall -Werror -fexceptions -frtti
CXX11_FLAGS := -std=c++11
LOCAL_CFLAGS += $(CXX11_FLAGS)
LOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)
LOCAL_CFLAGS += -fexceptions -frtti

LOCAL_SHARED_LIBRARIES := libfolly_json libjsc libglog

Expand Down
5 changes: 1 addition & 4 deletions ReactCommon/jsinspector/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ LOCAL_SRC_FILES := \
LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)

LOCAL_CFLAGS += -Wall -Werror -fexceptions
CXX11_FLAGS := -std=c++11
LOCAL_CFLAGS += $(CXX11_FLAGS)
LOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)
LOCAL_CFLAGS += -fexceptions

include $(BUILD_SHARED_LIBRARY)
5 changes: 1 addition & 4 deletions ReactCommon/privatedata/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
LOCAL_CFLAGS := \
-DLOG_TAG=\"ReactNative\"

LOCAL_CFLAGS += -Wall -Werror -fexceptions -frtti
CXX11_FLAGS := -std=c++11
LOCAL_CFLAGS += $(CXX11_FLAGS)
LOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)
LOCAL_CFLAGS += -fexceptions -frtti

include $(BUILD_SHARED_LIBRARY)
2 changes: 1 addition & 1 deletion ReactCommon/yoga/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/yoga/*.cpp)
LOCAL_C_INCLUDES := $(LOCAL_PATH)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)

LOCAL_CFLAGS := -Wall -Werror -fexceptions -frtti -std=c++1y -O3
LOCAL_CFLAGS := -fexceptions -frtti -O3

include $(BUILD_STATIC_LIBRARY)
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
environment:
ANDROID_HOME: "C:\\android-sdk-windows"
ANDROID_NDK: "C:\\android-sdk-windows\\android-ndk-r10e"
ANDROID_NDK: "C:\\android-sdk-windows\\android-ndk-r17b"
ANDROID_BUILD_VERSION: 26
ANDROID_TOOLS_VERSION: 26.0.3

GRADLE_OPTS: -Dorg.gradle.daemon=false

SDK_TOOLS_URL: https://dl.google.com/android/repository/sdk-tools-windows-3859397.zip
NDK_TOOLS_URL: https://dl.google.com/android/repository/android-ndk-r10e-windows-x86_64.zip
NDK_TOOLS_URL: https://dl.google.com/android/repository/android-ndk-r17b-windows-x86_64.zip

matrix:
- nodejs_version: 8
Expand Down
2 changes: 0 additions & 2 deletions local-cli/templates/HelloWorld/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

android.useDeprecatedNdk=true
2 changes: 1 addition & 1 deletion scripts/android-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function getAndroidNDK {
if [ ! -e $DEPS ]; then
cd $NDK_HOME || exit
echo "Downloading NDK..."
curl -o ndk.zip https://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip
curl -o ndk.zip https://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip
unzip -o -q ndk.zip
echo "Installed Android NDK at $NDK_HOME"
touch $DEPS
Expand Down

0 comments on commit 6117a6c

Please sign in to comment.