Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149005584
D25979.id75573.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D25979.id75573.diff
View Options
Index: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
===================================================================
--- head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
+++ head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
@@ -27,6 +27,7 @@
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/types.h>
+#include <sys/endian.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/zmod.h>
Index: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h
===================================================================
--- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h
+++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h
@@ -38,6 +38,7 @@
#include <pthread.h>
#include <sys/ccompile.h>
+#include <sys/endian.h>
#ifdef __cplusplus
extern "C" {
@@ -63,6 +64,15 @@
#ifndef MIN
#define MIN(a, b) ((a) > (b) ? (b) : (a))
+#endif
+
+/* Sanity check for cross-build bootstrap tools */
+#if !defined(BYTE_ORDER)
+#error "Missing BYTE_ORDER defines"
+#elif !defined(_LITTLE_ENDIAN)
+#error "Missing _LITTLE_ENDIAN defines"
+#elif !defined(_BIG_ENDIAN)
+#error "Missing _BIG_ENDIAN defines"
#endif
#define TRUE 1
Index: head/sys/cddl/compat/opensolaris/sys/stat.h
===================================================================
--- head/sys/cddl/compat/opensolaris/sys/stat.h
+++ head/sys/cddl/compat/opensolaris/sys/stat.h
@@ -32,11 +32,19 @@
#include_next <sys/stat.h>
+/*
+ * When bootstrapping on Linux a stat64/fstat64 functions exists in both
+ * glibc and musl libc. To avoid compilation errors, use those functions instead
+ * of redefining them to stat/fstat.
+ * Similarly, macOS provides (deprecated) stat64 functions that we can use
+ * for now.
+ */
+#if !defined(__linux__) && !defined(__APPLE__)
#define stat64 stat
#define MAXOFFSET_T OFF_MAX
-#ifndef _KERNEL
+#if !defined(_KERNEL)
#include <sys/disk.h>
static __inline int
@@ -51,6 +59,7 @@
}
return (ret);
}
-#endif
+#endif /* !defined(_KERNEL) */
+#endif /* !defined(__linux__) && !defined(__APPLE__) */
#endif /* !_COMPAT_OPENSOLARIS_SYS_STAT_H_ */
Index: head/sys/cddl/compat/opensolaris/sys/time.h
===================================================================
--- head/sys/cddl/compat/opensolaris/sys/time.h
+++ head/sys/cddl/compat/opensolaris/sys/time.h
@@ -29,6 +29,7 @@
#ifndef _OPENSOLARIS_SYS_TIME_H_
#define _OPENSOLARIS_SYS_TIME_H_
+#include <sys/types.h>
#include_next <sys/time.h>
#define SEC 1
Index: head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h
===================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h
@@ -46,8 +46,12 @@
/*
* Disk blocks (sectors) and bytes.
*/
+#ifndef dtob
#define dtob(DD) ((DD) << DEV_BSHIFT)
+#endif
+#ifndef btod
#define btod(BB) (((BB) + DEV_BSIZE - 1) >> DEV_BSHIFT)
+#endif
#define btodt(BB) ((BB) >> DEV_BSHIFT)
#define lbtod(BB) (((offset_t)(BB) + DEV_BSIZE - 1) >> DEV_BSHIFT)
@@ -220,9 +224,12 @@
/*
* Macros for counting and rounding.
*/
+#ifndef howmany
#define howmany(x, y) (((x)+((y)-1))/(y))
+#endif
+#ifndef roundup
#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
-
+#endif
/*
* Macro to determine if value is a power of 2
*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 22, 5:16 PM (6 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30129305
Default Alt Text
D25979.id75573.diff (3 KB)
Attached To
Mode
D25979: Fix cddl tools bootstrapping on macOS and Linux
Attached
Detach File
Event Timeline
Log In to Comment