Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/elftoolchain/dist/common Sync '_elftc.h' with t...



details:   https://anonhg.NetBSD.org/src/rev/8890df9bdefa
branches:  trunk
changeset: 957228:8890df9bdefa
user:      jkoshy <jkoshy%NetBSD.org@localhost>
date:      Sat Nov 21 21:04:25 2020 +0000

description:
Sync '_elftc.h' with the upstream elftoolchain project.

diffstat:

 external/bsd/elftoolchain/dist/common/_elftc.h |  135 +++++++++++-------------
 1 files changed, 63 insertions(+), 72 deletions(-)

diffs (233 lines):

diff -r 30d50dfb87ac -r 8890df9bdefa external/bsd/elftoolchain/dist/common/_elftc.h
--- a/external/bsd/elftoolchain/dist/common/_elftc.h    Sat Nov 21 21:01:16 2020 +0000
+++ b/external/bsd/elftoolchain/dist/common/_elftc.h    Sat Nov 21 21:04:25 2020 +0000
@@ -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 @@
 
 /*
  * 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__)
+#if defined(__DragonFly__) || defined(__NetBSD__)
+
 #define        ELFTC_VCSID(ID)         __RCSID(ID)
-#endif
+
+#elif defined(__FreeBSD__)
 
-#if defined(__FreeBSD__)
 #define        ELFTC_VCSID(ID)         __FBSDID(ID)
-#endif
 
-#if defined(__APPLE__) || defined(__GLIBC__) || defined(__GNU__) || \
-    defined(__linux__)
+#elif defined(__APPLE__) || defined(__OpenBSD__) || defined(__GLIBC__) || \
+    defined(__GNU__) || defined(__linux__) || defined(__minix)
+
 #if defined(__GNUC__)
 #define        ELFTC_VCSID(ID)         __asm__(".ident\t\"" ID "\"")
 #else
 #define        ELFTC_VCSID(ID)         /**/
 #endif
-#endif
 
-#if defined(__minix)
-#if defined(__GNUC__)
-#define        ELFTC_VCSID(ID)         __asm__(".ident\t\"" ID "\"")
-#else
-#define        ELFTC_VCSID(ID)         /**/
-#endif /* __GNU__ */
-#endif
-
-#if defined(__NetBSD__)
-#define        ELFTC_VCSID(ID)         __RCSID(ID)
-#endif
-
-#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 @@
 
 #define        ELFTC_GETPROGNAME()     getprogname()
 
-#endif /* __DragonFly__ || __FreeBSD__ || __minix || __NetBSD__ */
+#endif /* __APPLE__ || __DragonFly__ || __FreeBSD__ || __minix || __NetBSD__ */
 
 
 #if defined(__GLIBC__) || defined(__linux__)
@@ -372,12 +357,41 @@
 #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 @@
 #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 @@
 
 #define        ELFTC_HAVE_MMAP                         1
 
-#endif
-
-#if defined(__GLIBC__) || defined(__linux__)
+#elif defined(__GLIBC__) || defined(__linux__)
 
 #include <endian.h>
 
@@ -427,10 +437,7 @@
 
 #define        roundup2        roundup
 
-#endif /* __GLIBC__ || __linux__ */
-
-
-#if defined(__FreeBSD__)
+#elif defined(__FreeBSD__)
 
 #include <osreldate.h>
 #include <sys/endian.h>
@@ -444,15 +451,11 @@
 #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 @@
 
 #define        ELFTC_HAVE_MMAP                         1
 #define        ELFTC_HAVE_STRMODE                      1
-
-#endif /* __NetBSD __ */
+#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
 
-
-#if defined(__OpenBSD__)
+#elif defined(__OpenBSD__)
 
 #include <sys/param.h>
 #include <sys/endian.h>
@@ -484,18 +489,4 @@
 
 #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 */



Home | Main Index | Thread Index | Old Index