Index: uspace/lib/libc/Makefile
===================================================================
--- uspace/lib/libc/Makefile	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ uspace/lib/libc/Makefile	(revision af65b727b2d309464d7cc25a7ce3ad5dc5afbdbc)
@@ -32,4 +32,5 @@
 LIBC_PREFIX = $(shell pwd)
 SOFTINT_PREFIX = ../softint
+
 
 ## Setup toolchain
Index: uspace/lib/libc/Makefile.toolchain
===================================================================
--- uspace/lib/libc/Makefile.toolchain	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ uspace/lib/libc/Makefile.toolchain	(revision af65b727b2d309464d7cc25a7ce3ad5dc5afbdbc)
@@ -28,7 +28,8 @@
 
 CFLAGS = -I$(LIBC_PREFIX)/include -O3 -imacros $(LIBC_PREFIX)/../../../config.h \
-	-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32 -finput-charset=UTF-8 \
-	-fno-builtin -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
-	-Werror-implicit-function-declaration -nostdlib -nostdinc -pipe -g
+	-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
+	-finput-charset=UTF-8 -fno-builtin -Wall -Wextra -Wno-unused-parameter \
+	-Wmissing-prototypes -Werror-implicit-function-declaration -nostdlib \
+	-nostdinc -pipe -g -D__$(ENDIANESS)__
 LFLAGS = -M -N $(SOFTINT_PREFIX)/libsoftint.a
 AFLAGS =
Index: uspace/lib/libc/arch/amd64/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/amd64/Makefile.inc	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ uspace/lib/libc/arch/amd64/Makefile.inc	(revision af65b727b2d309464d7cc25a7ce3ad5dc5afbdbc)
@@ -39,4 +39,6 @@
 LFLAGS += -N
 
+ENDIANESS = LE
+
 BFD_NAME = elf64-x86-64
 BFD_ARCH = i386:x86-64
Index: uspace/lib/libc/arch/amd64/include/byteorder.h
===================================================================
--- uspace/lib/libc/arch/amd64/include/byteorder.h	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2005 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcamd64
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_amd64_BYTEORDER_H_
-#define LIBC_amd64_BYTEORDER_H_
-
-/* AMD64 is little-endian */
-#define ARCH_IS_LITTLE_ENDIAN
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/arm32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/arm32/Makefile.inc	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ uspace/lib/libc/arch/arm32/Makefile.inc	(revision af65b727b2d309464d7cc25a7ce3ad5dc5afbdbc)
@@ -33,7 +33,4 @@
 TARGET = arm-linux-gnu
 TOOLCHAIN_DIR = $(CROSS_PREFIX)/arm/bin
-CFLAGS += -ffixed-r9 -mtp=soft 
-LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a
-AFLAGS +=
 
 ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
@@ -42,4 +39,9 @@
 	arch/$(UARCH)/src/eabi.S
 
+CFLAGS += -ffixed-r9 -mtp=soft
+LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a
+
+ENDIANESS = LE
+
 BFD_NAME = elf32-littlearm
 BFD_ARCH = arm
