rocksdb: make buildable on aarch64
Summary: - Remove default arch-specified flags. - Move non-default arch-specific flags to arch-specific param. Reviewed By: yiwu-arbug Differential Revision: D5597499 fbshipit-source-id: c53108ac39c73ac36893d3fd9aaf3b5e3080f1ae
This commit is contained in:
parent
a144a9782d
commit
5449c0990b
10
TARGETS
10
TARGETS
@ -14,7 +14,6 @@ rocksdb_compiler_flags = [
|
|||||||
"-DROCKSDB_RANGESYNC_PRESENT",
|
"-DROCKSDB_RANGESYNC_PRESENT",
|
||||||
"-DROCKSDB_SCHED_GETCPU_PRESENT",
|
"-DROCKSDB_SCHED_GETCPU_PRESENT",
|
||||||
"-DROCKSDB_SUPPORT_THREAD_LOCAL",
|
"-DROCKSDB_SUPPORT_THREAD_LOCAL",
|
||||||
"-DHAVE_SSE42",
|
|
||||||
"-DOS_LINUX",
|
"-DOS_LINUX",
|
||||||
"-DROCKSDB_UBSAN_RUN",
|
"-DROCKSDB_UBSAN_RUN",
|
||||||
# Flags to enable libs we include
|
# Flags to enable libs we include
|
||||||
@ -48,6 +47,10 @@ rocksdb_preprocessor_flags = [
|
|||||||
"-I" + REPO_PATH,
|
"-I" + REPO_PATH,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
rocksdb_arch_preprocessor_flags = {
|
||||||
|
"x86_64": ["-DHAVE_SSE42"],
|
||||||
|
}
|
||||||
|
|
||||||
cpp_library(
|
cpp_library(
|
||||||
name = "rocksdb_lib",
|
name = "rocksdb_lib",
|
||||||
headers = AutoHeaders.RECURSIVE_GLOB,
|
headers = AutoHeaders.RECURSIVE_GLOB,
|
||||||
@ -263,6 +266,7 @@ cpp_library(
|
|||||||
],
|
],
|
||||||
deps = [],
|
deps = [],
|
||||||
preprocessor_flags = rocksdb_preprocessor_flags,
|
preprocessor_flags = rocksdb_preprocessor_flags,
|
||||||
|
arch_preprocessor_flags = rocksdb_arch_preprocessor_flags,
|
||||||
compiler_flags = rocksdb_compiler_flags,
|
compiler_flags = rocksdb_compiler_flags,
|
||||||
external_deps = rocksdb_external_deps,
|
external_deps = rocksdb_external_deps,
|
||||||
)
|
)
|
||||||
@ -283,6 +287,7 @@ cpp_library(
|
|||||||
],
|
],
|
||||||
deps = [":rocksdb_lib"],
|
deps = [":rocksdb_lib"],
|
||||||
preprocessor_flags = rocksdb_preprocessor_flags,
|
preprocessor_flags = rocksdb_preprocessor_flags,
|
||||||
|
arch_preprocessor_flags = rocksdb_arch_preprocessor_flags,
|
||||||
compiler_flags = rocksdb_compiler_flags,
|
compiler_flags = rocksdb_compiler_flags,
|
||||||
external_deps = rocksdb_external_deps,
|
external_deps = rocksdb_external_deps,
|
||||||
)
|
)
|
||||||
@ -296,6 +301,7 @@ cpp_library(
|
|||||||
],
|
],
|
||||||
deps = [":rocksdb_lib"],
|
deps = [":rocksdb_lib"],
|
||||||
preprocessor_flags = rocksdb_preprocessor_flags,
|
preprocessor_flags = rocksdb_preprocessor_flags,
|
||||||
|
arch_preprocessor_flags = rocksdb_arch_preprocessor_flags,
|
||||||
compiler_flags = rocksdb_compiler_flags,
|
compiler_flags = rocksdb_compiler_flags,
|
||||||
external_deps = rocksdb_external_deps,
|
external_deps = rocksdb_external_deps,
|
||||||
)
|
)
|
||||||
@ -306,6 +312,7 @@ cpp_library(
|
|||||||
srcs = ["env/env_basic_test.cc"],
|
srcs = ["env/env_basic_test.cc"],
|
||||||
deps = [":rocksdb_test_lib"],
|
deps = [":rocksdb_test_lib"],
|
||||||
preprocessor_flags = rocksdb_preprocessor_flags,
|
preprocessor_flags = rocksdb_preprocessor_flags,
|
||||||
|
arch_preprocessor_flags = rocksdb_arch_preprocessor_flags,
|
||||||
compiler_flags = rocksdb_compiler_flags,
|
compiler_flags = rocksdb_compiler_flags,
|
||||||
external_deps = rocksdb_external_deps,
|
external_deps = rocksdb_external_deps,
|
||||||
)
|
)
|
||||||
@ -501,6 +508,7 @@ for test_cfg in ROCKS_TESTS:
|
|||||||
srcs = [test_cc],
|
srcs = [test_cc],
|
||||||
deps = [":rocksdb_test_lib"],
|
deps = [":rocksdb_test_lib"],
|
||||||
preprocessor_flags = rocksdb_preprocessor_flags,
|
preprocessor_flags = rocksdb_preprocessor_flags,
|
||||||
|
arch_preprocessor_flags = rocksdb_arch_preprocessor_flags,
|
||||||
compiler_flags = rocksdb_compiler_flags,
|
compiler_flags = rocksdb_compiler_flags,
|
||||||
external_deps = rocksdb_external_deps,
|
external_deps = rocksdb_external_deps,
|
||||||
)
|
)
|
||||||
|
@ -6,7 +6,7 @@ rocksdb_target_header = """
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
TARGETS_PATH = os.path.dirname(__file__)
|
TARGETS_PATH = os.path.dirname(__file__)
|
||||||
REPO_PATH = TARGETS_PATH[(TARGETS_PATH.find('fbcode/') + len('fbcode/')):] + "/"
|
REPO_PATH = "rocksdb/src/"
|
||||||
BUCK_BINS = "buck-out/gen/" + REPO_PATH
|
BUCK_BINS = "buck-out/gen/" + REPO_PATH
|
||||||
TEST_RUNNER = REPO_PATH + "buckifier/rocks_test_runner.sh"
|
TEST_RUNNER = REPO_PATH + "buckifier/rocks_test_runner.sh"
|
||||||
rocksdb_compiler_flags = [
|
rocksdb_compiler_flags = [
|
||||||
@ -18,9 +18,7 @@ rocksdb_compiler_flags = [
|
|||||||
"-DROCKSDB_RANGESYNC_PRESENT",
|
"-DROCKSDB_RANGESYNC_PRESENT",
|
||||||
"-DROCKSDB_SCHED_GETCPU_PRESENT",
|
"-DROCKSDB_SCHED_GETCPU_PRESENT",
|
||||||
"-DROCKSDB_SUPPORT_THREAD_LOCAL",
|
"-DROCKSDB_SUPPORT_THREAD_LOCAL",
|
||||||
"-DHAVE_SSE42",
|
|
||||||
"-DOS_LINUX",
|
"-DOS_LINUX",
|
||||||
"-DROCKSDB_UBSAN_RUN",
|
|
||||||
# Flags to enable libs we include
|
# Flags to enable libs we include
|
||||||
"-DSNAPPY",
|
"-DSNAPPY",
|
||||||
"-DZLIB",
|
"-DZLIB",
|
||||||
@ -51,6 +49,10 @@ rocksdb_preprocessor_flags = [
|
|||||||
"-I" + REPO_PATH + "include/",
|
"-I" + REPO_PATH + "include/",
|
||||||
"-I" + REPO_PATH,
|
"-I" + REPO_PATH,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
rocksdb_arch_preprocessor_flags = {
|
||||||
|
"x86_64": ["-DHAVE_SSE42"],
|
||||||
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@ -61,6 +63,7 @@ cpp_library(
|
|||||||
srcs = [%s],
|
srcs = [%s],
|
||||||
deps = [%s],
|
deps = [%s],
|
||||||
preprocessor_flags = rocksdb_preprocessor_flags,
|
preprocessor_flags = rocksdb_preprocessor_flags,
|
||||||
|
arch_preprocessor_flags = rocksdb_arch_preprocessor_flags,
|
||||||
compiler_flags = rocksdb_compiler_flags,
|
compiler_flags = rocksdb_compiler_flags,
|
||||||
external_deps = rocksdb_external_deps,
|
external_deps = rocksdb_external_deps,
|
||||||
)
|
)
|
||||||
@ -72,6 +75,7 @@ cpp_binary(
|
|||||||
srcs = [%s],
|
srcs = [%s],
|
||||||
deps = [%s],
|
deps = [%s],
|
||||||
preprocessor_flags = rocksdb_preprocessor_flags,
|
preprocessor_flags = rocksdb_preprocessor_flags,
|
||||||
|
arch_preprocessor_flags = rocksdb_arch_preprocessor_flags,
|
||||||
compiler_flags = rocksdb_compiler_flags,
|
compiler_flags = rocksdb_compiler_flags,
|
||||||
external_deps = rocksdb_external_deps,
|
external_deps = rocksdb_external_deps,
|
||||||
)
|
)
|
||||||
@ -94,6 +98,7 @@ for test_cfg in ROCKS_TESTS:
|
|||||||
srcs = [test_cc],
|
srcs = [test_cc],
|
||||||
deps = [":rocksdb_test_lib"],
|
deps = [":rocksdb_test_lib"],
|
||||||
preprocessor_flags = rocksdb_preprocessor_flags,
|
preprocessor_flags = rocksdb_preprocessor_flags,
|
||||||
|
arch_preprocessor_flags = rocksdb_arch_preprocessor_flags,
|
||||||
compiler_flags = rocksdb_compiler_flags,
|
compiler_flags = rocksdb_compiler_flags,
|
||||||
external_deps = rocksdb_external_deps,
|
external_deps = rocksdb_external_deps,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user