Skip to content

Commit 0aa0387

Browse files
author
Gonéri Le Bouder
committed
fix: kfreebsd build
GNU/kFreeBSD uses the GNU libc whereas Android uses its own libc. So OS_Linux is not reliable enough to identify a glibc. We use __GLIBC__ to know if we are on a glibc instead of OS_Linux. __GLIBC__ is defined by features.hi which is pulled by the glibc headers. That's the reason why we can't check __GLIBC__ at the begining of the file.
1 parent c8c19e4 commit 0aa0387

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

3rdparty/dyncall/configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ guess_os()
125125
CONFIG_OS="beos"
126126
elif [ "$OS" = "Minix" ]; then
127127
CONFIG_OS="minix"
128+
elif [ "$OS" = "GNU/kFreeBSD" ]; then
129+
CONFIG_OS="freebsd"
128130
fi
129131
info "guess operating system $CONFIG_OS"
130132
}

3rdparty/dyncall/dyncall/dyncall_macros.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
#define DC__OS_Linux
7272

7373
/* The most powerful open source Unix-like OS - FreeBSD. */
74-
#elif defined(__FreeBSD__)
74+
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
7575
#define DC__OS_FreeBSD
7676

7777
/* The most secure open source Unix-like OS - OpenBSD. */

3rdparty/dyncall/dynload/dynload_syms_elf.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@
2424
2525
*/
2626

27-
28-
#if defined(OS_Linux) && !defined(_GNU_SOURCE)
29-
#define _GNU_SOURCE
30-
#define __USE_GNU
31-
#endif
32-
3327
/*
3428
3529
dynamic symbol resolver for elf
@@ -48,6 +42,12 @@
4842
#else
4943
# include <elf.h>
5044
#endif
45+
46+
#if defined(__GLIBC__)
47+
#define _GNU_SOURCE
48+
#define __USE_GNU
49+
#endif /* defined(__GLIBC__) */
50+
5151
#include "dynload_alloc.h"
5252

5353
#include <assert.h>

0 commit comments

Comments
 (0)