Index: uspace/lib/libc/arch/arm32/include/byteorder.h
===================================================================
--- uspace/lib/libc/arch/arm32/include/byteorder.h	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2005 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcarm32
- * @{
- */
-/** @file
- *  @brief Endianness definitions.
- */
-
-#ifndef LIBC_arm32_BYTEORDER_H_
-#define LIBC_arm32_BYTEORDER_H_
-
-#define ARCH_IS_LITTLE_ENDIAN
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/ia32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/ia32/Makefile.inc	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ uspace/lib/libc/arch/ia32/Makefile.inc	(revision af65b727b2d309464d7cc25a7ce3ad5dc5afbdbc)
@@ -40,4 +40,6 @@
 LFLAGS += -N
 
+ENDIANESS = LE
+
 BFD_NAME = elf32-i386
 BFD_ARCH = i386
Index: uspace/lib/libc/arch/ia32/include/byteorder.h
===================================================================
--- uspace/lib/libc/arch/ia32/include/byteorder.h	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2005 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcia32	
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_ia32_BYTEORDER_H_
-#define LIBC_ia32_BYTEORDER_H_
-
-/* IA-32 is little-endian */
-#define ARCH_IS_LITTLE_ENDIAN
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/ia64/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/ia64/Makefile.inc	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ uspace/lib/libc/arch/ia64/Makefile.inc	(revision af65b727b2d309464d7cc25a7ce3ad5dc5afbdbc)
@@ -32,7 +32,4 @@
 TARGET = ia64-pc-linux-gnu
 TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia64/bin
-CFLAGS += -fno-unwind-tables -DMALLOC_ALIGNMENT_16
-LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a
-AFLAGS += 
 
 ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \
@@ -41,4 +38,9 @@
 	arch/$(UARCH)/src/ddi.c
 
+CFLAGS += -fno-unwind-tables -DMALLOC_ALIGNMENT_16
+LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a
+
+ENDIANESS = LE
+
 BFD_NAME = elf64-ia64-little
 BFD_ARCH = ia64-elf64
Index: uspace/lib/libc/arch/ia64/include/byteorder.h
===================================================================
--- uspace/lib/libc/arch/ia64/include/byteorder.h	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2005 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcia64
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_ia64_BYTEORDER_H_
-#define LIBC_ia64_BYTEORDER_H_
-
-/* IA-64 is little-endian */
-#define ARCH_IS_LITTLE_ENDIAN
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/mips32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/mips32/Makefile.inc	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ uspace/lib/libc/arch/mips32/Makefile.inc	(revision af65b727b2d309464d7cc25a7ce3ad5dc5afbdbc)
@@ -32,5 +32,4 @@
 TARGET = mipsel-linux-gnu
 TOOLCHAIN_DIR = $(CROSS_PREFIX)/mipsel/bin
-CFLAGS += -mips3
 
 ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
@@ -38,4 +37,8 @@
 	arch/$(UARCH)/src/tls.c
 
+CFLAGS += -mips3
+
+ENDIANESS = LE
+
 BFD_ARCH = mips
 BFD_NAME = elf32-tradlittlemips
Index: uspace/lib/libc/arch/mips32/include/byteorder.h
===================================================================
--- uspace/lib/libc/arch/mips32/include/byteorder.h	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/*
- * Copyright (c) 2005 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcmips32
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_mips32_BYTEORDER_H_
-#define LIBC_mips32_BYTEORDER_H_
-
-#define ARCH_IS_LITTLE_ENDIAN
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/mips32eb/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/mips32eb/Makefile.inc	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ uspace/lib/libc/arch/mips32eb/Makefile.inc	(revision af65b727b2d309464d7cc25a7ce3ad5dc5afbdbc)
@@ -32,5 +32,4 @@
 TARGET = mips-linux-gnu
 TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips/bin
-CFLAGS += -mips3
 
 ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
@@ -38,5 +37,8 @@
 		arch/$(UARCH)/src/tls.c
 
+CFLAGS += -mips3
 LFLAGS += -N
+
+ENDIANESS = BE
 
 BFD_ARCH = mips
Index: uspace/lib/libc/arch/mips32eb/include/byteorder.h
===================================================================
--- uspace/lib/libc/arch/mips32eb/include/byteorder.h	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/*
- * Copyright (c) 2005 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcmips32
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_mips32eb_BYTEORDER_H_
-#define LIBC_mips32eb_BYTEORDER_H_
-
-#define ARCH_IS_BIG_ENDIAN
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/ppc32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/ppc32/Makefile.inc	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ uspace/lib/libc/arch/ppc32/Makefile.inc	(revision af65b727b2d309464d7cc25a7ce3ad5dc5afbdbc)
@@ -41,4 +41,6 @@
 LFLAGS += -N
 
+ENDIANESS = BE
+
 BFD_NAME = elf32-powerpc
 BFD_ARCH = powerpc:common
Index: uspace/lib/libc/arch/ppc32/include/byteorder.h
===================================================================
--- uspace/lib/libc/arch/ppc32/include/byteorder.h	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/*
- * Copyright (c) 2005 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcppc32
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_ppc32_BYTEORDER_H_
-#define LIBC_ppc32_BYTEORDER_H_
-
-#define ARCH_IS_BIG_ENDIAN
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/sparc64/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/sparc64/Makefile.inc	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ uspace/lib/libc/arch/sparc64/Makefile.inc	(revision af65b727b2d309464d7cc25a7ce3ad5dc5afbdbc)
@@ -39,4 +39,6 @@
 LFLAGS += -no-check-sections -N
 
+ENDIANESS = BE
+
 BFD_NAME = elf64-sparc
 BFD_ARCH = sparc
Index: uspace/lib/libc/arch/sparc64/include/byteorder.h
===================================================================
--- uspace/lib/libc/arch/sparc64/include/byteorder.h	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/*
- * Copyright (c) 2005 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcsparc64
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_sparc64_BYTEORDER_H_
-#define LIBC_sparc64_BYTEORDER_H_
-
-#define ARCH_IS_BIG_ENDIAN
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/generic/io/printf_core.c
===================================================================
--- uspace/lib/libc/generic/io/printf_core.c	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ uspace/lib/libc/generic/io/printf_core.c	(revision af65b727b2d309464d7cc25a7ce3ad5dc5afbdbc)
@@ -301,7 +301,4 @@
 	if (str == NULL)
 		return printf_putstr(nullstr, ps);
-	
-	if (*str == U_BOM)
-		str++;
 	
 	/* Print leading spaces. */
Index: uspace/lib/libc/include/byteorder.h
===================================================================
--- uspace/lib/libc/include/byteorder.h	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ uspace/lib/libc/include/byteorder.h	(revision af65b727b2d309464d7cc25a7ce3ad5dc5afbdbc)
@@ -36,46 +36,45 @@
 #define LIBC_BYTEORDER_H_
 
-#include <libarch/byteorder.h>
 #include <stdint.h>
 
-#if !(defined(ARCH_IS_BIG_ENDIAN) ^ defined(ARCH_IS_LITTLE_ENDIAN))
-#error The architecture must be either big-endian or little-endian.
+#if !(defined(__BE__) ^ defined(__LE__))
+	#error The architecture must be either big-endian or little-endian.
 #endif
 
-#ifdef ARCH_IS_BIG_ENDIAN
+#ifdef __BE__
 
-#define uint16_t_le2host(n)		uint16_t_byteorder_swap(n)
-#define uint32_t_le2host(n)		uint32_t_byteorder_swap(n)
-#define uint64_t_le2host(n)		uint64_t_byteorder_swap(n)
+#define uint16_t_le2host(n)  (uint16_t_byteorder_swap(n))
+#define uint32_t_le2host(n)  (uint32_t_byteorder_swap(n))
+#define uint64_t_le2host(n)  (uint64_t_byteorder_swap(n))
 
-#define uint16_t_be2host(n)		(n)
-#define uint32_t_be2host(n)		(n)
-#define uint64_t_be2host(n)		(n)
+#define uint16_t_be2host(n)  (n)
+#define uint32_t_be2host(n)  (n)
+#define uint64_t_be2host(n)  (n)
 
-#define host2uint16_t_le(n)		uint16_t_byteorder_swap(n)
-#define host2uint32_t_le(n)		uint32_t_byteorder_swap(n)
-#define host2uint64_t_le(n)		uint64_t_byteorder_swap(n)
+#define host2uint16_t_le(n)  (uint16_t_byteorder_swap(n))
+#define host2uint32_t_le(n)  (uint32_t_byteorder_swap(n))
+#define host2uint64_t_le(n)  (uint64_t_byteorder_swap(n))
 
-#define host2uint16_t_be(n)		(n)
-#define host2uint32_t_be(n)		(n)
-#define host2uint64_t_be(n)		(n)
+#define host2uint16_t_be(n)  (n)
+#define host2uint32_t_be(n)  (n)
+#define host2uint64_t_be(n)  (n)
 
 #else
 
-#define uint16_t_le2host(n)		(n)
-#define uint32_t_le2host(n)		(n)
-#define uint64_t_le2host(n)		(n)
+#define uint16_t_le2host(n)  (n)
+#define uint32_t_le2host(n)  (n)
+#define uint64_t_le2host(n)  (n)
 
-#define uint16_t_be2host(n)		uint16_t_byteorder_swap(n)
-#define uint32_t_be2host(n)		uint32_t_byteorder_swap(n)
-#define uint64_t_be2host(n)		uint64_t_byteorder_swap(n)
+#define uint16_t_be2host(n)  (uint16_t_byteorder_swap(n))
+#define uint32_t_be2host(n)  (uint32_t_byteorder_swap(n))
+#define uint64_t_be2host(n)  (uint64_t_byteorder_swap(n))
 
-#define host2uint16_t_le(n)		(n)
-#define host2uint32_t_le(n)		(n)
-#define host2uint64_t_le(n)		(n)
+#define host2uint16_t_le(n)  (n)
+#define host2uint32_t_le(n)  (n)
+#define host2uint64_t_le(n)  (n)
 
-#define host2uint16_t_be(n)		uint16_t_byteorder_swap(n)
-#define host2uint32_t_be(n)		uint32_t_byteorder_swap(n)
-#define host2uint64_t_be(n)		uint64_t_byteorder_swap(n)
+#define host2uint16_t_be(n)  (uint16_t_byteorder_swap(n))
+#define host2uint32_t_be(n)  (uint32_t_byteorder_swap(n))
+#define host2uint64_t_be(n)  (uint64_t_byteorder_swap(n))
 
 #endif
Index: uspace/lib/libc/include/string.h
===================================================================
--- uspace/lib/libc/include/string.h	(revision 62140db53b75a953d42ed31acb77916cfc0ee678)
+++ uspace/lib/libc/include/string.h	(revision af65b727b2d309464d7cc25a7ce3ad5dc5afbdbc)
@@ -41,5 +41,4 @@
 
 #define U_SPECIAL  '?'
-#define U_BOM      0xfeff
 
 /** No size limit constant */
