1.1 --- a/acinclude.m4 Thu Dec 11 23:28:50 2008 +0000
1.2 +++ b/acinclude.m4 Mon Dec 15 10:44:56 2008 +0000
1.7 +# AC_CHECK_FRAME_ADDRESS([if-ok],[if-notok])
1.8 +# Test if the compiler will let us modify the return address on the stack
1.9 +# via __builtin_frame_address()
1.10 +# -----------------------
1.11 +AC_DEFUN([AC_CHECK_FRAME_ADDRESS], [
1.12 +AC_MSG_CHECKING([if we have a working __builtin_frame_address()]);
1.15 +void * __attribute__((noinline)) first_arg( void *x, void *y ) { return x; }
1.16 +int __attribute__((noinline)) foo( int arg, void *exc )
1.19 + *(((void **)__builtin_frame_address(0))+1) = exc;
1.24 +int main(int argc, char *argv[])
1.26 + goto *first_arg(&&start, &&except);
1.29 + return foo( argc, &&except ) + 1;
1.34 + AC_MSG_RESULT([yes])
1.36 + AC_MSG_RESULT([no])