Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision f03c3da635e07202ea78ed26fba2187be319083d)
+++ HelenOS.config	(revision 8f2eca0d71e34991f3100a8ad7cd69d5a57ab184)
@@ -291,4 +291,5 @@
 @ "gcc_cross" GNU C Compiler (cross-compiler)
 @ "gcc_native" GNU C Compiler (native)
+@ "gcc_helenos" GNU C Compiler (HelenOS-specific cross-compiler)
 @ "icc" Intel C Compiler
 @ "clang" Clang
@@ -299,4 +300,5 @@
 @ "gcc_native" GNU C Compiler (native)
 @ "icc" Intel C Compiler
+@ "gcc_helenos" GNU C Compiler (HelenOS-specific cross-compiler)
 ! [PLATFORM=ia64] COMPILER (choice)
 
@@ -304,4 +306,5 @@
 @ "gcc_cross" GNU C Compiler (cross-compiler)
 @ "gcc_native" GNU C Compiler (native)
+@ "gcc_helenos" GNU C Compiler (HelenOS-specific cross-compiler)
 ! [PLATFORM=mips32|PLATFORM=mips64|PLATFORM=ppc32] COMPILER (choice)
 
@@ -309,4 +312,5 @@
 @ "gcc_cross" GNU C Compiler (cross-compiler)
 @ "gcc_native" GNU C Compiler (native)
+@ "gcc_helenos" GNU C Compiler (HelenOS-specific cross-compiler)
 @ "clang" Clang
 ! [PLATFORM=abs32le|PLATFORM=arm32|PLATFORM=sparc64] COMPILER (choice)
@@ -319,5 +323,5 @@
 @ "ia32" Intel IA-32
 @ "mips32" MIPS 32-bit
-! [PLATFORM=abs32le&COMPILER=gcc_cross] CROSS_TARGET (choice)
+! [PLATFORM=abs32le&(COMPILER=gcc_cross|COMPILER=gcc_helenos)] CROSS_TARGET (choice)
 
 
Index: boot/Makefile.build
===================================================================
--- boot/Makefile.build	(revision f03c3da635e07202ea78ed26fba2187be319083d)
+++ boot/Makefile.build	(revision 8f2eca0d71e34991f3100a8ad7cd69d5a57ab184)
@@ -75,4 +75,10 @@
 endif
 
+ifeq ($(COMPILER),gcc_helenos)
+	CFLAGS = $(GCC_CFLAGS) $(EXTRA_CFLAGS)
+	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
+endif
+
+
 ifeq ($(COMPILER),icc)
 	CFLAGS = $(ICC_CFLAGS) $(EXTRA_CFLAGS)
Index: kernel/Makefile
===================================================================
--- kernel/Makefile	(revision f03c3da635e07202ea78ed26fba2187be319083d)
+++ kernel/Makefile	(revision 8f2eca0d71e34991f3100a8ad7cd69d5a57ab184)
@@ -167,4 +167,10 @@
 
 ifeq ($(COMPILER),gcc_cross)
+	CFLAGS = $(GCC_CFLAGS)
+	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
+	INSTRUMENTATION = -finstrument-functions
+endif
+
+ifeq ($(COMPILER),gcc_helenos)
 	CFLAGS = $(GCC_CFLAGS)
 	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
Index: tools/autotool.py
===================================================================
--- tools/autotool.py	(revision f03c3da635e07202ea78ed26fba2187be319083d)
+++ tools/autotool.py	(revision 8f2eca0d71e34991f3100a8ad7cd69d5a57ab184)
@@ -186,4 +186,5 @@
 	gnu_target = None
 	clang_target = None
+	helenos_target = None
 	cc_args = []
 	
@@ -195,12 +196,15 @@
 			gnu_target = "arm-linux-gnueabi"
 			clang_target = "arm-unknown-linux"
+			helenos_target = "arm-helenos-gnueabi"
 		
 		if (config['CROSS_TARGET'] == "ia32"):
 			gnu_target = "i686-pc-linux-gnu"
 			clang_target = "i386-unknown-linux"
+			helenos_target = "i686-pc-helenos"
 		
 		if (config['CROSS_TARGET'] == "mips32"):
 			gnu_target = "mipsel-linux-gnu"
 			clang_target = "mipsel-unknown-linux"
+			helenos_target = "mipsel-helenos"
 			common['CC_ARGS'].append("-mabi=32")
 	
@@ -209,4 +213,5 @@
 		gnu_target = "amd64-linux-gnu"
 		clang_target = "x86_64-unknown-linux"
+		helenos_target = "amd64-helenos"
 	
 	if (config['PLATFORM'] == "arm32"):
