From 1178d348aaabc4330b2078d29625f5cd1bf9534d Mon Sep 17 00:00:00 2001 From: Sahir Hoda <50241373+shoda-tibco@users.noreply.github.com> Date: Tue, 16 Nov 2021 12:16:11 -0800 Subject: [PATCH] Fix portable mac shared_library ld flags (#9149) Summary: Move the 'macosx-version-min' arg to the front of PLATFORM_SHARED_LDFLAGS so that it doesn't get concatenated with the library name. Fixes https://github.com/facebook/rocksdb/issues/9146 Pull Request resolved: https://github.com/facebook/rocksdb/pull/9149 Reviewed By: mrambacher Differential Revision: D32396101 Pulled By: pdillinger fbshipit-source-id: aefcf53384e64d399049f158779acc3a4e54a8fe --- build_tools/build_detect_platform | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build_tools/build_detect_platform b/build_tools/build_detect_platform index 8d5a72e23..8e2107036 100755 --- a/build_tools/build_detect_platform +++ b/build_tools/build_detect_platform @@ -675,7 +675,8 @@ else # For portability compile for macOS 10.12 (2016) or newer COMMON_FLAGS="$COMMON_FLAGS -mmacosx-version-min=10.12" PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -mmacosx-version-min=10.12" - PLATFORM_SHARED_LDFLAGS="$PLATFORM_SHARED_LDFLAGS -mmacosx-version-min=10.12" + # -mmacosx-version-min must come first here. + PLATFORM_SHARED_LDFLAGS="-mmacosx-version-min=10.12 $PLATFORM_SHARED_LDFLAGS" PLATFORM_CMAKE_FLAGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12" JAVA_STATIC_DEPS_COMMON_FLAGS="-mmacosx-version-min=10.12" JAVA_STATIC_DEPS_LDFLAGS="$JAVA_STATIC_DEPS_COMMON_FLAGS"