Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Makefile.inc1
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,14 @@ BFLAGS+= -B${WORLDTMP}/usr/bin
(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == clang)
XCFLAGS+= -target ${TARGET_TRIPLE}
.endif
# An external compiler (e.g. upstream clang on Linux/macOS) only knows the
# freebsd triple, so it predefines __FreeBSD__ but not __MidnightBSD__. The
# tree keys on __MidnightBSD__ everywhere, so supply it ourselves with the same
# value our own clang derives from the triple's OS major version.
.if defined(X_COMPILER_MIDNIGHTBSD_VERSION) && \
${X_COMPILER_MIDNIGHTBSD_VERSION} == "unknown"
XCFLAGS+= -D__MidnightBSD__=${TARGET_TRIPLE:C/.*freebsd([0-9]+).*/\1/}
.endif
XCFLAGS+= --sysroot=${WORLDTMP}

.if !empty(BFLAGS)
Expand Down
6 changes: 0 additions & 6 deletions sys/compat/linuxkpi/common/include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -593,12 +593,6 @@ mult_frac(uintmax_t x, uintmax_t multiplier, uintmax_t divisor)
return ((q * multiplier) + ((r * multiplier) / divisor));
}

static inline int64_t
abs64(int64_t x)
{
return (x < 0 ? -x : x);
}

typedef struct linux_ratelimit {
struct timeval lasttime;
int counter;
Expand Down
7 changes: 0 additions & 7 deletions sys/dev/drm2/drm_os_freebsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,6 @@ ilog2(unsigned long x)
return (flsl(x) - 1);
}

static inline int64_t
abs64(int64_t x)
{

return (x < 0 ? -x : x);
}

int64_t timeval_to_ns(const struct timeval *tv);
struct timeval ns_to_timeval(const int64_t nsec);

Expand Down
1 change: 1 addition & 0 deletions sys/sys/libkern.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ static __inline off_t omin(off_t a, off_t b) { return (a < b ? a : b); }
static __inline int abs(int a) { return (a < 0 ? -a : a); }
static __inline long labs(long a) { return (a < 0 ? -a : a); }
static __inline quad_t qabs(quad_t a) { return (a < 0 ? -a : a); }
static __inline int64_t abs64(int64_t a) { return (a < 0 ? -a : a); }

#ifndef RANDOM_FENESTRASX
#define ARC4_ENTR_NONE 0 /* Don't have entropy yet. */
Expand Down
Loading