Module Name:    src
Committed By:   jkoshy
Date:           Sat Nov 21 21:04:25 UTC 2020

Modified Files:
        src/external/bsd/elftoolchain/dist/common: _elftc.h

Log Message:
Sync '_elftc.h' with the upstream elftoolchain project.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/elftoolchain/dist/common/_elftc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/elftoolchain/dist/common/_elftc.h
diff -u src/external/bsd/elftoolchain/dist/common/_elftc.h:1.5 src/external/bsd/elftoolchain/dist/common/_elftc.h:1.6
--- src/external/bsd/elftoolchain/dist/common/_elftc.h:1.5	Sun Mar 13 03:47:41 2016
+++ src/external/bsd/elftoolchain/dist/common/_elftc.h	Sat Nov 21 21:04:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: _elftc.h,v 1.5 2016/03/13 03:47:41 christos Exp $	*/
+/*	$NetBSD: _elftc.h,v 1.6 2020/11/21 21:04:25 jkoshy Exp $	*/
 
 /*-
  * Copyright (c) 2009 Joseph Koshy
@@ -25,11 +25,11 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Id: _elftc.h 3244 2015-08-31 19:53:08Z emaste 
+ * $Id: _elftc.h,v 1.6 2020/11/21 21:04:25 jkoshy Exp $
  */
 
 /**
- ** Miscellanous definitions needed by multiple components.
+ ** Miscellaneous definitions needed by multiple components.
  **/
 
 #ifndef	_ELFTC_H
