diff --git a/project/CMakeLists.txt b/project/CMakeLists.txt index c60b86b..856f394 100644 --- a/project/CMakeLists.txt +++ b/project/CMakeLists.txt @@ -81,7 +81,8 @@ endif() message(STATUS "MIPS_LINK_FLAGS: ${MIPS_LINK_FLAGS}") -set(extra_link_libs "${MIPS_LINK_FLAGS} -static-libstdc++ -static-libgcc -pthread -ldl") +set(extra_lib_dirs "-L${CMAKE_INSTALL_PREFIX}/lib -L${CMAKE_INSTALL_PREFIX}/lib64") +set(extra_link_libs "${MIPS_LINK_FLAGS} ${extra_lib_dirs} -static-libstdc++ -static-libgcc -pthread -ldl") if (${DISABLE_CXX11_ABI}) set(extra_cpp_flags "-D_GLIBCXX_USE_CXX11_ABI=0") else() @@ -99,6 +100,7 @@ set(common_cmake_args "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fPIC ${extra_cpp_flags}" "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fPIC" "-DCMAKE_EXE_LINKER_FLAGS=${extra_link_libs}" + -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath=\$ORIGIN:\$ORIGIN/../3rd -DCMAKE_INCLUDE_PATH=${CMAKE_INSTALL_PREFIX}/include -DCMAKE_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib -DBUILD_SHARED_LIBS=ON @@ -138,6 +140,7 @@ set(common_configure_envs "CXXFLAGS=${CMAKE_CXX_FLAGS} -fcommon -fno-omit-frame-pointer -fPIC -O2 -D_DEFAULT_SOURCE -D_GNU_SOURCE ${extra_cpp_flags}" "CPPFLAGS=-isystem ${CMAKE_INSTALL_PREFIX}/include -I${BERKELEYDB_INCLUDE_DIR} ${extra_cpp_flags}" "LDFLAGS=-Wl,-rpath=\\\\$\\$ORIGIN ${ld_flags}" + "LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib64" "PATH=${BUILDING_PATH}" "ACLOCAL_PATH=${ACLOCAL_PATH}" ) diff --git a/project/externals/abseil.cmake b/project/externals/abseil.cmake index 2b8f401..076f86b 100644 --- a/project/externals/abseil.cmake +++ b/project/externals/abseil.cmake @@ -17,7 +17,6 @@ ExternalProject_Add( CMAKE_ARGS ${common_cmake_args} -DCMAKE_BUILD_TYPE=Release - -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath=\$ORIGIN:\$ORIGIN/../3rd BUILD_IN_SOURCE 1 BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} INSTALL_COMMAND make -s install -j${BUILDING_JOBS_NUM} diff --git a/project/externals/arrow.cmake b/project/externals/arrow.cmake index e480d86..ada9680 100644 --- a/project/externals/arrow.cmake +++ b/project/externals/arrow.cmake @@ -31,7 +31,6 @@ set(ARROW_CMAKE_ARGS -DARROW_TEST_MEMCHECK=OFF -DARROW_PYTHON=OFF -DUSE_LLVM_CXX=${USE_LLVM_CXX} - -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath=\$ORIGIN:\$ORIGIN/../3rd -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} ) diff --git a/project/externals/cyrus-sasl.cmake b/project/externals/cyrus-sasl.cmake index 82a4919..38ccf07 100644 --- a/project/externals/cyrus-sasl.cmake +++ b/project/externals/cyrus-sasl.cmake @@ -16,8 +16,6 @@ ExternalProject_Add( SOURCE_DIR ${source_dir} CONFIGURE_COMMAND ${common_configure_envs} - "LDFLAGS=${ld_flags} -lcrypto -lcrypt -ldb-5.1" - "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib64:${CMAKE_INSTALL_PREFIX}/lib/berkeleydb-5.1.29:$LD_LIBRARY_PATH" ./autogen.sh ${common_configure_args} --disable-static --enable-shared diff --git a/project/externals/duckdb.cmake b/project/externals/duckdb.cmake index e114d14..d091310 100644 --- a/project/externals/duckdb.cmake +++ b/project/externals/duckdb.cmake @@ -6,7 +6,7 @@ set(name duckdb) set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) -set(MakeEnvs "env" "GEN=ninja") +set(make_envs "env" "GEN=ninja") ExternalProject_Add( ${name} URL https://github.com/duckdb/duckdb/archive/refs/tags/v0.6.1.tar.gz @@ -20,7 +20,7 @@ ExternalProject_Add( PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/patches/${name}-0.6.1.patch CONFIGURE_COMMAND "" BUILD_COMMAND - "${MakeEnvs}" + "${make_envs}" make -e -s -j${BUILDING_JOBS_NUM} BUILD_IN_SOURCE 1 INSTALL_COMMAND "" diff --git a/project/externals/fbthrift.cmake b/project/externals/fbthrift.cmake index e051800..175c58d 100644 --- a/project/externals/fbthrift.cmake +++ b/project/externals/fbthrift.cmake @@ -22,7 +22,6 @@ ExternalProject_Add( -DCMAKE_BUILD_TYPE=Release -DBoost_NO_BOOST_CMAKE=ON -Denable_tests=OFF - -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath=\$ORIGIN:\$ORIGIN/../3rd -D_OPENSSL_LIBDIR=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} BUILD_IN_SOURCE 1 diff --git a/project/externals/fizz.cmake b/project/externals/fizz.cmake index 4441e95..b638c34 100644 --- a/project/externals/fizz.cmake +++ b/project/externals/fizz.cmake @@ -22,7 +22,6 @@ ExternalProject_Add( -DBoost_NO_BOOST_CMAKE=ON -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release - -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath=\$ORIGIN:\$ORIGIN/../3rd -D_OPENSSL_LIBDIR=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} BUILD_IN_SOURCE 1 diff --git a/project/externals/folly.cmake b/project/externals/folly.cmake index 2bfa406..5ed28dc 100644 --- a/project/externals/folly.cmake +++ b/project/externals/folly.cmake @@ -22,7 +22,6 @@ ExternalProject_Add( "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -fPIC -D__STDC_FORMAT_MACROS=1 -DFOLLY_HAVE_CLOCK_GETTIME -D__USE_POSIX199309 ${extra_cpp_flags}" -DPACKAGE_VERSION=2022.12.26 -DFOLLY_CXX_FLAGS=-Wno-error - -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath=\$ORIGIN:\$ORIGIN/../3rd BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} BUILD_IN_SOURCE 1 INSTALL_COMMAND make -s -j${BUILDING_JOBS_NUM} install/strip diff --git a/project/externals/glog.cmake b/project/externals/glog.cmake index c28d3b5..1f8c6f9 100644 --- a/project/externals/glog.cmake +++ b/project/externals/glog.cmake @@ -17,8 +17,6 @@ ExternalProject_Add( CMAKE_ARGS ${common_cmake_args} -DCMAKE_BUILD_TYPE=Release - -DCMAKE_EXE_LINKER_FLAGS=-lz - -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath=\$ORIGIN:\$ORIGIN/../3rd BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} BUILD_IN_SOURCE 1 INSTALL_COMMAND make -s -j${BUILDING_JOBS_NUM} install diff --git a/project/externals/googlebenchmark.cmake b/project/externals/googlebenchmark.cmake index 13f9e63..c838043 100644 --- a/project/externals/googlebenchmark.cmake +++ b/project/externals/googlebenchmark.cmake @@ -19,7 +19,6 @@ ExternalProject_Add( ${common_cmake_args} -DBENCHMARK_ENABLE_GTEST_TESTS=OFF -DCMAKE_BUILD_TYPE=Release - -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath=\$ORIGIN:\$ORIGIN/../3rd "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -Wno-error=unused-parameter" BUILD_IN_SOURCE 1 BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} diff --git a/project/externals/ldap.cmake b/project/externals/ldap.cmake index b7c5403..60f4045 100644 --- a/project/externals/ldap.cmake +++ b/project/externals/ldap.cmake @@ -15,12 +15,13 @@ ExternalProject_Add( SOURCE_DIR ${source_dir} CONFIGURE_COMMAND ${common_configure_envs} - ./configure ${common_configure_args} - --enable-syslog - --enable-modules=no - --enable-shared=yes - --enable-static=no - --with-tls + ./configure + ${common_configure_args} + --enable-syslog + --enable-modules=no + --enable-shared=yes + --enable-static=no + --with-tls BUILD_IN_SOURCE 1 BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} INSTALL_COMMAND make -s -j${BUILDING_JOBS_NUM} install diff --git a/project/externals/libcurl.cmake b/project/externals/libcurl.cmake index 2bf3e35..0f63ccb 100644 --- a/project/externals/libcurl.cmake +++ b/project/externals/libcurl.cmake @@ -21,7 +21,6 @@ ExternalProject_Add( -DUSE_LIBIDN2=OFF -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON - -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath=\$ORIGIN:\$ORIGIN/../3rd BUILD_IN_SOURCE 1 BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} INSTALL_COMMAND make -s -j${BUILDING_JOBS_NUM} install diff --git a/project/externals/libevent.cmake b/project/externals/libevent.cmake index 0cb2a33..db270a7 100644 --- a/project/externals/libevent.cmake +++ b/project/externals/libevent.cmake @@ -22,7 +22,6 @@ ExternalProject_Add( -DEVENT__DISABLE_BENCHMARK=ON -DEVENT__DISABLE_SAMPLES=ON -DEVENT__DISABLE_REGRESS=ON - -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath=\$ORIGIN:\$ORIGIN/../3rd BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} BUILD_IN_SOURCE 1 INSTALL_COMMAND make -s install -j${BUILDING_JOBS_NUM} diff --git a/project/externals/proxygen.cmake b/project/externals/proxygen.cmake index 334d766..4681b43 100644 --- a/project/externals/proxygen.cmake +++ b/project/externals/proxygen.cmake @@ -15,6 +15,7 @@ ExternalProject_Add( STAMP_DIR ${BUILD_INFO_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR} SOURCE_DIR ${source_dir} + PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/patches/${name}-2022-12-26.patch CMAKE_ARGS ${common_cmake_args} -DBoost_NO_BOOST_CMAKE=ON @@ -22,8 +23,8 @@ ExternalProject_Add( -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF -DPACKAGE_VERSION=2022.12.26 - -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath=\$ORIGIN:\$ORIGIN/../3rd - "-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++ -static-libgcc -pthread" + "-DCMAKE_EXE_LINKER_FLAGS=${extra_lib_dirs} -static-libstdc++ -static-libgcc -pthread" + "-DCMAKE_SHARED_LINKER_FLAGS=${extra_lib_dirs} -Wl,-rpath=\$ORIGIN:\$ORIGIN/../3rd" BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} BUILD_IN_SOURCE 1 INSTALL_COMMAND make -s -j${BUILDING_JOBS_NUM} install diff --git a/project/externals/rocksdb.cmake b/project/externals/rocksdb.cmake index f81d171..2eab9ee 100644 --- a/project/externals/rocksdb.cmake +++ b/project/externals/rocksdb.cmake @@ -14,6 +14,7 @@ ExternalProject_Add( STAMP_DIR ${BUILD_INFO_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR} SOURCE_DIR ${source_dir} + PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/patches/${name}-7.8.3.patch UPDATE_COMMAND "" CMAKE_ARGS ${common_cmake_args} @@ -31,7 +32,7 @@ ExternalProject_Add( -DUSE_RTTI=ON -DFAIL_ON_WARNINGS=OFF -DCMAKE_BUILD_TYPE=Release - -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath=\$ORIGIN:\$ORIGIN/../3rd + "-DCMAKE_EXE_LINKER_FLAGS=${extra_lib_dirs} -lbz2 -lsnappy" "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -D NPERF_CONTEXT" BUILD_IN_SOURCE 1 BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} diff --git a/project/externals/wangle.cmake b/project/externals/wangle.cmake index 21bfb6f..63a1280 100644 --- a/project/externals/wangle.cmake +++ b/project/externals/wangle.cmake @@ -33,7 +33,6 @@ ExternalProject_Add_Step(${name} mannual-configure -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DCMAKE_EXE_LINKER_FLAGS=-latomic - "-DCMAKE_SHARED_LINKER_FLAGS=-latomic -Wl,-rpath=\$ORIGIN:\$ORIGIN/../3rd" -D_OPENSSL_LIBDIR=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} . WORKING_DIRECTORY /wangle diff --git a/project/patches/cachelib-2022-12-26.patch b/project/patches/cachelib-2022-12-26.patch index 122bc50..dee1a3a 100644 --- a/project/patches/cachelib-2022-12-26.patch +++ b/project/patches/cachelib-2022-12-26.patch @@ -12,3 +12,15 @@ diff -ur a/cachelib/shm/ShmCommon.h b/cachelib/shm/ShmCommon.h /* On Mac OS / FreeBSD, mmap(2) syscall does not support these flags */ #ifndef MAP_LOCKED #define MAP_LOCKED 0 +diff -ur a/cachelib/allocator/MarginalHitsState-inl.h b/cachelib/allocator/MarginalHitsState-inl.h +--- a/cachelib/allocator/MarginalHitsState-inl.h 2022-12-25 17:00:33.000000000 +0800 ++++ b/cachelib/allocator/MarginalHitsState-inl.h 2023-12-12 11:54:16.430563776 +0800 +@@ -14,6 +14,8 @@ + * limitations under the License. + */ + ++#include ++ + namespace facebook { + namespace cachelib { + template diff --git a/project/patches/duckdb-0.6.1.patch b/project/patches/duckdb-0.6.1.patch index 956f0c7..2983509 100644 --- a/project/patches/duckdb-0.6.1.patch +++ b/project/patches/duckdb-0.6.1.patch @@ -4,7 +4,7 @@ diff -ur a/CMakeLists.txt b/CMakeLists.txt @@ -216,54 +216,11 @@ set(SUN TRUE) endif() - + -find_package(Git) -if(Git_FOUND) - if (NOT DEFINED GIT_COMMIT_HASH) @@ -58,7 +58,7 @@ diff -ur a/CMakeLists.txt b/CMakeLists.txt +set(DUCKDB_PATCH_VERSION 1) +set(DUCKDB_DEV_ITERATION 0) +set(DUCKDB_VERSION "v${DUCKDB_MAJOR_VERSION}.${DUCKDB_MINOR_VERSION}.${DUCKDB_PATCH_VERSION}-dev${DUCKDB_DEV_ITERATION}") - + option(AMALGAMATION_BUILD "Build from the amalgamation files, rather than from the normal sources." diff -ur a/scripts/amalgamation.py b/scripts/amalgamation.py @@ -72,6 +72,17 @@ diff -ur a/scripts/amalgamation.py b/scripts/amalgamation.py - hfile.write("#define DUCKDB_VERSION \"%s\"\n" % git_dev_version()) +# hfile.write("#define DUCKDB_SOURCE_ID \"%s\"\n" % git_commit_hash()) +# hfile.write("#define DUCKDB_VERSION \"%s\"\n" % git_dev_version()) - + for fpath in main_header_files: hfile.write(write_file(fpath)) +diff -ur a/third_party/thrift/thrift/TApplicationException.h b/third_party/thrift/thrift/TApplicationException.h +--- a/third_party/thrift/thrift/TApplicationException.h 2022-12-06 14:15:51.000000000 +0800 ++++ b/third_party/thrift/thrift/TApplicationException.h 2023-12-17 17:10:08.964516203 +0800 +@@ -20,6 +20,7 @@ + #ifndef _DUCKDB_THRIFT_TAPPLICATIONEXCEPTION_H_ + #define _DUCKDB_THRIFT_TAPPLICATIONEXCEPTION_H_ 1 + ++#include + #include "thrift/Thrift.h" + + namespace duckdb_apache { diff --git a/project/patches/fbthrift-2022-12-26.patch b/project/patches/fbthrift-2022-12-26.patch index 66c03d2..5ef9bec 100644 --- a/project/patches/fbthrift-2022-12-26.patch +++ b/project/patches/fbthrift-2022-12-26.patch @@ -22,3 +22,13 @@ diff -ur a/thrift/lib/cpp2/server/IOWorkerContext.h b/thrift/lib/cpp2/server/IOW } }); } +diff -ur a/thrift/compiler/generate/json.cc b/thrift/compiler/generate/json.cc +--- a/thrift/compiler/generate/json.cc 2022-12-25 17:00:33.000000000 +0800 ++++ b/thrift/compiler/generate/json.cc 2023-12-12 10:57:27.256511493 +0800 +@@ -16,6 +16,7 @@ + + #include + ++#include + #include + #include diff --git a/project/patches/folly-2022-12-26.patch b/project/patches/folly-2022-12-26.patch index 40b5702..66a5159 100644 --- a/project/patches/folly-2022-12-26.patch +++ b/project/patches/folly-2022-12-26.patch @@ -50,3 +50,16 @@ diff -ur a/CMakeLists.txt b/CMakeLists.txt else() string(FIND "${CMAKE_LIBRARY_ARCHITECTURE}" "x86_64" IS_X86_64_ARCH) if(IS_X86_64_ARCH STREQUAL "-1") +diff -ur a/folly/system/AtFork.cpp b/folly/system/AtFork.cpp +--- a/folly/system/AtFork.cpp 2022-12-24 20:17:25.000000000 +0800 ++++ b/folly/system/AtFork.cpp 2023-12-12 10:44:30.560711808 +0800 +@@ -16,6 +16,9 @@ + + #include + ++#include ++#include ++ + #include + #include + #include diff --git a/project/patches/proxygen-2022-12-26.patch b/project/patches/proxygen-2022-12-26.patch new file mode 100644 index 0000000..ca674b9 --- /dev/null +++ b/project/patches/proxygen-2022-12-26.patch @@ -0,0 +1,22 @@ +diff -ur a/proxygen/lib/utils/ConsistentHash.h b/proxygen/lib/utils/ConsistentHash.h +--- a/proxygen/lib/utils/ConsistentHash.h 2022-12-25 17:00:33.000000000 +0800 ++++ b/proxygen/lib/utils/ConsistentHash.h 2023-12-12 14:23:09.206845550 +0800 +@@ -8,6 +8,7 @@ + + #pragma once + ++#include + #include + #include + +diff -ur a/proxygen/lib/utils/RendezvousHash.h b/proxygen/lib/utils/RendezvousHash.h +--- a/proxygen/lib/utils/RendezvousHash.h 2022-12-25 17:00:33.000000000 +0800 ++++ b/proxygen/lib/utils/RendezvousHash.h 2023-12-12 14:24:00.470176104 +0800 +@@ -9,6 +9,7 @@ + #pragma once + + #include ++#include + #include + #include + diff --git a/project/patches/rocksdb-7.8.3.patch b/project/patches/rocksdb-7.8.3.patch new file mode 100644 index 0000000..4112464 --- /dev/null +++ b/project/patches/rocksdb-7.8.3.patch @@ -0,0 +1,33 @@ +diff -ur a/table/block_based/data_block_hash_index.h b/table/block_based/data_block_hash_index.h +--- a/table/block_based/data_block_hash_index.h 2022-11-29 22:51:03.000000000 +0800 ++++ b/table/block_based/data_block_hash_index.h 2023-12-12 11:06:59.473183192 +0800 +@@ -5,6 +5,7 @@ + + #pragma once + ++#include + #include + #include + +diff -ur a/trace_replay/trace_replay.h b/trace_replay/trace_replay.h +--- a/trace_replay/trace_replay.h 2022-11-29 22:51:03.000000000 +0800 ++++ b/trace_replay/trace_replay.h 2023-12-12 11:19:17.580647984 +0800 +@@ -5,6 +5,7 @@ + + #pragma once + ++#include + #include + #include + #include +diff -ur a/util/string_util.h b/util/string_util.h +--- a/util/string_util.h 2022-11-29 22:51:03.000000000 +0800 ++++ b/util/string_util.h 2023-12-12 11:21:51.858138573 +0800 +@@ -6,6 +6,7 @@ + + #pragma once + ++#include + #include + #include + #include