From e8ea8e493ee84ecc345a91554943f8d10632fbfb Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Mon, 27 Jun 2016 12:16:35 -0700 Subject: [PATCH 1/4] Fix for linker error when building for iOS 7 By default, React Native projects target a minimum of iOS 7, but our projects were set to iOS 8 because previously we used a dynamic framework. When building for an iOS 7 minimum target version, the linker would complain about thread local variables not working on iOS 7. So it was necessary to add even more checks (iOS >= 8 or OS X >= 10.7) before using native thread local variables rather than our shim. This also changes our projects to target iOS 7 so we can catch these issues quicker in the future. --- CHANGELOG.md | 11 +++++ .../ReactExample.xcodeproj/project.pbxproj | 4 +- .../ios/RealmReact.xcodeproj/project.pbxproj | 41 +++++++++++++++---- src/RealmJS.xcodeproj/project.pbxproj | 4 +- src/object-store/src/util/thread_local.hpp | 3 +- .../ios/ReactTests.xcodeproj/project.pbxproj | 4 +- 6 files changed, 51 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2ca0bab..278c3900 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +x.x.x Release notes (yyyy-MM-dd) +============================================================= +### Breaking changes +* None + +### Enhancements +* None + +### Bugfixes +* Fix linker error when building for minimum target version of iOS 7. + 0.14.0 Release notes (2016-6-22) ============================================================= ### Breaking changes diff --git a/examples/ReactExample/ios/ReactExample.xcodeproj/project.pbxproj b/examples/ReactExample/ios/ReactExample.xcodeproj/project.pbxproj index a30457bb..e58be9a9 100644 --- a/examples/ReactExample/ios/ReactExample.xcodeproj/project.pbxproj +++ b/examples/ReactExample/ios/ReactExample.xcodeproj/project.pbxproj @@ -752,7 +752,7 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", ); - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; @@ -793,7 +793,7 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", ); - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; SDKROOT = iphoneos; diff --git a/react-native/ios/RealmReact.xcodeproj/project.pbxproj b/react-native/ios/RealmReact.xcodeproj/project.pbxproj index 1df0816d..708df929 100644 --- a/react-native/ios/RealmReact.xcodeproj/project.pbxproj +++ b/react-native/ios/RealmReact.xcodeproj/project.pbxproj @@ -13,13 +13,6 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - F606902C1CA277CD0003FB26 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F60690231CA277CC0003FB26 /* RealmJS.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F63FF2F01C16405C00B3B8E0; - remoteInfo = GCDWebServers; - }; F606902E1CA277CD0003FB26 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = F60690231CA277CC0003FB26 /* RealmJS.xcodeproj */; @@ -48,6 +41,20 @@ remoteGlobalIDString = F63FF2EF1C16405C00B3B8E0; remoteInfo = GCDWebServers; }; + F68759FA1D21949A007471AB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F60690231CA277CC0003FB26 /* RealmJS.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F63FF2F01C16405C00B3B8E0; + remoteInfo = GCDWebServers; + }; + F68759FC1D21949A007471AB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F60690231CA277CC0003FB26 /* RealmJS.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F62BF8FB1CAC71780022BCDC; + remoteInfo = RealmNode; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -113,7 +120,9 @@ F60690241CA277CC0003FB26 /* Products */ = { isa = PBXGroup; children = ( + F68759FB1D21949A007471AB /* libGCDWebServers.a */, F606902F1CA277CD0003FB26 /* libRealmJS.a */, + F68759FD1D21949A007471AB /* libRealmNode.dylib */, F60690331CA277CD0003FB26 /* RealmJSTests.xctest */, ); name = Products; @@ -192,6 +201,20 @@ remoteRef = F60690321CA277CD0003FB26 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + F68759FB1D21949A007471AB /* libGCDWebServers.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libGCDWebServers.a; + remoteRef = F68759FA1D21949A007471AB /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + F68759FD1D21949A007471AB /* libRealmNode.dylib */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.dylib"; + path = libRealmNode.dylib; + remoteRef = F68759FC1D21949A007471AB /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXSourcesBuildPhase section */ @@ -256,7 +279,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; OTHER_CPLUSPLUSFLAGS = ( @@ -298,7 +321,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", diff --git a/src/RealmJS.xcodeproj/project.pbxproj b/src/RealmJS.xcodeproj/project.pbxproj index b610b327..ee19823d 100644 --- a/src/RealmJS.xcodeproj/project.pbxproj +++ b/src/RealmJS.xcodeproj/project.pbxproj @@ -951,7 +951,7 @@ "$(SRCROOT)/object-store/src", "$(SRCROOT)/../vendor", ); - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; OTHER_CPLUSPLUSFLAGS = ( @@ -1006,7 +1006,7 @@ "$(SRCROOT)/object-store/src", "$(SRCROOT)/../vendor", ); - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", diff --git a/src/object-store/src/util/thread_local.hpp b/src/object-store/src/util/thread_local.hpp index 48ed6ca9..ba1dd499 100644 --- a/src/object-store/src/util/thread_local.hpp +++ b/src/object-store/src/util/thread_local.hpp @@ -21,7 +21,8 @@ #include -#if !defined(__clang__) || REALM_HAVE_CLANG_FEATURE(tls) || REALM_HAVE_CLANG_FEATURE(cxx_thread_local) +#if (!defined(__clang__) || REALM_HAVE_CLANG_FEATURE(tls) || REALM_HAVE_CLANG_FEATURE(cxx_thread_local)) && \ + (!REALM_PLATFORM_APPLE || __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000 || MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) #define REALM_THREAD_LOCAL_TYPE(type) REALM_THREAD_LOCAL type diff --git a/tests/react-test-app/ios/ReactTests.xcodeproj/project.pbxproj b/tests/react-test-app/ios/ReactTests.xcodeproj/project.pbxproj index 2bbf4003..3bfd2f29 100644 --- a/tests/react-test-app/ios/ReactTests.xcodeproj/project.pbxproj +++ b/tests/react-test-app/ios/ReactTests.xcodeproj/project.pbxproj @@ -741,7 +741,7 @@ "$(SRCROOT)/../node_modules/react-native/React/Base/**", "$(SRCROOT)/../node_modules/react-native/React/Modules", ); - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; @@ -783,7 +783,7 @@ "$(SRCROOT)/../node_modules/react-native/React/Base/**", "$(SRCROOT)/../node_modules/react-native/React/Modules", ); - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; SDKROOT = iphoneos; From 6109675749f5ee6752423e967d5daa65779fede9 Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Tue, 28 Jun 2016 12:12:56 -0700 Subject: [PATCH 2/4] Disable "Strip Linked Product" on our static libs There seems to a bug inside the `strip` command (or its `ld64` library) that is being triggered by some users who get this message: `Assertion failed: (0 && "need to handle arm64 -r reloc")` It is reported that disabling this setting side-steps the issue, and we don't need any stripping done on the static library itself. Fixes #503 --- CHANGELOG.md | 1 + react-native/ios/RealmReact.xcodeproj/project.pbxproj | 2 ++ src/RealmJS.xcodeproj/project.pbxproj | 2 ++ 3 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 278c3900..fcb46db3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ x.x.x Release notes (yyyy-MM-dd) ### Bugfixes * Fix linker error when building for minimum target version of iOS 7. +* Fix for failure in `strip` command when building an archive. 0.14.0 Release notes (2016-6-22) ============================================================= diff --git a/react-native/ios/RealmReact.xcodeproj/project.pbxproj b/react-native/ios/RealmReact.xcodeproj/project.pbxproj index 708df929..91604d5c 100644 --- a/react-native/ios/RealmReact.xcodeproj/project.pbxproj +++ b/react-native/ios/RealmReact.xcodeproj/project.pbxproj @@ -288,6 +288,7 @@ ../../core/include, ); SDKROOT = iphoneos; + STRIP_INSTALLED_PRODUCT = NO; }; name = Debug; }; @@ -329,6 +330,7 @@ ../../core/include, ); SDKROOT = iphoneos; + STRIP_INSTALLED_PRODUCT = NO; VALIDATE_PRODUCT = YES; }; name = Release; diff --git a/src/RealmJS.xcodeproj/project.pbxproj b/src/RealmJS.xcodeproj/project.pbxproj index ee19823d..e9c73d05 100644 --- a/src/RealmJS.xcodeproj/project.pbxproj +++ b/src/RealmJS.xcodeproj/project.pbxproj @@ -959,6 +959,7 @@ "-ftemplate-backtrace-limit=0", ); SDKROOT = iphoneos; + STRIP_INSTALLED_PRODUCT = NO; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1013,6 +1014,7 @@ "-ftemplate-backtrace-limit=0", ); SDKROOT = iphoneos; + STRIP_INSTALLED_PRODUCT = NO; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; From 63adf8732e3e04a99a895466693c6ed4de51bc0b Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Tue, 28 Jun 2016 12:15:36 -0700 Subject: [PATCH 3/4] [0.14.0-rc] Bump version --- CHANGELOG.md | 2 +- package.json | 2 +- src/RealmJS.xcodeproj/project.pbxproj | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcb46db3..6f5154f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -x.x.x Release notes (yyyy-MM-dd) +0.14.1 Release notes (2016-6-28) ============================================================= ### Breaking changes * None diff --git a/package.json b/package.json index 2ebd113e..c9792f4c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "realm", "description": "Realm is a mobile database: an alternative to SQLite and key-value stores", - "version": "0.14.0", + "version": "0.14.1-rc", "license": "Apache-2.0", "homepage": "https://realm.io", "keywords": [ diff --git a/src/RealmJS.xcodeproj/project.pbxproj b/src/RealmJS.xcodeproj/project.pbxproj index e9c73d05..72db89a9 100644 --- a/src/RealmJS.xcodeproj/project.pbxproj +++ b/src/RealmJS.xcodeproj/project.pbxproj @@ -924,7 +924,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.14.0; + CURRENT_PROJECT_VERSION = 0.14.1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -985,7 +985,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.14.0; + CURRENT_PROJECT_VERSION = 0.14.1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -1059,7 +1059,7 @@ buildSettings = { DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 0.14.0; + DYLIB_CURRENT_VERSION = 0.14.1; EXECUTABLE_PREFIX = lib; GCC_PREPROCESSOR_DEFINITIONS = ( "REALM_PLATFORM_NODE=1", @@ -1093,7 +1093,7 @@ isa = XCBuildConfiguration; buildSettings = { DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 0.14.0; + DYLIB_CURRENT_VERSION = 0.14.1; EXECUTABLE_PREFIX = lib; GCC_PREPROCESSOR_DEFINITIONS = ( "REALM_PLATFORM_NODE=1", From 51ec21e37b397bf7e818a97ec7a0a098ea807bb9 Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Tue, 28 Jun 2016 17:27:49 -0700 Subject: [PATCH 4/4] [0.14.1] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c9792f4c..b08f2eb7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "realm", "description": "Realm is a mobile database: an alternative to SQLite and key-value stores", - "version": "0.14.1-rc", + "version": "0.14.1", "license": "Apache-2.0", "homepage": "https://realm.io", "keywords": [