summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authornikoPLP <57370730+nikoPLP@users.noreply.github.com>2023-08-11 10:59:49 -0700
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>2023-08-11 10:59:49 -0700
commit17b33c8b2f4d3485aa7fc461e468997e0d52b581 (patch)
tree735228d0a11e045e9b537c4d36a80d74481b655f /Makefile
parent66643b8106ba72f5a266d9b06b65aaafb507911c (diff)
fix CXX not initialized early enough in Makefile on openbsd + platform version 10.14 on macos (#11675)
Summary: fixes https://github.com/facebook/rocksdb/issues/11220 fixes https://github.com/facebook/rocksdb/issues/11594 CXX is not initialized early enough in Makefile. On OpenBSD its value is `g++` at first, and this results in several `command not found`, notably during the tests for HAVE_POWER8 and HAS_ALTIVEC which results in the build problem mentionned in https://github.com/facebook/rocksdb/issues/11594 reordering the Makefile fixes the issue, by placing the creation of make_config.mk and its import before any use of `$(CXX)` Also, fixes the platofrm version for macos. it must be 10.14 now that rocksdb is using the C++17 standard Pull Request resolved: https://github.com/facebook/rocksdb/pull/11675 Reviewed By: cbi42 Differential Revision: D48101615 Pulled By: ajkr fbshipit-source-id: 1f1b4d4604480b31675140b92c6fe97dc55b8c75
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 19 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index a1ea379d7..41ca0ee28 100644
--- a/Makefile
+++ b/Makefile
@@ -88,6 +88,25 @@ endif
$(info $$DEBUG_LEVEL is $(DEBUG_LEVEL), $$LIB_MODE is $(LIB_MODE))
+# Detect what platform we're building on.
+# Export some common variables that might have been passed as Make variables
+# instead of environment variables.
+dummy := $(shell (export ROCKSDB_ROOT="$(CURDIR)"; \
+ export CXXFLAGS="$(EXTRA_CXXFLAGS)"; \
+ export LDFLAGS="$(EXTRA_LDFLAGS)"; \
+ export COMPILE_WITH_ASAN="$(COMPILE_WITH_ASAN)"; \
+ export COMPILE_WITH_TSAN="$(COMPILE_WITH_TSAN)"; \
+ export COMPILE_WITH_UBSAN="$(COMPILE_WITH_UBSAN)"; \
+ export PORTABLE="$(PORTABLE)"; \
+ export ROCKSDB_NO_FBCODE="$(ROCKSDB_NO_FBCODE)"; \
+ export USE_CLANG="$(USE_CLANG)"; \
+ export LIB_MODE="$(LIB_MODE)"; \
+ export ROCKSDB_CXX_STANDARD="$(ROCKSDB_CXX_STANDARD)"; \
+ export USE_FOLLY="$(USE_FOLLY)"; \
+ "$(CURDIR)/build_tools/build_detect_platform" "$(CURDIR)/make_config.mk"))
+# this file is generated by the previous line to set build flags and sources
+include make_config.mk
+
# Figure out optimize level.
ifneq ($(DEBUG_LEVEL), 2)
OPTIMIZE_LEVEL ?= -O2
@@ -223,25 +242,6 @@ am__v_AR_1 =
AM_LINK = $(AM_V_CCLD)$(CXX) -L. $(patsubst lib%.a, -l%, $(patsubst lib%.$(PLATFORM_SHARED_EXT), -l%, $^)) $(EXEC_LDFLAGS) -o $@ $(LDFLAGS) $(COVERAGEFLAGS)
AM_SHARE = $(AM_V_CCLD) $(CXX) $(PLATFORM_SHARED_LDFLAGS)$@ -L. $(patsubst lib%.$(PLATFORM_SHARED_EXT), -l%, $^) $(EXEC_LDFLAGS) $(LDFLAGS) -o $@
-# Detect what platform we're building on.
-# Export some common variables that might have been passed as Make variables
-# instead of environment variables.
-dummy := $(shell (export ROCKSDB_ROOT="$(CURDIR)"; \
- export CXXFLAGS="$(EXTRA_CXXFLAGS)"; \
- export LDFLAGS="$(EXTRA_LDFLAGS)"; \
- export COMPILE_WITH_ASAN="$(COMPILE_WITH_ASAN)"; \
- export COMPILE_WITH_TSAN="$(COMPILE_WITH_TSAN)"; \
- export COMPILE_WITH_UBSAN="$(COMPILE_WITH_UBSAN)"; \
- export PORTABLE="$(PORTABLE)"; \
- export ROCKSDB_NO_FBCODE="$(ROCKSDB_NO_FBCODE)"; \
- export USE_CLANG="$(USE_CLANG)"; \
- export LIB_MODE="$(LIB_MODE)"; \
- export ROCKSDB_CXX_STANDARD="$(ROCKSDB_CXX_STANDARD)"; \
- export USE_FOLLY="$(USE_FOLLY)"; \
- "$(CURDIR)/build_tools/build_detect_platform" "$(CURDIR)/make_config.mk"))
-# this file is generated by the previous line to set build flags and sources
-include make_config.mk
-
ROCKSDB_PLUGIN_MKS = $(foreach plugin, $(ROCKSDB_PLUGINS), plugin/$(plugin)/*.mk)
include $(ROCKSDB_PLUGIN_MKS)
ROCKSDB_PLUGIN_PROTO =ROCKSDB_NAMESPACE::ObjectLibrary\&, const std::string\&