Skip to content

Commit d8fb8d4

Browse files
committed
Binary (FreeBSD): use system libelf
There are pkg elfutils. However it is not ABI compatible with system libelf
1 parent de59ffb commit d8fb8d4

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ cmake_dependent_option(ENABLE_FREETYPE "Enable freetype" ON "ANDROID" OFF)
6969
cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX OR SunOS" OFF)
7070
cmake_dependent_option(ENABLE_DDCUTIL "Enable ddcutil" ON "LINUX" OFF)
7171
cmake_dependent_option(ENABLE_DIRECTX_HEADERS "Enable DirectX headers for WSL" ON "LINUX" OFF)
72-
cmake_dependent_option(ENABLE_ELF "Enable libelf" ON "LINUX OR FreeBSD OR ANDROID" OFF)
72+
cmake_dependent_option(ENABLE_ELF "Enable libelf" ON "LINUX OR ANDROID" OFF)
7373
cmake_dependent_option(ENABLE_THREADS "Enable multithreading" ON "Threads_FOUND" OFF)
7474
cmake_dependent_option(ENABLE_LIBZFS "Enable libzfs" ON "LINUX OR FreeBSD OR SunOS" OFF)
7575

src/common/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ void ffListFeatures(void)
242242
#if FF_HAVE_DDCUTIL
243243
"libddcutil\n"
244244
#endif
245-
#if FF_HAVE_ELF
245+
#if FF_HAVE_ELF || __sun || __FreeBSD__
246246
"libelf\n"
247247
#endif
248248
#if FF_HAVE_LIBZFS

src/util/binary_linux.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#include "binary.h"
22

3-
#if defined(FF_HAVE_ELF) || defined(__sun)
3+
#if defined(FF_HAVE_ELF) || defined(__sun) || defined(__FreeBSD__)
44

55
#include "common/io/io.h"
66
#include "common/library.h"
77
#include "util/stringUtils.h"
88

9+
// WARNING: On FreeBSD, there are system `/usr/include/libelf.h` and pkg elfutils `/usr/local/include/libelf.h`; they are not compatible.
910
#include <libelf.h>
1011
#include <fcntl.h>
1112

0 commit comments

Comments
 (0)