Skip to content

Commit

Permalink
Disable thread local support as it appears to trigger an incompatibil…
Browse files Browse the repository at this point in the history
…ity with CentOS 7
  • Loading branch information
James Pack committed May 23, 2019
1 parent 3e7faa1 commit f75c825
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
47 changes: 47 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,50 @@ cc_library(
srcs = ["empty_main.cc"],
visibility = ["//visibility:public"],
)

SHARED_LIBRARY_LINKOPTS = select({
"@toolchain//:linux-target": [
"-static-libgcc",
"-static-libstdc++",
],
"@toolchain//:osx-target": [
"-static-libstdc++",
],
"@toolchain//:windows-target": [],
})

filegroup(
name = "librocksdb",
srcs = select({
"@toolchain//:linux-target": [":librocksdb.so"],
"@toolchain//:osx-target": [":librocksdb.dylib"],
"@toolchain//:windows-target": [":librocksdb.dll"],
}),
)

cc_binary(
name = "librocksdb.so",
deps = [
":rocksdb",
],
linkshared = True,
linkopts = SHARED_LIBRARY_LINKOPTS,
)

cc_binary(
name = "librocksdb.dylib",
deps = [
":rocksdb",
],
linkshared = True,
linkopts = SHARED_LIBRARY_LINKOPTS,
)

cc_binary(
name = "librocksdb.dll",
deps = [
":rocksdb",
],
linkshared = True,
linkopts = SHARED_LIBRARY_LINKOPTS,
)
9 changes: 2 additions & 7 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ new_http_archive(
http_archive(
name = "toolchain",
urls = [
# The file: URL is useful for testing the build, but is not generally necessary since Bazel handles caching
# external dependencies.
# TODO(james): Remove this URL when the Bazel build is stable.
# "file:///home/james/git/toolchain-master.tgz",
"https://github.com/stardog-union/toolchain/archive/master.zip",
"https://github.com/stardog-union/toolchain/archive/v1.zip",
],
strip_prefix = "toolchain-master",
sha256 = "d0740cacb99833911baba82041bb4429f9d3182522fe0fd4c131335ac8343891",
strip_prefix = "toolchain-1",
)
3 changes: 2 additions & 1 deletion port/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ PLATFORM_DEFINES = select({
"ROCKSDB_PLATFORM_POSIX",
"HAVE_SSE42",
"ROCKSDB_LIB_IO_POSIX",
"ROCKSDB_SUPPORT_THREAD_LOCAL",
"ROCKSDB_FALLOCATE_PRESENT",
"ROCKSDB_MALLOC_USABLE_SIZE",
"ROCKSDB_PTHREAD_ADAPTIVE_MUTEX",
"ROCKSDB_RANGESYNC_PRESENT",
"ROCKSDB_SCHED_GETCPU_PRESENT",
"rocksdb_shared_EXPORTS",
# Thread local support is disabled, as it appears to trigger an incompatibility with CentOS 7.
# "ROCKSDB_SUPPORT_THREAD_LOCAL",
],
"//:osx": [
"OS_MACOSX",
Expand Down

0 comments on commit f75c825

Please sign in to comment.