From 648673bffe7a7c63ce6223fcbac7c118a114c893 Mon Sep 17 00:00:00 2001 From: Keyur Govande Date: Tue, 7 Oct 2014 20:58:43 +0000 Subject: [PATCH 1/2] Fix for bug #68114 (Build fails on OS X due to undefined symbols) gcc (i686-apple-darwin10-gcc-4.2.1) on OS X cannot link fixed-width decimals and fails with undefined symbols errors like ___extendsddf. If configure used gcc for compiling it would notice and mark the feature HAVE_DECIMAL_FP_SUPPORT as unsupported. But configure seems to use cc (i686-apple-darwin10-llvm-gcc-4.2) instead, which doesn't support fixed-width decimals either, but the code compiles and links just fine. I suspect it may have something to do with the llvm backend printed in the version. Lacking the time to debug this further, the patch fixes the issue by checking the expected output when fixed-width decimal support is present and correctly implemented. --- ext/mysqlnd/config9.m4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/mysqlnd/config9.m4 b/ext/mysqlnd/config9.m4 index deda4414c46..e665cd0a8b5 100644 --- a/ext/mysqlnd/config9.m4 +++ b/ext/mysqlnd/config9.m4 @@ -70,12 +70,17 @@ dnl AC_CACHE_CHECK([whether whether compiler supports Decimal32/64/128 types], ac_cv_decimal_fp_supported,[ AC_TRY_RUN( [ #include +#include int main(int argc, char **argv) { typedef float dec32 __attribute__((mode(SD))); dec32 k = 99.49f; double d2 = (double)k; - return 0; + const char *check_str = "99.49"; + char print_str[32]; + + snprintf(print_str, 32, "%f", d2); + return memcmp(print_str, check_str, 5); } ],[ ac_cv_decimal_fp_supported=yes From d21602c07288283e680941c0c0f963715fed0337 Mon Sep 17 00:00:00 2001 From: Keyur Govande Date: Tue, 7 Oct 2014 21:07:19 +0000 Subject: [PATCH 2/2] Add to NEWS --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 8385d3e0126..2bf60f922f3 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,9 @@ PHP NEWS - Core: . Fixed bug #68118 ($a->foo .= 'test'; can leave $a->foo undefined). (Nikita) +- Mysqli: + . Fixed bug #68114 (linker error on some OS X machines with fixed width + decimal support) (Keyur Govande) ?? ??? 2014, PHP 5.5.18