This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH COMMITTED] Fix sparc build with older compilers.


I did something I haven't done in a while, which is do a sparc
build with much older compiler tools.

It seems more recent gcc is willing to accept multiple instances of
the same identical typedef, whereas older ones do not.

The reason we include this header twice on sparc is due to how
we implement mempcpy, which is via a stub in the memcpy file.
Therefore, when we use completely generic versions for RTLD,
we include the generic implementations of memcpy and mempcpy
into the same foo.c file, thus resulting in an include of memcopy.h
twice.

Committed to master.

	* sysdeps/generic/memcopy.h: Add multiple inclusion protection.
---
 ChangeLog                 | 4 ++++
 sysdeps/generic/memcopy.h | 7 ++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index a8ae3df..5500787 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-12-04  David S. Miller  <davem@abraco.davemloft.net>
+
+	* sysdeps/generic/memcopy.h: Add multiple inclusion protection.
+
 2012-12-04  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/ieee754/ldbl-opt/Makefile [$(subdir) = math]
diff --git a/sysdeps/generic/memcopy.h b/sysdeps/generic/memcopy.h
index a8e5a44..631214b 100644
--- a/sysdeps/generic/memcopy.h
+++ b/sysdeps/generic/memcopy.h
@@ -1,5 +1,5 @@
 /* memcopy.h -- definitions for memory copy functions.  Generic C version.
-   Copyright (C) 1991, 1992, 1993, 1997, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1992, 1993, 1997, 2004, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Torbjorn Granlund (tege@sics.se).
 
@@ -17,6 +17,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifndef _MEMCOPY_H
+#define _MEMCOPY_H	1
+
 /* The strategy of the memory functions is:
 
      1. Copy bytes until the destination pointer is aligned.
@@ -144,3 +147,5 @@ extern void _wordcopy_bwd_dest_aligned (long int, long int, size_t) __THROW;
 
 /* Threshold value for when to enter the unrolled loops.  */
 #define	OP_T_THRES	16
+
+#endif /* memcopy.h */
-- 
1.7.11.7


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]