Browse Source

configure: Fix check_exec_crash for ICL support

Change the check_exec_crash test to use a function pointer instead of
simply calling the function. The EBP availability test will crash when
compiled with ICL likely due to compiler optimization shenanigans.

Originally the check_exec_crash code was moved out of main to fix a
problem with gcc's treatment of non-leaf main on x86_32. Libav already
moved the code out of main but the addition of the function pointer will
prevent any inlining which fixes the remaining problem.

A function pointer is used since it is compiler agnostic (as opposed to
say __attribute__ ((noinline)) which would only work with gcc compatible
compilers).

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
tags/n2.0
Laurent Luca Barbato 12 years ago
parent
commit
9495cd170b
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      configure

+ 2
- 1
configure View File

@@ -911,6 +911,7 @@ static void sighandler(int sig){
int foo(void){
$code
}
int (*func_ptr)(void) = foo;
int main(void){
signal(SIGILL, sighandler);
signal(SIGFPE, sighandler);
@@ -918,7 +919,7 @@ int main(void){
#ifdef SIGBUS
signal(SIGBUS, sighandler);
#endif
foo();
return func_ptr();
}
EOF
}


Loading…
Cancel
Save