chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
diff --git a/cpp/src/arrow/util/decimal.cc b/cpp/src/arrow/util/decimal.cc
|
||||
index c8457eae8..aa2b41cc9 100644
|
||||
--- a/cpp/src/arrow/util/decimal.cc
|
||||
+++ b/cpp/src/arrow/util/decimal.cc
|
||||
@@ -111,7 +111,11 @@ struct DecimalRealConversion : public BaseDecimalRealConversion {
|
||||
|
||||
// 2. Losslessly convert `real` to `mant * 2**k`
|
||||
int binary_exp = 0;
|
||||
+#ifdef __EMSCRIPTEN__
|
||||
+ const Real real_mant = std::frexpf(real, &binary_exp);
|
||||
+#else
|
||||
const Real real_mant = std::frexp(real, &binary_exp);
|
||||
+#endif
|
||||
// `real_mant` is within 0.5 and 1 and has M bits of precision.
|
||||
// Multiply it by 2^M to get an exact integer.
|
||||
const uint64_t mant = static_cast<uint64_t>(std::ldexp(real_mant, kMantissaBits));
|
||||
diff --git a/cpp/src/arrow/util/value_parsing.h b/cpp/src/arrow/util/value_parsing.h
|
||||
index 609906052..1e3dfae7c 100644
|
||||
--- a/cpp/src/arrow/util/value_parsing.h
|
||||
+++ b/cpp/src/arrow/util/value_parsing.h
|
||||
@@ -804,7 +804,7 @@ static inline bool ParseTimestampStrptime(const char* buf, size_t length,
|
||||
std::string clean_copy(buf, length);
|
||||
struct tm result;
|
||||
memset(&result, 0, sizeof(struct tm));
|
||||
-#ifdef _WIN32
|
||||
+#if defined(_WIN32) || defined(__EMSCRIPTEN__)
|
||||
char* ret = arrow_strptime(clean_copy.c_str(), format, &result);
|
||||
#else
|
||||
char* ret = strptime(clean_copy.c_str(), format, &result);
|
||||
diff --git a/cpp/src/arrow/vendored/xxhash/xxhash.h b/cpp/src/arrow/vendored/xxhash/xxhash.h
|
||||
index a18e8c762..235590b19 100644
|
||||
--- a/cpp/src/arrow/vendored/xxhash/xxhash.h
|
||||
+++ b/cpp/src/arrow/vendored/xxhash/xxhash.h
|
||||
@@ -169,6 +169,11 @@
|
||||
* xxHash prototypes and implementation
|
||||
*/
|
||||
|
||||
+
|
||||
+#ifdef __EMSCRIPTEN__
|
||||
+#include <emscripten.h>
|
||||
+#endif
|
||||
+
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -3422,6 +3427,7 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(XXH_NOESCAPE const XXH64_can
|
||||
# endif
|
||||
#endif
|
||||
|
||||
+
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
# if defined(__ARM_FEATURE_SVE)
|
||||
# include <arm_sve.h>
|
||||
@@ -0,0 +1,59 @@
|
||||
From f2b12a311d1a14ab5d9f67428201e1389748a9c1 Mon Sep 17 00:00:00 2001
|
||||
From: Tom Jakubowski <tom@prospective.dev>
|
||||
Date: Fri, 11 Oct 2024 12:23:29 -0700
|
||||
Subject: [PATCH] GH-44384: [C++] Use CMAKE_LIBTOOL on macOS
|
||||
|
||||
When a builder sets `CMAKE_LIBTOOL`, use that as the program to bundle
|
||||
dependencies. This matches the behavior of the Windows build.
|
||||
|
||||
Also make a nitpicky minor update to the error message when a non-Apple
|
||||
libtool is detected.
|
||||
---
|
||||
cpp/cmake_modules/BuildUtils.cmake | 30 +++++++++++++++++-------------
|
||||
1 file changed, 17 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake
|
||||
index 692efa78376f4..eb94563afcf77 100644
|
||||
--- a/cpp/cmake_modules/BuildUtils.cmake
|
||||
+++ b/cpp/cmake_modules/BuildUtils.cmake
|
||||
@@ -97,23 +97,27 @@ function(arrow_create_merged_static_lib output_target)
|
||||
endforeach()
|
||||
|
||||
if(APPLE)
|
||||
- # The apple-distributed libtool is what we want for bundling, but there is
|
||||
- # a GNU libtool that has a namecollision (and happens to be bundled with R, too).
|
||||
- # We are not compatible with GNU libtool, so we need to avoid it.
|
||||
-
|
||||
- # check in the obvious places first to find Apple's libtool
|
||||
- # HINTS is used before system paths and before PATHS, so we use that
|
||||
- # even though hard coded paths should go in PATHS
|
||||
- # TODO: use a VALIDATOR when we require cmake >= 3.25
|
||||
- find_program(LIBTOOL_MACOS libtool HINTS /usr/bin
|
||||
- /Library/Developer/CommandLineTools/usr/bin)
|
||||
-
|
||||
- # confirm that the libtool we found is not GNU libtool
|
||||
+ if(CMAKE_LIBTOOL)
|
||||
+ set(LIBTOOL_MACOS ${CMAKE_LIBTOOL})
|
||||
+ else()
|
||||
+ # The apple-distributed libtool is what we want for bundling, but there is
|
||||
+ # a GNU libtool that has a namecollision (and happens to be bundled with R, too).
|
||||
+ # We are not compatible with GNU libtool, so we need to avoid it.
|
||||
+
|
||||
+ # check in the obvious places first to find Apple's libtool
|
||||
+ # HINTS is used before system paths and before PATHS, so we use that
|
||||
+ # even though hard coded paths should go in PATHS
|
||||
+ # TODO: use a VALIDATOR when we require cmake >= 3.25
|
||||
+ find_program(LIBTOOL_MACOS libtool
|
||||
+ HINTS /usr/bin /Library/Developer/CommandLineTools/usr/bin)
|
||||
+ endif()
|
||||
+
|
||||
+ # confirm that the libtool we found is Apple's libtool
|
||||
execute_process(COMMAND ${LIBTOOL_MACOS} -V
|
||||
OUTPUT_VARIABLE LIBTOOL_V_OUTPUT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT "${LIBTOOL_V_OUTPUT}" MATCHES ".*cctools-([0-9.]+).*")
|
||||
- message(FATAL_ERROR "libtool found appears to be the incompatible GNU libtool: ${LIBTOOL_MACOS}"
|
||||
+ message(FATAL_ERROR "libtool found appears not to be Apple's libtool: ${LIBTOOL_MACOS}"
|
||||
)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user