@@ -284,49 +284,34 @@ struct name {							\
 
 /*
  * VCS Ids.
+ *
+ * The marker below is intended to be replaced with a project-specific
+ * definition of the ELFTC_VCSID macro.
  */
 
+#ifndef ELFTC_VCSID
+#define	ELFTC_VCSID(ID)		/**/
+#endif
+
 #ifndef	ELFTC_VCSID
 
-#if defined(__DragonFly__)
-#define	ELFTC_VCSID(ID)		__RCSID(ID)
-#endif
+#if defined(__DragonFly__) || defined(__NetBSD__)
 
-#if defined(__FreeBSD__)
-#define	ELFTC_VCSID(ID)		__FBSDID(ID)
-#endif
+#define	ELFTC_VCSID(ID)		__RCSID(ID)
 
-#if defined(__APPLE__) || defined(__GLIBC__) || defined(__GNU__) || \
-    defined(__linux__)
-#if defined(__GNUC__)
-#define	ELFTC_VCSID(ID)		__asm__(".ident\t\"" ID "\"")
-#else
-#define	ELFTC_VCSID(ID)		/**/
-#endif
-#endif
+#elif defined(__FreeBSD__)
 
-#if defined(__minix)
-#if defined(__GNUC__)
-#define	ELFTC_VCSID(ID)		__asm__(".ident\t\"" ID "\"")
-#else
-#define	ELFTC_VCSID(ID)		/**/
-#endif	/* __GNU__ */
-#endif
+#define	ELFTC_VCSID(ID)		__FBSDID(ID)
 
-#if defined(__NetBSD__)
-#define	ELFTC_VCSID(ID)		__RCSID(ID)
-#endif
+#elif defined(__APPLE__) || defined(__OpenBSD__) || defined(__GLIBC__) || \
+    defined(__GNU__) || defined(__linux__) || defined(__minix)
 
-#if defined(__OpenBSD__)
 #if defined(__GNUC__)
 #define	ELFTC_VCSID(ID)		__asm__(".ident\t\"" ID "\"")
 #else
 #define	ELFTC_VCSID(ID)		/**/
-#endif	/* __GNUC__ */
 #endif
 
-#ifndef ELFTC_VCSID
-#define	ELFTC_VCSID(ID)		/**/
 #endif
 
 #endif	/* ELFTC_VCSID */
@@ -344,7 +329,7 @@ struct name {							\
 
 #define	ELFTC_GETPROGNAME()	getprogname()
 
-#endif	/* __DragonFly__ || __FreeBSD__ || __minix || __NetBSD__ */
+#endif	/* __APPLE__ || __DragonFly__ || __FreeBSD__ || __minix || __NetBSD__ */
 
 
 #if defined(__GLIBC__) || defined(__linux__)
@@ -372,12 +357,41 @@ extern const char *__progname;
 #endif	/* ELFTC_GETPROGNAME */
 
 
-#ifndef HAVE_NBTOOL_CONFIG_H
-/**
- ** Per-OS configuration.
- **/
+/*
+ * Per-OS configuration.
+ *
+ * The following symbols are supported by this configuration fragment,
+ * although not all the OSes so referenced are fully supported.
+ *
+ * Cross-compilation:
+ *
+ * HAVE_NBTOOL_CONFIG_H : cross-compiling NetBSD tools on various OSes.
+ *
+ * Native compilation:
+ *
+ * __APPLE__     : compiling under Mac OS X.
+ * __DragonFly__ : compiling under DragonFlyBSD.
+ * __GLIBC__     : compiling under GNU based systems, such as GNU/kFreeBSD.
+ * __linux__     : compiling under GNU/Linux systems.
+ * __FreeBSD__   : compiling under FreeBSD.
+ * __minix       : compiling under Minix3.
+ * __NetBSD__    : compiling (native) under NetBSD.
+ * __OpenBSD__   : compiling under OpenBSD.
+ */
 
-#if defined(__APPLE__)
+#if defined(HAVE_NBTOOL_CONFIG_H)
+
+#include <sys/param.h>
+#include <sys/endian.h>
+
+#define	ELFTC_BYTE_ORDER			_BYTE_ORDER
+#define	ELFTC_BYTE_ORDER_LITTLE_ENDIAN		_LITTLE_ENDIAN
+#define	ELFTC_BYTE_ORDER_BIG_ENDIAN		_BIG_ENDIAN
+
+#define	ELFTC_HAVE_MMAP				1
+#define	ELFTC_HAVE_STRMODE			1
+
+#elif defined(__APPLE__)
 
 #include <libkern/OSByteOrder.h>
 #define	htobe32(x)	OSSwapHostToBigInt32(x)
@@ -391,10 +405,8 @@ extern const char *__progname;
 #define	ELFTC_HAVE_STRMODE			1
 
 #define ELFTC_NEED_BYTEORDER_EXTENSIONS		1
-#endif /* __APPLE__ */
-
 
-#if defined(__DragonFly__)
+#elif defined(__DragonFly__)
 
 #include <osreldate.h>
 #include <sys/endian.h>
@@ -405,9 +417,7 @@ extern const char *__progname;
 
 #define	ELFTC_HAVE_MMAP				1
 
-#endif
-
-#if defined(__GLIBC__) || defined(__linux__)
+#elif defined(__GLIBC__) || defined(__linux__)
 
 #include <endian.h>
 
@@ -427,10 +437,7 @@ extern const char *__progname;
 
 #define	roundup2	roundup
 
-#endif	/* __GLIBC__ || __linux__ */
-
-
-#if defined(__FreeBSD__)
+#elif defined(__FreeBSD__)
 
 #include <osreldate.h>
 #include <sys/endian.h>
@@ -444,15 +451,11 @@ extern const char *__progname;
 #if __FreeBSD_version <= 900000
 #define	ELFTC_BROKEN_YY_NO_INPUT		1
 #endif
-#endif	/* __FreeBSD__ */
 
-
-#if defined(__minix)
+#elif defined(__minix)
 #define	ELFTC_HAVE_MMAP				0
-#endif	/* __minix */
-
 
-#if defined(__NetBSD__)
+#elif defined(__NetBSD__)
 
 #include <sys/param.h>
 #include <sys/endian.h>
@@ -463,11 +466,13 @@ extern const char *__progname;
 
 #define	ELFTC_HAVE_MMAP				1
 #define	ELFTC_HAVE_STRMODE			1
+#if __NetBSD_Version__ <= 599002100
+/* 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 */
+#  define ELFTC_BROKEN_YY_NO_INPUT		1
+#endif
 
-#endif	/* __NetBSD __ */
-
-
-#if defined(__OpenBSD__)
+#elif defined(__OpenBSD__)
 
 #include <sys/param.h>
 #include <sys/endian.h>
@@ -484,18 +489,4 @@ extern const char *__progname;
 
 #endif	/* __OpenBSD__ */
 
-#else /* Crosscompiling for NetBSD tools */
-
-#include <sys/param.h>
-#include <sys/endian.h>
-
-#define	ELFTC_BYTE_ORDER			_BYTE_ORDER
-#define	ELFTC_BYTE_ORDER_LITTLE_ENDIAN		_LITTLE_ENDIAN
-#define	ELFTC_BYTE_ORDER_BIG_ENDIAN		_BIG_ENDIAN
-
-#define	ELFTC_HAVE_MMAP				1
-#define	ELFTC_HAVE_STRMODE			1
-
-#endif /* NBTOOL_CONFIG_H */
-
 #endif	/* _ELFTC_H */

Reply via email to