@@ -214,4 +219,5 @@
 		gnu_target = "arm-linux-gnueabi"
 		clang_target = "arm-unknown-linux"
+		helenos_target = "arm-helenos-gnueabi"
 	
 	if (config['PLATFORM'] == "ia32"):
@@ -219,8 +225,10 @@
 		gnu_target = "i686-pc-linux-gnu"
 		clang_target = "i386-unknown-linux"
+		helenos_target = "i686-pc-helenos"
 	
 	if (config['PLATFORM'] == "ia64"):
 		target = config['PLATFORM']
 		gnu_target = "ia64-pc-linux-gnu"
+		helenos_target = "ia64-pc-helenos"
 	
 	if (config['PLATFORM'] == "mips32"):
@@ -232,4 +240,5 @@
 			gnu_target = "mipsel-linux-gnu"
 			clang_target = "mipsel-unknown-linux"
+			helenos_target = "mipsel-helenos"
 		
 		if ((config['MACHINE'] == "bmalta")):
@@ -237,4 +246,5 @@
 			gnu_target = "mips-linux-gnu"
 			clang_target = "mips-unknown-linux"
+			helenos_target = "mips-helenos"
 	
 	if (config['PLATFORM'] == "mips64"):
@@ -246,4 +256,5 @@
 			gnu_target = "mips64el-linux-gnu"
 			clang_target = "mips64el-unknown-linux"
+			helenos_target = "mips64el-helenos"
 	
 	if (config['PLATFORM'] == "ppc32"):
@@ -251,4 +262,5 @@
 		gnu_target = "ppc-linux-gnu"
 		clang_target = "powerpc-unknown-linux"
+		helenos_target = "ppc-helenos"
 	
 	if (config['PLATFORM'] == "sparc64"):
@@ -256,6 +268,7 @@
 		gnu_target = "sparc64-linux-gnu"
 		clang_target = "sparc-unknown-linux"
-	
-	return (target, cc_args, gnu_target, clang_target)
+		helenos_target = "sparc64-helenos"
+	
+	return (target, cc_args, gnu_target, clang_target, helenos_target)
 
 def check_app(args, name, details):
@@ -697,4 +710,10 @@
 		cross_prefix = "/usr/local/cross"
 	
+	# HelenOS cross-compiler prefix
+	if ('CROSS_HELENOS_PREFIX' in os.environ):
+		cross_helenos_prefix = os.environ['CROSS_HELENOS_PREFIX']
+	else:
+		cross_helenos_prefix = "/usr/local/cross-helenos"
+	
 	# Prefix binutils tools on Solaris
 	if (os.uname()[0] == "SunOS"):
@@ -719,5 +738,5 @@
 		common['CC_ARGS'] = []
 		if (config['COMPILER'] == "gcc_cross"):
-			target, cc_args, gnu_target, clang_target = get_target(config)
+			target, cc_args, gnu_target, clang_target, helenos_target = get_target(config)
 			
 			if (target is None) or (gnu_target is None):
@@ -727,4 +746,21 @@
 			path = "%s/%s/bin" % (cross_prefix, target)
 			prefix = "%s-" % gnu_target
+			
+			check_gcc(path, prefix, common, PACKAGE_CROSS)
+			check_binutils(path, prefix, common, PACKAGE_CROSS)
+			
+			check_common(common, "GCC")
+			common['CC'] = common['GCC']
+			common['CC_ARGS'].extend(cc_args)
+		
+		if (config['COMPILER'] == "gcc_helenos"):
+			target, cc_args, gnu_target, clang_target, helenos_target = get_target(config)
+			
+			if (target is None) or (helenos_target is None):
+				print_error(["Unsupported compiler target for GNU GCC.",
+				             "Please contact the developers of HelenOS."])
+			
+			path = "%s/%s/bin" % (cross_helenos_prefix, target)
+			prefix = "%s-" % helenos_target
 			
 			check_gcc(path, prefix, common, PACKAGE_CROSS)
Index: uspace/Makefile.common
===================================================================
--- uspace/Makefile.common	(revision f03c3da635e07202ea78ed26fba2187be319083d)
+++ uspace/Makefile.common	(revision 8f2eca0d71e34991f3100a8ad7cd69d5a57ab184)
@@ -243,4 +243,9 @@
 endif
 
+ifeq ($(COMPILER),gcc_helenos)
+	CFLAGS += $(GCC_CFLAGS) $(EXTRA_CFLAGS)
+	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
+endif
+
 ifeq ($(COMPILER),gcc_native)
 	CFLAGS += $(GCC_CFLAGS) $(EXTRA_CFLAGS)
