Index: uspace/Makefile.common
===================================================================
--- uspace/Makefile.common	(revision c90aed45894edfe6e38e6306948757008e2bb0eb)
+++ uspace/Makefile.common	(revision 9e40355e27190e4ad773852c97a87d91012aba10)
@@ -198,10 +198,13 @@
 	-pipe -g -D__$(ENDIANESS)__
 
+# clang does not support following options but I am not sure whether
+# something won't break because of that:
+# -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) -finput-charset=UTF-8
 CLANG_CFLAGS = $(LIBC_INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
-	-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
-	-finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
+	-ffreestanding -fno-builtin -nostdlib -nostdinc \
 	-Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
 	-Werror-implicit-function-declaration -Wwrite-strings \
-	-pipe -g -arch $(CLANG_ARCH) -D__$(ENDIANESS)__
+	-integrated-as \
+	-pipe -g -target $(CLANG_TARGET) -D__$(ENDIANESS)__
 
 LIB_CFLAGS = $(CFLAGS) -fPIC -D__IN_SHARED_LIBC__
@@ -251,4 +254,5 @@
 ifeq ($(COMPILER),clang)
 	CFLAGS += $(CLANG_CFLAGS) $(EXTRA_CFLAGS)
+	GCC_CFLAGS += $(EXTRA_CFLAGS)
 	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
 endif
@@ -303,5 +307,5 @@
 
 %.o: %.S $(DEPEND)
-	$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
+	$(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c $< -o $@
 ifeq ($(PRECHECK),y)
 	$(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__
Index: uspace/lib/c/Makefile
===================================================================
--- uspace/lib/c/Makefile	(revision c90aed45894edfe6e38e6306948757008e2bb0eb)
+++ uspace/lib/c/Makefile	(revision 9e40355e27190e4ad773852c97a87d91012aba10)
@@ -163,14 +163,14 @@
 
 $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in
-	$(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -E -x c $< | grep -v "^\#" > $@
+	$(CC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -E -x c $< | grep -v "^\#" > $@
 
 $(LIBC_PREFIX)/arch/$(UARCH)/_link-loader.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in
-	$(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DLOADER -E -x c $< | grep -v "^\#" > $@
+	$(CC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DLOADER -E -x c $< | grep -v "^\#" > $@
 
 $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in
-	$(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DSHLIB -E -x c $< | grep -v "^\#" > $@
+	$(CC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DSHLIB -E -x c $< | grep -v "^\#" > $@
 
 $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in
-	$(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DDLEXE -E -x c $< | grep -v "^\#" > $@
+	$(CC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DDLEXE -E -x c $< | grep -v "^\#" > $@
 
 $(COMMON_HEADER_ARCH): $(COMMON_HEADER)
Index: uspace/lib/c/arch/amd64/Makefile.common
===================================================================
--- uspace/lib/c/arch/amd64/Makefile.common	(revision c90aed45894edfe6e38e6306948757008e2bb0eb)
+++ uspace/lib/c/arch/amd64/Makefile.common	(revision 9e40355e27190e4ad773852c97a87d91012aba10)
@@ -28,5 +28,7 @@
 
 CLANG_ARCH = x86_64
+CLANG_TARGET = x86_64-unknown-linux
 GCC_CFLAGS += -fno-omit-frame-pointer
+CLANG_CFLAGS += -fno-omit-frame-pointer
 
 ENDIANESS = LE
Index: uspace/lib/c/arch/ia32/Makefile.common
===================================================================
--- uspace/lib/c/arch/ia32/Makefile.common	(revision c90aed45894edfe6e38e6306948757008e2bb0eb)
+++ uspace/lib/c/arch/ia32/Makefile.common	(revision 9e40355e27190e4ad773852c97a87d91012aba10)
@@ -28,4 +28,5 @@
 
 CLANG_ARCH = i386
+CLANG_TARGET = i386-unknown-linux
 
 ifeq ($(PROCESSOR),i486)
@@ -34,4 +35,5 @@
 	GCC_CFLAGS += -march=pentium -fno-omit-frame-pointer
 endif
+CLANG_CFLAGS += -fno-omit-frame-pointer
 
 ENDIANESS = LE
Index: uspace/lib/c/include/io/verify.h
===================================================================
--- uspace/lib/c/include/io/verify.h	(revision c90aed45894edfe6e38e6306948757008e2bb0eb)
+++ uspace/lib/c/include/io/verify.h	(revision 9e40355e27190e4ad773852c97a87d91012aba10)
@@ -38,6 +38,11 @@
 #ifndef NVERIFY_PRINTF
 
+#ifdef __clang__
+#define PRINTF_ATTRIBUTE(start, end) \
+	__attribute__((format(__printf__, start, end)))
+#else
 #define PRINTF_ATTRIBUTE(start, end) \
 	__attribute__((format(gnu_printf, start, end)))
+#endif
 
 #else /* NVERIFY_PRINTF */
