This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFA] Fix build issue for binutils on newer SunOS systems
- From: Alan Modra <amodra at gmail dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: 'binutils' <binutils at sourceware dot org>
- Date: Tue, 9 Feb 2016 15:40:45 +1030
- Subject: Re: [RFA] Fix build issue for binutils on newer SunOS systems
- Authentication-results: sourceware.org; auth=none
- References: <56b8f46a dot c308620a dot 256ad dot ffff83b4SMTPIN_ADDED_BROKEN at mx dot google dot com>
On Mon, Feb 08, 2016 at 09:02:19PM +0100, Pierre Muller wrote:
>
> 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.
I'm committing this simpler patch, which like yours undefines
AT_SUN_HWCAP. Nick had a different patch attached to the PR but it
didn't get committed, probably just an oversight, that only defined
AT_SUN_HWCAP if not already defined. There's really not much
difference in the two patches, just a matter of whose AT_SUN_HWCAP
value you trust the most.
I did consider adding the following, but decided it was not worth
worrying.
#if defined AT_SUN_HWCAP && AT_SUN_HWCAP != 2009
#error AT_SUN_HWCAP value changed?
#endif
Note that I haven't defined AT_SUN_CAP_HW1 because a) there are as yet
no uses of the macro in the binutils/gdb sources, and b) presumably
AT_SUN_CAP_HW2 ought to be defined at the same time.
PR 16583
* elf/common.h (AT_SUN_HWCAP): Undef before defining.
diff --git a/include/elf/common.h b/include/elf/common.h
index 767ad3e..087d876 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -1021,6 +1021,7 @@
#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. */
+#undef AT_SUN_HWCAP
#define AT_SUN_HWCAP 2009 /* Machine dependent hints about
processor capabilities. */
#define AT_SUN_IFLUSH 2010 /* Should flush icache? */
--
Alan Modra
Australia Development Lab, IBM