Changeset View
Standalone View
contrib/elftoolchain/common/_elftc.h
Show First 20 Lines • Show All 374 Lines • ▼ Show 20 Lines | |||||
#include <libkern/OSByteOrder.h> | #include <libkern/OSByteOrder.h> | ||||
#define htobe32(x) OSSwapHostToBigInt32(x) | #define htobe32(x) OSSwapHostToBigInt32(x) | ||||
#define roundup2 roundup | #define roundup2 roundup | ||||
#define ELFTC_BYTE_ORDER _BYTE_ORDER | #define ELFTC_BYTE_ORDER _BYTE_ORDER | ||||
#define ELFTC_BYTE_ORDER_LITTLE_ENDIAN _LITTLE_ENDIAN | #define ELFTC_BYTE_ORDER_LITTLE_ENDIAN _LITTLE_ENDIAN | ||||
#define ELFTC_BYTE_ORDER_BIG_ENDIAN _BIG_ENDIAN | #define ELFTC_BYTE_ORDER_BIG_ENDIAN _BIG_ENDIAN | ||||
#define ELFTC_HAVE_CAPSICUM 0 | |||||
#define ELFTC_HAVE_MMAP 1 | #define ELFTC_HAVE_MMAP 1 | ||||
#define ELFTC_HAVE_STRMODE 1 | #define ELFTC_HAVE_STRMODE 1 | ||||
#define ELFTC_NEED_BYTEORDER_EXTENSIONS 1 | #define ELFTC_NEED_BYTEORDER_EXTENSIONS 1 | ||||
#endif /* __APPLE__ */ | #endif /* __APPLE__ */ | ||||
#if defined(__DragonFly__) | #if defined(__DragonFly__) | ||||
Show All 36 Lines | |||||
#include <osreldate.h> | #include <osreldate.h> | ||||
#include <sys/endian.h> | #include <sys/endian.h> | ||||
#define ELFTC_BYTE_ORDER _BYTE_ORDER | #define ELFTC_BYTE_ORDER _BYTE_ORDER | ||||
#define ELFTC_BYTE_ORDER_LITTLE_ENDIAN _LITTLE_ENDIAN | #define ELFTC_BYTE_ORDER_LITTLE_ENDIAN _LITTLE_ENDIAN | ||||
#define ELFTC_BYTE_ORDER_BIG_ENDIAN _BIG_ENDIAN | #define ELFTC_BYTE_ORDER_BIG_ENDIAN _BIG_ENDIAN | ||||
#define ELFTC_HAVE_CAPSICUM 1 | |||||
#define ELFTC_HAVE_MMAP 1 | #define ELFTC_HAVE_MMAP 1 | ||||
#define ELFTC_HAVE_STRMODE 1 | #define ELFTC_HAVE_STRMODE 1 | ||||
#if __FreeBSD_version <= 900000 | #if __FreeBSD_version <= 900000 | ||||
#define ELFTC_BROKEN_YY_NO_INPUT 1 | #define ELFTC_BROKEN_YY_NO_INPUT 1 | ||||
emaste: This part seems reasonable to me; in my earlier poking at capsicumizing ELF Tool Chain… | |||||
Not Done Inline ActionsYou still need the define. We support bootstrapping from 9.x and although sys/capsicum.h exists there, most of the interface that this change uses is not present there. So there *IS* a point to the extra cruft. imp: You still need the define. We support bootstrapping from 9.x and although sys/capsicum.h exists… | |||||
Not Done Inline ActionsNot talking about getting rid of this define, just not adding extra cruft to use capsicum on systems < 1001511. The extra cruft that does not have a point would be something like: #if __FreeBSD_version > 900000 #define ELFTC_HAVE_CAPSICUM 1 #if __FreeBSD_version > 1001510 #define HEADER_IS_CAPSICUM_H 1 #else #define HEADER_IS_CAPABILITY_H 1 #endif #endif Also, fully into bikeshed territory: >= 1001511 is probably more obvious. emaste: Not talking about getting rid of this define, just not adding extra cruft to use capsicum on… | |||||
Not Done Inline ActionsI think a better path forward is the libegacy one we talked about on IRC... But it all depends on what upstream wants to do since they have support for FreeBSD < 9 later in the file... imp: I think a better path forward is the libegacy one we talked about on IRC...
But it all depends… | |||||
Not Done Inline ActionsI want to keep this identical to upstream, and upstream must of course build without Capsicum for other operating systems; I'm happy with that applying to FreeBSD < 10.3 as well. emaste: I want to keep this identical to upstream, and upstream must of course build without Capsicum… | |||||
Not Done Inline ActionsThat is, the extra cruft that I think is not worthwhile is that cruft to handle the header being named sys/capability.h in 9.x and 10.x prior to 10.3, not sys/capsicum.h. emaste: That is, the extra cruft that I think is not worthwhile is that cruft to handle the header… | |||||
#endif | #endif | ||||
#endif /* __FreeBSD__ */ | #endif /* __FreeBSD__ */ | ||||
#if defined(__minix) | #if defined(__minix) | ||||
#define ELFTC_HAVE_MMAP 0 | #define ELFTC_HAVE_MMAP 0 | ||||
#endif /* __minix */ | #endif /* __minix */ | ||||
#if defined(__NetBSD__) | #if defined(__NetBSD__) | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/endian.h> | #include <sys/endian.h> | ||||
#define ELFTC_BYTE_ORDER _BYTE_ORDER | #define ELFTC_BYTE_ORDER _BYTE_ORDER | ||||
#define ELFTC_BYTE_ORDER_LITTLE_ENDIAN _LITTLE_ENDIAN | #define ELFTC_BYTE_ORDER_LITTLE_ENDIAN _LITTLE_ENDIAN | ||||
#define ELFTC_BYTE_ORDER_BIG_ENDIAN _BIG_ENDIAN | #define ELFTC_BYTE_ORDER_BIG_ENDIAN _BIG_ENDIAN | ||||
#define ELFTC_HAVE_CAPSICUM 0 | |||||
#define ELFTC_HAVE_MMAP 1 | #define ELFTC_HAVE_MMAP 1 | ||||
#define ELFTC_HAVE_STRMODE 1 | #define ELFTC_HAVE_STRMODE 1 | ||||
#if __NetBSD_Version__ <= 599002100 | #if __NetBSD_Version__ <= 599002100 | ||||
/* from src/doc/CHANGES: flex(1): Import flex-2.5.35 [christos 20091025] */ | /* from src/doc/CHANGES: flex(1): Import flex-2.5.35 [christos 20091025] */ | ||||
/* and 5.99.21 was from Wed Oct 21 21:28:36 2009 UTC */ | /* and 5.99.21 was from Wed Oct 21 21:28:36 2009 UTC */ | ||||
# define ELFTC_BROKEN_YY_NO_INPUT 1 | # define ELFTC_BROKEN_YY_NO_INPUT 1 | ||||
#endif | #endif | ||||
#endif /* __NetBSD __ */ | #endif /* __NetBSD __ */ | ||||
#if defined(__OpenBSD__) | #if defined(__OpenBSD__) | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/endian.h> | #include <sys/endian.h> | ||||
#define ELFTC_BYTE_ORDER _BYTE_ORDER | #define ELFTC_BYTE_ORDER _BYTE_ORDER | ||||
#define ELFTC_BYTE_ORDER_LITTLE_ENDIAN _LITTLE_ENDIAN | #define ELFTC_BYTE_ORDER_LITTLE_ENDIAN _LITTLE_ENDIAN | ||||
#define ELFTC_BYTE_ORDER_BIG_ENDIAN _BIG_ENDIAN | #define ELFTC_BYTE_ORDER_BIG_ENDIAN _BIG_ENDIAN | ||||
#define ELFTC_HAVE_CAPSICUM 0 | |||||
#define ELFTC_HAVE_MMAP 1 | #define ELFTC_HAVE_MMAP 1 | ||||
#define ELFTC_HAVE_STRMODE 1 | #define ELFTC_HAVE_STRMODE 1 | ||||
#define ELFTC_NEED_BYTEORDER_EXTENSIONS 1 | #define ELFTC_NEED_BYTEORDER_EXTENSIONS 1 | ||||
#define roundup2 roundup | #define roundup2 roundup | ||||
#endif /* __OpenBSD__ */ | #endif /* __OpenBSD__ */ | ||||
#endif /* _ELFTC_H */ | #endif /* _ELFTC_H */ |
This part seems reasonable to me; in my earlier poking at capsicumizing ELF Tool Chain components I had __FreeBSD_version blocks for both sys/capsicum.h and sys/capability.h but since stable/10 and 10.3 have capsicum.h there's not much point in the extra cruft.
I would probably put a comment though to give a hint as to why this is like this, along the lines of