From 5d881ac4b70b002a561f680a6cbac305ad126a98 Mon Sep 17 00:00:00 2001 From: liguohao <948193394@qq.com> Date: Mon, 1 Aug 2022 20:30:48 +0800 Subject: [PATCH 1/3] feat: Support Build on M1 MacOS --- .licenserc.yaml | 1 + thirdparty/CMakeLists.txt | 1 + thirdparty/fix_jemalloc_for_m1_on_macos.patch | 10 ++++++++++ 3 files changed, 12 insertions(+) create mode 100644 thirdparty/fix_jemalloc_for_m1_on_macos.patch diff --git a/.licenserc.yaml b/.licenserc.yaml index 9750ec90be..2b2c69d7dc 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -90,6 +90,7 @@ header: - 'thirdparty/fix_libevent_for_macos.patch' - 'thirdparty/fix_s2_for_aarch64.patch' - 'thirdparty/fix_thrift_for_cpp11.patch' + - 'thirdparty/fix_jemalloc_for_m1_on_macos.patch' # should be empty, or ignore all comment lines - 'src/rdsn/src/utils/test/config-empty.ini' # The MIT License (MIT), Copyright (c) 2015 Microsoft Corporation diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 1d153f82fc..fc3cc70df3 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -381,6 +381,7 @@ ExternalProject_Add(jemalloc URL ${OSS_URL_PREFIX}/jemalloc-5.2.1.tar.bz2 https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2 URL_MD5 3d41fbf006e6ebffd489bdb304d009ae + PATCH_COMMAND patch -p0 < ${TP_DIR}/fix_jemalloc_for_m1_on_macos.patch CONFIGURE_COMMAND ./configure --prefix=${TP_OUTPUT} --enable-cxx --enable-stats --enable-prof BUILD_COMMAND make INSTALL_COMMAND make install diff --git a/thirdparty/fix_jemalloc_for_m1_on_macos.patch b/thirdparty/fix_jemalloc_for_m1_on_macos.patch new file mode 100644 index 0000000000..a0333eae2c --- /dev/null +++ b/thirdparty/fix_jemalloc_for_m1_on_macos.patch @@ -0,0 +1,10 @@ +--- configure 2022-02-16 01:43:33.470553518 +0000 ++++ configure.new 2022-02-16 01:43:24.149733186 +0000 +@@ -7175,6 +7175,7 @@ + fi + + fi ++if test "x${je_cv_lg_vaddr}" = "x0" ; then je_cv_lg_vaddr=48 ;fi # For podman/docker/qemu on macos dev build. + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $je_cv_lg_vaddr" >&5 + $as_echo "$je_cv_lg_vaddr" >&6; } + if test "x${je_cv_lg_vaddr}" != "x" ; then From 6d6772929ca161a09d4881f1e12ca118a7d7aaa4 Mon Sep 17 00:00:00 2001 From: liguohao <48315319+GehaFearless@users.noreply.github.com> Date: Wed, 3 Aug 2022 10:48:55 +0800 Subject: [PATCH 2/3] Update .licenserc.yaml Co-authored-by: Yingchun Lai --- .licenserc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.licenserc.yaml b/.licenserc.yaml index 2b2c69d7dc..0f82a44717 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -87,10 +87,10 @@ header: - 'src/rdsn/src/nfs/test/nfs_test_file2' - 'src/rdsn/src/runtime/test/gtest.filter' - 'thirdparty/fix_fds_for_macos.patch' + - 'thirdparty/fix_jemalloc_for_m1_on_macos.patch' - 'thirdparty/fix_libevent_for_macos.patch' - 'thirdparty/fix_s2_for_aarch64.patch' - 'thirdparty/fix_thrift_for_cpp11.patch' - - 'thirdparty/fix_jemalloc_for_m1_on_macos.patch' # should be empty, or ignore all comment lines - 'src/rdsn/src/utils/test/config-empty.ini' # The MIT License (MIT), Copyright (c) 2015 Microsoft Corporation From 1f1acd8fa510361434bf5fc3d7ba4ac31a921cec Mon Sep 17 00:00:00 2001 From: liguohao <948193394@qq.com> Date: Wed, 3 Aug 2022 11:41:46 +0800 Subject: [PATCH 3/3] test change patch --- thirdparty/fix_jemalloc_for_m1_on_macos.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/fix_jemalloc_for_m1_on_macos.patch b/thirdparty/fix_jemalloc_for_m1_on_macos.patch index a0333eae2c..ab009e53fc 100644 --- a/thirdparty/fix_jemalloc_for_m1_on_macos.patch +++ b/thirdparty/fix_jemalloc_for_m1_on_macos.patch @@ -4,7 +4,7 @@ fi fi -+if test "x${je_cv_lg_vaddr}" = "x0" ; then je_cv_lg_vaddr=48 ;fi # For podman/docker/qemu on macos dev build. ++if test "x${je_cv_lg_vaddr}" = "x0" ; then je_cv_lg_vaddr=48 ;fi # For podman/docker/qemu on macos dev build { $as_echo "$as_me:${as_lineno-$LINENO}: result: $je_cv_lg_vaddr" >&5 $as_echo "$je_cv_lg_vaddr" >&6; } if test "x${je_cv_lg_vaddr}" != "x" ; then