diff mbox

configure: don't optimize away avx2 test functions

Message ID 1466500225-19326-1-git-send-email-mohammed.gamal@profitbricks.com
State New
Headers show

Commit Message

Mohammed Gamal June 21, 2016, 9:10 a.m. UTC
The configure script contains an embedded test C function
to test for avx2 support. It gets optimized away with
gcc 4.7 on wheezy.
Add __attribute__((optimize("O0"))) to it in order
to prevent optimizing it away

Signed-off-by: Mohammed Gamal <mohammed.gamal@profitbricks.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mohammed Gamal June 21, 2016, 9:16 a.m. UTC | #1
Please drop this patch. I see it has already been fixed upstream

On Tue, Jun 21, 2016 at 11:10 AM, Mohammed Gamal
<mohammed.gamal@profitbricks.com> wrote:
> The configure script contains an embedded test C function
> to test for avx2 support. It gets optimized away with
> gcc 4.7 on wheezy.
> Add __attribute__((optimize("O0"))) to it in order
> to prevent optimizing it away
>
> Signed-off-by: Mohammed Gamal <mohammed.gamal@profitbricks.com>
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 8ecf29d..ba31d3a 100755
> --- a/configure
> +++ b/configure
> @@ -1782,7 +1782,7 @@ fi
>
>  cat > $TMPC << EOF
>  static void bar(void) {}
> -static void *bar_ifunc(void) {return (void*) bar;}
> +static void __attribute__((optimize("O0"))) *bar_ifunc(void) {return (void*) bar;}
>  static void foo(void) __attribute__((ifunc("bar_ifunc")));
>  int main(void) { foo(); return 0; }
>  EOF
> --
> 1.9.1
>
diff mbox

Patch

diff --git a/configure b/configure
index 8ecf29d..ba31d3a 100755
--- a/configure
+++ b/configure
@@ -1782,7 +1782,7 @@  fi
 
 cat > $TMPC << EOF
 static void bar(void) {}
-static void *bar_ifunc(void) {return (void*) bar;}
+static void __attribute__((optimize("O0"))) *bar_ifunc(void) {return (void*) bar;}
 static void foo(void) __attribute__((ifunc("bar_ifunc")));
 int main(void) { foo(); return 0; }
 EOF