Skip to content

Commit

Permalink
Fix build for FreeBSD (#625)
Browse files Browse the repository at this point in the history
CDRIVER-4465

- Missing math library for trig functions
- Patch IntelDFP to correctly identify x86_64
  • Loading branch information
kkloberdanz authored Apr 28, 2023
1 parent ec15461 commit 5c53478
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmake/IntelDFP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set (INTEL_DFP_LIBRARY_URL_HASH
"SHA256=ac157e69c05556f3fa468ab34caeb1114a3b88ae18241bd41cc57b85a02dd314"
CACHE STRING "The hash of the archive that lives at INTEL_DFP_LIBRARY_URL (Spelled: <ALGO>=<digest>)")
option (INTEL_DFP_LIBRARY_PATCH_ENABLED
"Whether to apply the s390x compatibility patch to the Intel DFP library" ON)
"Whether to apply patches to the Intel DFP library" ON)

set (_hash_arg)
if (NOT INTEL_DFP_LIBRARY_URL_SHA256 STREQUAL "no-verify")
Expand Down Expand Up @@ -42,6 +42,7 @@ FetchContent_Declare (
-p 4 # Strip four path components
"${PROJECT_SOURCE_DIR}/etc/mongo-inteldfp-s390x.patch"
"${PROJECT_SOURCE_DIR}/etc/mongo-inteldfp-MONGOCRYPT-571.patch"
"${PROJECT_SOURCE_DIR}/etc/mongo-inteldfp-libmongocrypt-pr-625.patch"
--verbose
)

Expand Down
13 changes: 13 additions & 0 deletions etc/mongo-inteldfp-libmongocrypt-pr-625.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/architecture.h b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/architecture.h
index ef8a5b7..98d86c1 100644
--- a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/architecture.h
+++ b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/architecture.h
@@ -39,7 +39,7 @@
# define merced
#endif

-#if defined(ct) || defined(efi2)
+#if defined(ct) || defined(efi2) || defined(__x86_64__)
# undef _M_AMD64
# define _M_AMD64
#endif

0 comments on commit 5c53478

Please sign in to comment.