Skip to content

Commit 72b0343

Browse files
CodingCarpinchojakepetroules
authored andcommitted
[FreeBSD] Fix target conditionals for FreeBSD aarch64 builds
Despite being declared in the header unistd.h, the function sbrk is not available on FreeBSD when using the aarch64 architecture because FreeBSD make the decision to drop support for this deprecated function when porting the system to ARM. The configuration script incorrectly hard-codes the support for this function as being always available, which is not correct. We need to ensure that it is not used on FreeBSD aarch64.
1 parent 53db07c commit 72b0343

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/llvm/Config/config.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@
131131
/* #undef HAVE_LSEEK64 */
132132

133133
/* Define to 1 if you have the `mallctl' function. */
134+
#if defined(__FreeBSD__)
135+
#define HAVE_MALLCTL 1
136+
#else
134137
/* #undef HAVE_MALLCTL */
138+
#endif
135139

136140
/* Define to 1 if you have the `mallinfo' function. */
137141
/* #undef HAVE_MALLINFO */
@@ -204,7 +208,13 @@
204208
#define HAVE_REALPATH 1
205209

206210
/* Define to 1 if you have the `sbrk' function. */
211+
/* This is hard-coded to be not present on FreeBSD arm64, because
212+
that platform has dropped support for this function. */
213+
#if defined(__FreeBSD__) && defined(__aarch64__)
214+
#undef HAVE_SBRK
215+
#else
207216
#define HAVE_SBRK 1
217+
#endif
208218

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

0 commit comments

Comments
 (0)