This is the mail archive of the
mailing list for the binutils project.
[RFA] Fix build issue for binutils on newer SunOS systems
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'binutils'" <binutils at sourceware dot org>
- Date: Mon, 8 Feb 2016 21:02:19 +0100
- Subject: [RFA] Fix build issue for binutils on newer SunOS systems
- Authentication-results: sourceware.org; auth=none
SUNOS has changed the macro AT_SUN_HWCAP from 2009 to AT_SUN_CAP_HW1.
This causes a warning, turned into an error by -Werror,
because of re-definition of this macro on a system that
has the new definition of this macro.
The patch below should avoid getting a warning, both for old and new macro
I needed this change to compile 2.26 release successfully, see:
this was probably due to the missing development mode reset, as stated here:
I tried to minimize the footprint of the change,
I hope this is the correct way to do it.
* include/elf/common.h (AT_SUN_HWCAP macro): Undefine if already
defined to avoid
macro redefinition warning.
--- binutils-2.26-ori/include/elf/common.h 2015-11-13
+++ binutils-2.26/include/elf/common.h 2016-02-08 10:10:34.210099916 +0100
@@ -1007,8 +1007,14 @@
#define AT_SUN_LDNAME 2006 /* String giving name of dynamic linker. */
#define AT_SUN_LPAGESZ 2007 /* Large pagesize. */
#define AT_SUN_PLATFORM 2008 /* Platform name string. */
-#define AT_SUN_HWCAP 2009 /* Machine dependent hints about
+#define AT_SUN_CAP_HW1 2009 /* Machine dependent hints about
processor capabilities. */
+#undef AT_SUN_HWCAP /* Avoid macro redefinition error for SUNOS
+#define AT_SUN_HWCAP AT_SUN_CAP_HW1 /* Deprecated, left for
backward compatibility. */
+/* These are only in kernel */
#define AT_SUN_IFLUSH 2010 /* Should flush icache? */
#define AT_SUN_CPU 2011 /* CPU name string. */
#define AT_SUN_EMUL_ENTRY 2012 /* COFF entry point address. */