Skip to content

Commit cafc1cf

Browse files
committed
[FreeBSD] fix building on FreeBSD
1 parent 1e3bf2d commit cafc1cf

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

Package.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.5
1+
// swift-tools-version:5.6
22

33
import Foundation
44
import PackageDescription
@@ -51,7 +51,9 @@ let package = Package(
5151

5252
.testTarget(
5353
name: "IndexStoreDBTests",
54-
dependencies: ["IndexStoreDB", "ISDBTestSupport"]),
54+
dependencies: ["IndexStoreDB", "ISDBTestSupport"],
55+
linkerSettings: [.linkedLibrary("execinfo", .when(platforms: [.custom("freebsd")]))]
56+
),
5557

5658
// MARK: Swift Test Infrastructure
5759

Sources/IndexStoreDB_LLVMSupport/include/IndexStoreDB_LLVMSupport/llvm_Config_config.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@
144144
#endif
145145

146146
/* Define to 1 if you have the `mallctl' function. */
147-
/* #undef HAVE_MALLCTL */
147+
#if defined(__FreeBSD__)
148+
#define HAVE_MALLCTL 1
149+
#endif
148150

149151
/* Define to 1 if you have the `mallinfo' function. */
150152
/* #undef HAVE_MALLINFO */
@@ -180,7 +182,11 @@
180182
#define HAVE_PTHREAD_RWLOCK_INIT 1
181183

182184
/* Define to 1 if you have the `sbrk' function. */
185+
#if defined(__FreeBSD__) && defined(__aarch64__)
186+
#undef HAVE_SBRK
187+
#else
183188
#define HAVE_SBRK 1
189+
#endif
184190

185191
/* Define to 1 if you have the `setenv' function. */
186192
#define HAVE_SETENV 1

Utilities/import-llvm.d/include/llvm/Config/config.h

+4
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,11 @@
180180
#define HAVE_PTHREAD_RWLOCK_INIT 1
181181

182182
/* Define to 1 if you have the `sbrk' function. */
183+
#if defined(__FreeBSD__) && defined(__aarch64__)
184+
#undef HAVE_SBRK
185+
#else
183186
#define HAVE_SBRK 1
187+
#endif
184188

185189
/* Define to 1 if you have the `setenv' function. */
186190
#define HAVE_SETENV 1

0 commit comments

Comments
 (0)