Index: src/libcfa/exception.c
===================================================================
--- src/libcfa/exception.c	(revision 33218c6845f9825be5a63043ef89bb8a0a80d009)
+++ src/libcfa/exception.c	(revision b947fb2e40ff1eb3c74f2ca17397c8a24c9a2a9c)
@@ -9,7 +9,7 @@
 // Author           : Andrew Beach
 // Created On       : Mon Jun 26 15:13:00 2017
-// Last Modified By : Andrew Beach
-// Last Modified On : Tus Jul 11 16:36:00 2017
-// Update Count     : 1
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Jul 26 10:37:51 2017
+// Update Count     : 2
 //
 
@@ -21,4 +21,12 @@
 #include <stdio.h>
 #include <unwind.h>
+
+// FIX ME: temporary hack to keep ARM build working
+#ifndef _URC_FATAL_PHASE1_ERROR
+#define _URC_FATAL_PHASE1_ERROR 2
+#endif // ! _URC_FATAL_PHASE1_ERROR
+#ifndef _URC_FATAL_PHASE2_ERROR
+#define _URC_FATAL_PHASE2_ERROR 2
+#endif // ! _URC_FATAL_PHASE2_ERROR
 
 #include "lsda.h"
@@ -35,6 +43,6 @@
 
 
-// This macro should be the only thing that needs to change across machines.
-// Used in the personality function, way down in termination.
+// This macro should be the only thing that needs to change across machines.  Used in the personality function, way down
+// in termination.
 // struct _Unwind_Context * -> _Unwind_Reason_Code(*)(exception *)
 #define MATCHER_FROM_CONTEXT(ptr_to_context) \
@@ -69,8 +77,7 @@
 }
 
-/* Do we control where exceptions get thrown even with concurency?
- * If not these are not quite thread safe, the cleanup hook has to be added
- * after the node is built but before it is made the top node.
- */
+// Do we control where exceptions get thrown even with concurency?  If not these are not quite thread safe, the cleanup
+// hook has to be added after the node is built but before it is made the top node.
+
 void __cfaehm__try_resume_setup(struct __cfaehm__try_resume_node * node,
                         int (*handler)(exception * except)) {
@@ -89,6 +96,5 @@
 // Requires -fexceptions to work.
 
-// Global which defines the current exception
-// Currently an int just to make matching easier
+// Global which defines the current exception.  Currently an int just to make matching easier.
 //int this_exception; (became shared_stack.current_exception)
 
@@ -121,16 +127,13 @@
 	_Unwind_Reason_Code ret = _Unwind_RaiseException( &this_exception_storage );
 
-	// If we reach here it means something happened
-	// For resumption to work we need to find a way to return back to here
-	// Most of them will probably boil down to setting a global flag and making the phase 1 either stop or fail.
-	// Causing an error on purpose may help avoiding unnecessary work but it might have some weird side effects.
-	// If we just pretend no handler was found that would work but may be expensive for no reason since we will always
-	// search the whole stack
+	// If we reach here it means something happened.  For resumption to work we need to find a way to return back to
+	// here.  Most of them will probably boil down to setting a global flag and making the phase 1 either stop or
+	// fail.  Causing an error on purpose may help avoiding unnecessary work but it might have some weird side
+	// effects.  If we just pretend no handler was found that would work but may be expensive for no reason since we
+	// will always search the whole stack.
 
 	if( ret == _URC_END_OF_STACK ) {
-		// No proper handler was found
-		// This can be handled in several way
-		// C++ calls std::terminate
-		// Here we force unwind the stack, basically raising a cancellation
+		// No proper handler was found.  This can be handled in several way.  C++ calls std::terminate Here we
+		// force unwind the stack, basically raising a cancellation.
 		printf("Uncaught exception %p\n", &this_exception_storage);
 
@@ -140,6 +143,5 @@
 	}
 
-	// We did not simply reach the end of the stack without finding a handler,
-	// Something wen't wrong
+	// We did not simply reach the end of the stack without finding a handler.  Something wen't wrong
 	printf("UNWIND ERROR %d after raise exception\n", ret);
 	abort();
@@ -154,8 +156,6 @@
 }
 
