Index: kernel/generic/include/arch.h
===================================================================
--- kernel/generic/include/arch.h	(revision a36c4aa60172d48878363da38c12f612d1b71d17)
+++ kernel/generic/include/arch.h	(revision f9c30b9a950523d4a244e2b7d0bc184c17c6d010)
@@ -49,7 +49,17 @@
  *
  */
+#if __has_builtin(__builtin_stack_address)
+
+#define CURRENT \
+	((current_t *) (((uintptr_t) __builtin_stack_address()) & \
+	    (~((uintptr_t) STACK_SIZE - 1))))
+
+#else
+
 #define CURRENT \
 	((current_t *) (((uintptr_t) __builtin_frame_address(0)) & \
 	    (~((uintptr_t) STACK_SIZE - 1))))
+
+#endif
 
 #define MAGIC  UINT32_C(0xfacefeed)
