Index: uspace/lib/libc/arch/amd64/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/amd64/Makefile.inc	(revision f563126931ea083d74828e89fd20f24e40d63b00)
+++ uspace/lib/libc/arch/amd64/Makefile.inc	(revision 4f5edcf6224db0fa0ebc1445b1e594be576a452e)
@@ -31,4 +31,5 @@
 
 TARGET = amd64-linux-gnu
+CLANG_ARCH = x86_64
 TOOLCHAIN_DIR = $(CROSS_PREFIX)/amd64/bin
 
Index: uspace/lib/libc/arch/arm32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/arm32/Makefile.inc	(revision f563126931ea083d74828e89fd20f24e40d63b00)
+++ uspace/lib/libc/arch/arm32/Makefile.inc	(revision 4f5edcf6224db0fa0ebc1445b1e594be576a452e)
@@ -39,5 +39,5 @@
 	arch/$(UARCH)/src/eabi.S
 
-CFLAGS += -ffixed-r9 -mtp=soft
+GCC_CFLAGS += -ffixed-r9 -mtp=soft
 LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a
 
Index: uspace/lib/libc/arch/ia32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/ia32/Makefile.inc	(revision f563126931ea083d74828e89fd20f24e40d63b00)
+++ uspace/lib/libc/arch/ia32/Makefile.inc	(revision 4f5edcf6224db0fa0ebc1445b1e594be576a452e)
@@ -31,4 +31,5 @@
 
 TARGET = i686-pc-linux-gnu
+CLANG_ARCH = i386
 TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia32/bin
 
Index: uspace/lib/libc/arch/ia32/include/stackarg.h
===================================================================
--- uspace/lib/libc/arch/ia32/include/stackarg.h	(revision f563126931ea083d74828e89fd20f24e40d63b00)
+++ 	(revision )
@@ -1,66 +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
- */
-
-/*
- * Variable argument list manipulation macros
- * for architectures using stack to pass arguments.
- */
- 
-#ifndef LIBC_ia32_STACKARG_H_
-#define LIBC_ia32_STACKARG_H_
-
-#include <sys/types.h>
-
-/* dont allow to define it second time in stdarg.h */
-#define __VARARGS_DEFINED
-
-typedef struct va_list {
-	int pos;
-	uint8_t *last;
-} va_list;
-
-#define va_start(ap, lst) \
-	(ap).pos = sizeof(lst); 			\
-	(ap).last = (uint8_t *) &(lst)
-
-#define va_arg(ap, type) 		\
-	(*((type *)((ap).last + ((ap).pos  += sizeof(type) ) - sizeof(type))))
-
-#define va_end(ap)
-
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/ia64/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/ia64/Makefile.inc	(revision f563126931ea083d74828e89fd20f24e40d63b00)
+++ uspace/lib/libc/arch/ia64/Makefile.inc	(revision 4f5edcf6224db0fa0ebc1445b1e594be576a452e)
@@ -38,5 +38,5 @@
 	arch/$(UARCH)/src/ddi.c
 
-CFLAGS += -fno-unwind-tables
+GCC_CFLAGS += -fno-unwind-tables
 LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a
 
Index: uspace/lib/libc/arch/mips32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/mips32/Makefile.inc	(revision f563126931ea083d74828e89fd20f24e40d63b00)
+++ uspace/lib/libc/arch/mips32/Makefile.inc	(revision 4f5edcf6224db0fa0ebc1445b1e594be576a452e)
@@ -37,5 +37,5 @@
 	arch/$(UARCH)/src/tls.c
 
-CFLAGS += -mips3
+GCC_CFLAGS += -mips3
 
 ENDIANESS = LE
Index: uspace/lib/libc/arch/mips32/include/stackarg.h
===================================================================
--- uspace/lib/libc/arch/mips32/include/stackarg.h	(revision f563126931ea083d74828e89fd20f24e40d63b00)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * 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
- * @ingroup libcmips32eb	
- */
-
-#ifndef LIBC_mips32_STACKARG_H_
-#define LIBC_mips32_STACKARG_H_
-
-/* dont allow to define it second time in stdarg.h */
-#define __VARARGS_DEFINED
-
-#include <sys/types.h>
-
-/**
- * va_arg macro for MIPS32 - problem is that 64 bit values must be aligned on an 8-byte boundary (32bit values not)
- * To satisfy this, paddings must be sometimes inserted. 
- */
-
-typedef uint8_t* va_list;
-
-#define va_start(ap, lst) \
-	((ap) = (va_list)&(lst) + sizeof(lst))
-
-#define va_arg(ap, type)	\
-	(((type *)((ap) = (va_list)( (sizeof(type) <= 4) ? ((uint32_t)((ap) + 2*4 - 1) & (~3)) : ((uint32_t)((ap) + 2*8 -1) & (~7)) )))[-1])
-
-#define va_end(ap)
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/mips32eb/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/mips32eb/Makefile.inc	(revision f563126931ea083d74828e89fd20f24e40d63b00)
+++ uspace/lib/libc/arch/mips32eb/Makefile.inc	(revision 4f5edcf6224db0fa0ebc1445b1e594be576a452e)
@@ -34,8 +34,8 @@
 
 ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
-		arch/$(UARCH)/src/fibril.S \
-		arch/$(UARCH)/src/tls.c
+	arch/$(UARCH)/src/fibril.S \
+	arch/$(UARCH)/src/tls.c
 
-CFLAGS += -mips3
+GCC_CFLAGS += -mips3
 LFLAGS += -N
 
Index: uspace/lib/libc/arch/mips32eb/include/stackarg.h
===================================================================
--- uspace/lib/libc/arch/mips32eb/include/stackarg.h	(revision f563126931ea083d74828e89fd20f24e40d63b00)
+++ 	(revision )
@@ -1,1 +1,0 @@
-../../mips32/include/stackarg.h
Index: uspace/lib/libc/arch/ppc32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/ppc32/Makefile.inc	(revision f563126931ea083d74828e89fd20f24e40d63b00)
+++ uspace/lib/libc/arch/ppc32/Makefile.inc	(revision 4f5edcf6224db0fa0ebc1445b1e594be576a452e)
@@ -37,5 +37,5 @@
 	arch/$(UARCH)/src/tls.c
 
-CFLAGS += -mcpu=powerpc -msoft-float -m32
+GCC_CFLAGS += -mcpu=powerpc -msoft-float -m32
 AFLAGS += -a32
 LFLAGS += -N
Index: uspace/lib/libc/arch/sparc64/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/sparc64/Makefile.inc	(revision f563126931ea083d74828e89fd20f24e40d63b00)
+++ uspace/lib/libc/arch/sparc64/Makefile.inc	(revision 4f5edcf6224db0fa0ebc1445b1e594be576a452e)
@@ -36,5 +36,5 @@
 	arch/$(UARCH)/src/tls.c
 
-CFLAGS += -mcpu=ultrasparc -m64
+GCC_CFLAGS += -mcpu=ultrasparc -m64
 LFLAGS += -no-check-sections -N
 
