summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2018-10-10 15:58:17 -0400
committerAndrew Morrow <acm@mongodb.com>2018-10-12 14:01:26 -0400
commit4a884f63d8487a7d9cef0b7159c4efd83e9f5b4e (patch)
tree5cf516f6d8e6a2f202b2af0374bbc81b51a33329
parent34494aea07513b5fda35115da55278a20af01a25 (diff)
downloadmongo-4a884f63d8487a7d9cef0b7159c4efd83e9f5b4e.tar.gz
SERVER-37158 Apply library compatibility flags for embedded libs
(cherry picked from commit 1cf0d9706d3d205f3b83e32e7d3b9bb40f17bd60)
-rw-r--r--src/mongo/embedded/mongo_embedded/SConscript20
-rw-r--r--src/mongo/embedded/mongoc_embedded/SConscript16
2 files changed, 34 insertions, 2 deletions
diff --git a/src/mongo/embedded/mongo_embedded/SConscript b/src/mongo/embedded/mongo_embedded/SConscript
index 1e38480db9d..bc01f5e42c2 100644
--- a/src/mongo/embedded/mongo_embedded/SConscript
+++ b/src/mongo/embedded/mongo_embedded/SConscript
@@ -27,9 +27,27 @@ elif get_option('link-model') == 'dynamic-sdk':
)
mongoEmbeddedEnv.AppendUnique(
- SHLINKFLAGS=['$MONGO_EXPORT_FILE_SHLINKFLAGS']
+ SHLINKFLAGS=[
+ '$MONGO_EXPORT_FILE_SHLINKFLAGS',
+ ],
)
+if mongoEmbeddedEnv.TargetOSIs('darwin'):
+ # The current version and compatibility are the *minor* ABI
+ # version metadata. If you extend (but do not break) the ABI, you
+ # should increment current_version but leave compatibiity_version
+ # at 1. If you break ABI, you should bump the entire library from
+ # v1 to v2, in which case you would then reset both
+ # current_version and compatibility_version to 1. You should never
+ # need to set compatibility_version to anything but 1.
+ mongoEmbeddedEnv.AppendUnique(
+ SHLINKFLAGS=[
+ '-Wl,-current_version,1',
+ '-Wl,-compatibility_version,1',
+ ],
+ )
+
+
mongoEmbeddedEnv.Library(
target='mongo_embedded',
source=[
diff --git a/src/mongo/embedded/mongoc_embedded/SConscript b/src/mongo/embedded/mongoc_embedded/SConscript
index 04b606243fb..fa25dd0a1c9 100644
--- a/src/mongo/embedded/mongoc_embedded/SConscript
+++ b/src/mongo/embedded/mongoc_embedded/SConscript
@@ -33,10 +33,24 @@ if get_option('link-model') == 'static':
],
)
+# Please see the note in ../mongo_embedded/SConscript about how to
+# interpret and adjust the current and compatibility versinos.
mongocEmbeddedEnv.AppendUnique(
- SHLINKFLAGS=['$MONGO_EXPORT_FILE_SHLINKFLAGS']
+ SHLINKFLAGS=[
+ '$MONGO_EXPORT_FILE_SHLINKFLAGS',
+ ],
)
+if mongocEmbeddedEnv.TargetOSIs('darwin'):
+ # Please see the note in ../mongo_embedded/SConscript about how to
+ # interpret and adjust the current and compatibility versinos.
+ mongocEmbeddedEnv.AppendUnique(
+ SHLINKFLAGS=[
+ '-Wl,-current_version,1',
+ '-Wl,-compatibility_version,1',
+ ],
+ )
+
mongocEmbeddedEnv.Library(
target='mongoc_embedded',
source=[