This is the mail archive of the
mailing list for the glibc project.
[Patch] Remove extra bits/endian.h file for MIPS
- From: Steve Ellcey <sellcey at imgtec dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, "Maciej W. Rozycki" <macro at linux-mips dot org>
- Date: Wed, 18 Feb 2015 10:28:39 -0800
- Subject: [Patch] Remove extra bits/endian.h file for MIPS
- Authentication-results: sourceware.org; auth=none
- Reply-to: <sellcey at imgtec dot com>
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?
2015-02-18 Steve Ellcey <firstname.lastname@example.org>
* 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
@@ -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. */
# error "Never use <bits/endian.h> directly; include <endian.h> instead."