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

Upgrade folly to v2018.10.22.00 for Android #21977

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
19 changes: 19 additions & 0 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ task prepareFolly(dependsOn: dependenciesPath ? [] : [downloadFolly], type: Copy
include "folly-${FOLLY_VERSION}/folly/**/*", 'Android.mk'
eachFile {fname -> fname.path = (fname.path - "folly-${FOLLY_VERSION}/")}
includeEmptyDirs = false

// Patch for folly build break on gcc 4.9 and could be removed after build by clang
filesMatching('**/container/detail/F14Policy.h') {
filter(ReplaceTokens, tokens: [
'ObjectHolder(Args&&... args) : value_{std::forward<Args>(args)...} {}': 'ObjectHolder(Args&&... args) : value_({std::forward<Args>(args)...}) {}',
'ObjectHolder(Args&&... args) : T{std::forward<Args>(args)...} {}': 'ObjectHolder(Args&&... args) : T({std::forward<Args>(args)...}) {}',
],
beginToken: '',
endToken: '')
}

into "$thirdPartyNdkDir/folly"
}

Expand Down Expand Up @@ -124,6 +135,14 @@ task prepareGlog(dependsOn: dependenciesPath ? [] : [downloadGlog], type: Copy)
it.path = (it.name - '.in')
}
into "$thirdPartyNdkDir/glog"

doLast {
copy {
from fileTree(dir: "$thirdPartyNdkDir/glog", includes: ["stl_logging.h", "logging.h", "raw_logging.h", "vlog_is_on.h", "**/glog/log_severity.h"]).files
includeEmptyDirs = false
into "$thirdPartyNdkDir/glog/exported/glog"
}
}
}

task downloadJSCHeaders(type: Download) {
Expand Down
2 changes: 1 addition & 1 deletion ReactAndroid/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ OKHTTP_VERSION=3.11.0

BOOST_VERSION=1_63_0
DOUBLE_CONVERSION_VERSION=1.1.6
FOLLY_VERSION=2016.10.31.00
FOLLY_VERSION=2018.10.22.00
GLOG_VERSION=0.3.5
33 changes: 24 additions & 9 deletions ReactAndroid/src/main/jni/third-party/folly/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,35 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
folly/json.cpp \
folly/Unicode.cpp \
folly/Conv.cpp \
folly/Demangle.cpp \
folly/detail/MallocImpl.cpp \
folly/StringBase.cpp \
folly/dynamic.cpp \
folly/json.cpp \
folly/Unicode.cpp \
folly/Conv.cpp \
folly/Demangle.cpp \
folly/memory/detail/MallocImpl.cpp \
folly/String.cpp \
folly/dynamic.cpp \
folly/Format.cpp \
folly/json_pointer.cpp \
folly/lang/ColdClass.cpp \
folly/detail/Demangle.cpp \
folly/hash/SpookyHashV2.cpp \
folly/container/detail/F14Table.cpp \
folly/ScopeGuard.cpp \
Copy link
Contributor

Choose a reason for hiding this comment

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

Longer term it would be great to figure out a way to not list these out manually, so that upgrades can be easier. I don't know what the best solution is, but perhaps the folly repo has a cmake configuration we can use.


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

LOCAL_CFLAGS += -fexceptions -fno-omit-frame-pointer -frtti
LOCAL_CFLAGS += -fexceptions -fno-omit-frame-pointer -frtti -Wno-sign-compare

FOLLY_FLAGS := \
-DFOLLY_NO_CONFIG=1 \
-DFOLLY_HAVE_CLOCK_GETTIME=1 \
-DFOLLY_HAVE_MEMRCHR=1 \

# If APP_PLATFORM in Application.mk targets android-23 above, please comment this line.
# NDK uses GNU style stderror_r() after API 23.
FOLLY_FLAGS += -DFOLLY_HAVE_XSI_STRERROR_R=1

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

LOCAL_EXPORT_CPPFLAGS := $(FOLLY_FLAGS)
Expand Down
4 changes: 2 additions & 2 deletions ReactAndroid/src/main/jni/third-party/glog/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LOCAL_SRC_FILES := \

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_EXPORT_C_INCLUDES := $(LOCAL_PATH)/exported

LOCAL_CFLAGS += \
-Wwrite-strings \
Expand All @@ -28,4 +28,4 @@ LOCAL_CFLAGS += \

LOCAL_MODULE := glog

include $(BUILD_SHARED_LIBRARY)
include $(BUILD_SHARED_LIBRARY)