Skip to content

Commit

Permalink
Fixed build on Fedora 38
Browse files Browse the repository at this point in the history
  • Loading branch information
sherman-the-tank committed Dec 17, 2023
1 parent 924af9d commit 950cd03
Show file tree
Hide file tree
Showing 22 changed files with 122 additions and 28 deletions.
5 changes: 4 additions & 1 deletion project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down Expand Up @@ -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}"
)
Expand Down
1 change: 0 additions & 1 deletion project/externals/abseil.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
1 change: 0 additions & 1 deletion project/externals/arrow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)

Expand Down
2 changes: 0 additions & 2 deletions project/externals/cyrus-sasl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions project/externals/duckdb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ""
Expand Down
1 change: 0 additions & 1 deletion project/externals/fbthrift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion project/externals/fizz.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion project/externals/folly.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions project/externals/glog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion project/externals/googlebenchmark.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
13 changes: 7 additions & 6 deletions project/externals/ldap.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion project/externals/libcurl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion project/externals/libevent.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
5 changes: 3 additions & 2 deletions project/externals/proxygen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ 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
-DCMAKE_BUILD_TYPE=Release
-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
Expand Down
3 changes: 2 additions & 1 deletion project/externals/rocksdb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}
Expand Down
1 change: 0 additions & 1 deletion project/externals/wangle.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 <SOURCE_DIR>/wangle
Expand Down
12 changes: 12 additions & 0 deletions project/patches/cachelib-2022-12-26.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cstdint>
+
namespace facebook {
namespace cachelib {
template <typename EntityId>
17 changes: 14 additions & 3 deletions project/patches/duckdb-0.6.1.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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 <cstdint>
#include "thrift/Thrift.h"

namespace duckdb_apache {
10 changes: 10 additions & 0 deletions project/patches/fbthrift-2022-12-26.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 <thrift/compiler/generate/json.h>

+#include <cstdint>
#include <ostream>
#include <sstream>
13 changes: 13 additions & 0 deletions project/patches/folly-2022-12-26.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 <folly/system/AtFork.h>

+#include <stdexcept>
+#include <system_error>
+
#include <folly/ScopeGuard.h>
#include <folly/lang/Exception.h>
#include <folly/portability/PThread.h>
22 changes: 22 additions & 0 deletions project/patches/proxygen-2022-12-26.patch
Original file line number Diff line number Diff line change
@@ -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 <cstdint>
#include <string>
#include <vector>

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 <proxygen/lib/utils/ConsistentHash.h>
+#include <cstdint>
#include <string>
#include <vector>

33 changes: 33 additions & 0 deletions project/patches/rocksdb-7.8.3.patch
Original file line number Diff line number Diff line change
@@ -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 <cstdint>
#include <string>
#include <vector>

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 <cstdint>
#include <atomic>
#include <memory>
#include <mutex>
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 <cstdint>
#include <sstream>
#include <string>
#include <unordered_map>

0 comments on commit 950cd03

Please sign in to comment.