Index: tools/autotool.py
===================================================================
--- tools/autotool.py	(revision 02667d9f8facbf1c4afd9bb4842fefd0a6c1aec9)
+++ tools/autotool.py	(revision bfdb7c6344e26e53bd81545c5163f53e96517dd6)
@@ -234,5 +234,5 @@
 	if (config['PLATFORM'] == "amd64"):
 		platform = config['PLATFORM']
-		gnu_target = "amd64-linux-gnu"
+		gnu_target = "amd64-unknown-elf"
 		helenos_target = "amd64-helenos"
 	
Index: tools/toolchain.sh
===================================================================
--- tools/toolchain.sh	(revision 02667d9f8facbf1c4afd9bb4842fefd0a6c1aec9)
+++ tools/toolchain.sh	(revision bfdb7c6344e26e53bd81545c5163f53e96517dd6)
@@ -359,5 +359,5 @@
 	case "$1" in
 		"amd64")
-			LINUX_TARGET="amd64-linux-gnu"
+			LINUX_TARGET="amd64-unknown-elf"
 			HELENOS_TARGET="amd64-helenos"
 			;;
Index: uspace/lib/c/arch/amd64/Makefile.common
===================================================================
--- uspace/lib/c/arch/amd64/Makefile.common	(revision 02667d9f8facbf1c4afd9bb4842fefd0a6c1aec9)
+++ uspace/lib/c/arch/amd64/Makefile.common	(revision bfdb7c6344e26e53bd81545c5163f53e96517dd6)
@@ -27,5 +27,10 @@
 #
 
-COMMON_CFLAGS += -mno-tls-direct-seg-refs -fno-omit-frame-pointer
+COMMON_CFLAGS += -fno-omit-frame-pointer
+
+# XXX: clang doesn't support this flag, but the optimization is OS-specific,
+#      so it isn't used for amd64-unknown-elf target.
+GCC_CFLAGS += -mno-tls-direct-seg-refs
+
 LFLAGS += --gc-sections
 
