Skip to content
Snippets Groups Projects
Commit db8dc59d authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon:
Browse files

chore(build): fix build on macOS

parent 4fd7f7f6
No related branches found
No related tags found
1 merge request!58chore(build): fix build on macOS
Pipeline #3627 passed
......@@ -116,22 +116,29 @@ fn build_tarantool() {
"cpu_feature",
"luajit",
"yaml_static",
"gomp",
] {
println!("cargo:rustc-link-lib=static={}", l);
}
// These two must be linked as positional arguments, because they define
// duplicate symbols which is not allowed (by default) when linking with via
// -l... option
println!(
"cargo:rustc-link-arg={}/build/unwind-prefix/lib/libunwind-x86_64.a",
dst.display()
);
println!(
"cargo:rustc-link-arg={}/build/unwind-prefix/lib/libunwind.a",
dst.display()
);
if !cfg!(target_os = "macos") {
// OpenMP is builtin to the compiler on macos
println!("cargo:rustc-link-lib=static=gomp");
// Libunwind is builtin to the compiler on macos
//
// These two must be linked as positional arguments, because they define
// duplicate symbols which is not allowed (by default) when linking with
// via -l... option
println!(
"cargo:rustc-link-arg={}/build/unwind-prefix/lib/libunwind-x86_64.a",
dst.display()
);
println!(
"cargo:rustc-link-arg={}/build/unwind-prefix/lib/libunwind.a",
dst.display()
);
}
println!("cargo:rustc-link-arg=-lc");
println!(
......@@ -186,7 +193,17 @@ fn build_tarantool() {
);
println!("cargo:rustc-link-lib=static=tinfo");
println!("cargo:rustc-link-lib=dylib=stdc++");
println!(
"cargo:rustc-link-search=native={}/build/iconv-prefix/lib",
dst.display()
);
println!("cargo:rustc-link-arg=-export-dynamic");
if cfg!(target_os = "macos") {
// -lc++ instead of -lstdc++ on macos
println!("cargo:rustc-link-lib=dylib=c++");
} else {
// not supported on macos
println!("cargo:rustc-link-arg=-export-dynamic");
println!("cargo:rustc-link-lib=dylib=stdc++");
}
}
From f30c339585525b7eebc1714b3a5dd263723177f8 Mon Sep 17 00:00:00 2001
From: Georgy Moshkin <gmoshkin@picodata.io>
Date: Thu, 24 Feb 2022 06:43:20 -0800
Subject: [PATCH] build: update openssl version to support arm64-apple
---
static-build/CMakeLists.txt | 8 ++++----
6 files changed, 51 insertions(+), 10 deletions(-)
diff --git a/static-build/CMakeLists.txt b/static-build/CMakeLists.txt
index 598c42bbc..2ff8906b1 100644
--- a/static-build/CMakeLists.txt
+++ b/static-build/CMakeLists.txt
@@ -8,11 +8,11 @@ cmake_minimum_required(VERSION 2.8)
project(tarantool-static C CXX)
include(ExternalProject)
-set(OPENSSL_VERSION 1.1.1f)
-set(OPENSSL_HASH 3f486f2f4435ef14b81814dbbc7b48bb)
+set(OPENSSL_VERSION 1.1.1m)
+set(OPENSSL_HASH 8ec70f665c145c3103f6e330f538a9db)
set(ZLIB_VERSION 1.2.11)
set(ZLIB_HASH 1c9f62f0778697a09d36121ead88e08e)
set(NCURSES_VERSION 6.2)
set(NCURSES_HASH e812da327b1c2214ac1aed440ea3ae8d)
set(READLINE_VERSION 8.0)
set(READLINE_HASH 7e6c1f16aee3244a69aba6e438295ca3)
--
2.32.0 (Apple Git-132)
From da9f7b4ee2423fb04976efca9f253d8c87e18002 Mon Sep 17 00:00:00 2001
From: Georgy Moshkin <gmoshkin@picodata.io>
Date: Tue, 8 Mar 2022 10:47:31 -0800
Subject: [PATCH] build: fix build on macOS 11.5 or higher
---
static-build/CMakeLists.txt | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/static-build/CMakeLists.txt b/static-build/CMakeLists.txt
index 598c42bbc..3525e294c 100644
--- a/static-build/CMakeLists.txt
+++ b/static-build/CMakeLists.txt
@@ -205,7 +205,7 @@ if (APPLE)
# So we need to find library and header and
# copy it locally
find_path(UNWIND_INCLUDE_DIR libunwind.h)
- find_library(UNWIND_LIBRARY libunwind.dylib
+ find_library(UNWIND_LIBRARY libunwind.tbd
PATH_SUFFIXES system
)
@@ -225,7 +225,7 @@ if (APPLE)
"${UNWIND_INSTALL_PREFIX}/include/"
)
add_custom_command(
- OUTPUT "${UNWIND_INSTALL_PREFIX}/lib/libunwind.dylib"
+ OUTPUT "${UNWIND_INSTALL_PREFIX}/lib/libunwind.tbd"
COMMAND ${CMAKE_COMMAND} -E make_directory
"${UNWIND_INSTALL_PREFIX}/lib"
COMMAND ${CMAKE_COMMAND} -E copy
@@ -234,7 +234,7 @@ if (APPLE)
)
set(UNWIND_DEPENDENCIES
${UNWIND_DEPENDENCIES}
- "${UNWIND_INSTALL_PREFIX}/lib/libunwind.dylib"
+ "${UNWIND_INSTALL_PREFIX}/lib/libunwind.tbd"
"${UNWIND_INSTALL_PREFIX}/include/libunwind.h"
)
else()
--
2.32.0 (Apple Git-132)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment