Skip to contentSkip to conversation

configure: don't optimize away avx2 test functions

PATCH In review Mohammed Gamal 1 participant 2 messages Jun 21, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: don't optimize away avx2 test functions

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

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index 8ecf29d..ba31d3a 100755
@@ -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
Signature · 1 line
1.9.1
#1 lore raw

Please drop this patch. I see it has already been fixed upstream

Quoted 27 lines · Mohammed Gamal

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

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -2
index 8ecf29d..ba31d3a 100755
@@ -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

Signature · 14 lines
Mohammed Gamal
Software Engineer

ProfitBricks GmbH
Greifswalder Straße 207
D - 10405 Berlin

Tel: +49 30 577 008 20
Email:       [email protected]
Web:         http://www.profitbricks.de

Sitz der Gesellschaft: Berlin.
Registergericht: Amtsgericht Charlottenburg, HRB 125506B.
Geschäftsführer: Andreas Gauger, Achim Weiss.