-// This is our personality routine
-// For every stack frame anotated with ".cfi_personality 0x3,__gcfa_personality_v0"
-// This function will be called twice when unwinding
-// Once in the search phased and once in the cleanup phase
+// This is our personality routine.  For every stack frame anotated with ".cfi_personality 0x3,__gcfa_personality_v0".
+// This function will be called twice when unwinding.  Once in the search phased and once in the cleanup phase.
 _Unwind_Reason_Code __gcfa_personality_v0 (
 		int version, _Unwind_Action actions, unsigned long long exceptionClass,
@@ -293,5 +293,5 @@
 				// I assume this sets the instruction pointer to the adress of the landing pad
 				// It doesn't actually set it, it only state the value that needs to be set once we return _URC_INSTALL_CONTEXT
-				_Unwind_SetIP( context, lsd_info.LPStart + callsite_landing_pad );
+				_Unwind_SetIP( context, ((lsd_info.LPStart) + (callsite_landing_pad)) );
 
 				// DEBUG
@@ -317,8 +317,6 @@
 }
 
-// Try statements are hoisted out see comments for details
-// With this could probably be unique and simply linked from
-// libcfa but there is one problem left, see the exception table
-// for details
+// Try statements are hoisted out see comments for details.  With this could probably be unique and simply linked from
+// libcfa but there is one problem left, see the exception table for details
 __attribute__((noinline))
 void __cfaehm__try_terminate(void (*try_block)(),
@@ -328,11 +326,9 @@
 	//! printf("%p %p %p %p\n", &try_block, &catch_block, &match_block, &xy);
 
-	// Setup statments
-	// These 2 statments won't actually result in any code,
-	// they only setup global tables.
-	// However, they clobber gcc cancellation support from gcc.
-	// We can replace the personality routine but replacing the exception
-	// table gcc generates is not really doable, it generates labels based
-	// on how the assembly works.
+	// Setup statments: These 2 statments won't actually result in any code, they only setup global tables.
+	// However, they clobber gcc cancellation support from gcc.  We can replace the personality routine but
+	// replacing the exception table gcc generates is not really doable, it generates labels based on how the
+	// assembly works.
+
 	// Setup the personality routine
 	asm volatile (".cfi_personality 0x3,__gcfa_personality_v0");
@@ -340,5 +336,5 @@
 	asm volatile (".cfi_lsda 0x3, .LLSDACFA2");
 
-	// Label which defines the start of the area for which the handler is setup
+	// Label which defines the start of the area for which the handler is setup.
 	asm volatile (".TRYSTART:");
 
@@ -354,22 +350,20 @@
 	// Exceptionnal path
 	CATCH : __attribute__(( unused ));
-	// Label which defines the end of the area for which the handler is setup
+	// Label which defines the end of the area for which the handler is setup.
 	asm volatile (".TRYEND:");
-	// Label which defines the start of the exception landing pad
-	// basically what will be called when the exception is caught
-	// Note, if multiple handlers are given, the multiplexing should be done
-	// by the generated code, not the exception runtime
+	// Label which defines the start of the exception landing pad.  Basically what is called when the exception is
+	// caught.  Note, if multiple handlers are given, the multiplexing should be done by the generated code, not the
+	// exception runtime.
 	asm volatile (".CATCH:");
 
 	// Exception handler
-	catch_block(shared_stack.current_handler_index,
-	            &shared_stack.current_exception);
-}
-
-// Exception table data we need to generate
-// While this is almost generic, the custom data refers to
-// foo_try_match try match, which is no way generic
-// Some more works need to be done if we want to have a single
-// call to the try routine
+	catch_block( shared_stack.current_handler_index,
+	            &shared_stack.current_exception );
+}
+
+// Exception table data we need to generate.  While this is almost generic, the custom data refers to foo_try_match try
+// match, which is no way generic.  Some more works need to be done if we want to have a single call to the try routine.
+
+#if defined( __x86_64__ ) || defined( __i386__ )
 asm (
 	//HEADER
@@ -394,2 +388,3 @@
 //	"	.section	.note.GNU-stack,\"x\",@progbits\n"
 );
+#endif // __x86_64__ || __i386__
