This is the mail archive of the 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] Remove extra bits/endian.h file for MIPS

Here is my proposed patch to remove the extra bits/endian.h file
for MIPS.  I removed the linux specific one and used the generic
one after fixing the comment.  My earlier patches already changed the #if's
to #ifdef's in that file.  This means that for linux we will now check
__MIPSEB/__MIPSEL instead of __MIPSEB__/__MIPSEL__ but that seem reasonable
since we are setting __BYTE_ORDER (with no trailing underscores).
Both versions of the MIPS macros are set by GCC.

I did not add any error checking to verify that one and only one 
of __MIPSEB/__MIPSEL are set.  The compiler will only set one of 
these and if the user does something weird with -D/-U flags then
I think they are on their own.  There are lots of places in
glibc where we assume the compiler defined macros are in a rational
state without explicitly checking them.

Tested with mips-mti-linux-gnu.  Ok for checkin?

Steve Ellcey

2015-02-18  Steve Ellcey  <>

	* sysdeps/unix/sysv/linux/mips/bits/endian.h: Remove.
	* sysdeps/mips/bits/endian.h: Fix comments.

diff --git a/sysdeps/mips/bits/endian.h b/sysdeps/mips/bits/endian.h
index 92e97c7..8699321 100644
--- a/sysdeps/mips/bits/endian.h
+++ b/sysdeps/mips/bits/endian.h
@@ -1,5 +1,7 @@
 /* The MIPS architecture has selectable endianness.
-   This file is for a machine using big-endian mode.  */
+   It exists in both little and big endian flavours and we
+   want to be able to share the installed headerfiles between both,
+   so we define __BYTE_ORDER based on GCC's predefines.  */
 #ifndef _ENDIAN_H
 # error "Never use <bits/endian.h> directly; include <endian.h> instead."

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