[RFA] Fix build issue for binutils on newer SunOS systems
Pierre Muller
pierre.muller@ics-cnrs.unistra.fr
Mon Feb 8 20:02:00 GMT 2016
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
definition.
I needed this change to compile 2.26 release successfully, see:
https://sourceware.org/ml/binutils/2016-02/msg00013.html
this was probably due to the missing development mode reset, as stated here:
https://sourceware.org/ml/binutils/2016-01/msg00296.html
I tried to minimize the footprint of the change,
I hope this is the correct way to do it.
Pierre Muller
ChangeLog entry:
* 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
09:27:42.000000000 +0100
+++ 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. */
+#ifdef AT_SUN_HWCAP
+#undef AT_SUN_HWCAP /* Avoid macro redefinition error for SUNOS
host. */
+#endif
+#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. */
More information about the Binutils
mailing list