Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ set(VELOX_SOURCE_URL
FetchContent_Declare(
velox
URL ${VELOX_SOURCE_URL}
URL_HASH MD5=${VELOX_SOURCE_URL_MD5})
URL_HASH MD5=${VELOX_SOURCE_URL_MD5}
PATCH_COMMAND ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> patch -p1 -i
"${VELOX_PATCH_DIR}/iconfig-gcc-bug-103186.patch")
FetchContent_MakeAvailable(velox)

# Import JniHelpers.
Expand Down
38 changes: 38 additions & 0 deletions src/main/cpp/cmake/patches/velox/iconfig-gcc-bug-103186.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
--- a/velox/common/config/IConfig.h
+++ b/velox/common/config/IConfig.h
@@ -35,9 +35,7 @@
std::optional<T> get(
const std::string& key,
const std::function<T(std::string, std::string)>& toT =
- [](auto /* unused */, auto value) {
- return folly::to<T>(value);
- }) const {
+ defaultToT<T>) const {
if (auto val = access(key)) {
return toT(key, *val);
}
@@ -49,9 +47,7 @@
const std::string& key,
const T& defaultValue,
const std::function<T(std::string, std::string)>& toT =
- [](auto /* unused */, auto value) {
- return folly::to<T>(value);
- }) const {
+ defaultToT<T>) const {
if (auto val = access(key)) {
return toT(key, *val);
}
@@ -65,6 +61,13 @@

private:
virtual std::optional<std::string> access(const std::string& key) const = 0;
+ // Do not inline this member function as lambda. Otherwise, a GCC bug
+ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103186 might be triggered
+ // with GCC 11.1 and 11.2.
+ template <typename T>
+ static T defaultToT(std::string /* unused */, std::string value) {
+ return folly::to<T>(value);
+ }
};

} // namespace facebook::velox::config
2 changes: 1 addition & 1 deletion src/main/cpp/velox-ref-md5.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
db3b302b3e465f7c8bdf2b1fd89e081b
ec8bf87e9bea7d28c0be20d758e4cd08
2 changes: 1 addition & 1 deletion src/main/cpp/velox-ref.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
62a76362bcfc296a7c35506ad72b1d625c68f682
45a03a6a0009c5343ad3421fb9f0c7275e9c8ec6
Loading