summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2008-08-17 17:06:37 +0200
committerWilly Tarreau <w@1wt.eu>2008-09-02 11:13:51 +0200
commit0dca3783ff30bb78492750fbb61303f640ec5b91 (patch)
tree376369b013a11117fec93fe0fbeccb0938e27b29
parent3191fc8d0e3744a78204c05e8d6e8a83a5cf7f0e (diff)
downloadhaproxy-0dca3783ff30bb78492750fbb61303f640ec5b91.tar.gz
[BUG] regparm is broken on gcc < 3
Gcc < 3 does not consider regparm declarations for function pointers. This causes big trouble at least with pollers (and with any function pointer after all). Disable CONFIG_HAP_USE_REGPARM for gcc < 3. (cherry picked from commit 61eadc028fb8774ea05d893cd3eca6c671fb511e) (cherry picked from commit ee113f5345c49a1e8ea9c8ea6b047f3c0f43db1f)
-rw-r--r--include/common/config.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/common/config.h b/include/common/config.h
index 85deeaed5..74bee477e 100644
--- a/include/common/config.h
+++ b/include/common/config.h
@@ -70,9 +70,10 @@
/* CONFIG_HAP_USE_REGPARM
* This enables the use of register parameters for some functions where
- * it may improve performance by a measurable factor.
+ * it may improve performance by a measurable factor. This MUST NOT be
+ * enabled on gcc < 3 because it is ignored for function pointers.
*/
-#ifdef CONFIG_HAP_USE_REGPARM
+#if CONFIG_HAP_USE_REGPARM && __GNUC__ >= 3
#define REGPRM1 __attribute__((regparm(1)))
#define REGPRM2 __attribute__((regparm(2)))
#define REGPRM3 __attribute__((regparm(3)))