diff --git a/NEWS b/NEWS index 9cefea074e2..f1b6abbc3d9 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ PHP NEWS . Fixed bug #81216 (Nullsafe operator leaks dynamic property name). (Dmitry) . Fixed bug #81684 (Using null coalesce assignment with $GLOBALS["x"] produces opcode error). (ilutov) + . Fixed bug #81656 (GCC-11 silently ignores -R). (Michael Wallner) - MBString: . Fixed bug #81693 (mb_check_encoding(7bit) segfaults). (cmb) diff --git a/build/php.m4 b/build/php.m4 index 4f64f669eb9..01b82505981 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -279,25 +279,25 @@ dnl dnl Checks for -R, etc. switch. dnl AC_DEFUN([PHP_RUNPATH_SWITCH],[ -AC_MSG_CHECKING([if compiler supports -R]) -AC_CACHE_VAL(php_cv_cc_dashr,[ +AC_MSG_CHECKING([if compiler supports -Wl,-rpath,]) +AC_CACHE_VAL(php_cv_cc_rpath,[ SAVE_LIBS=$LIBS - LIBS="-R /usr/$PHP_LIBDIR $LIBS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],[php_cv_cc_dashr=yes],[php_cv_cc_dashr=no]) + LIBS="-Wl,-rpath,/usr/$PHP_LIBDIR $LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],[php_cv_cc_rpath=yes],[php_cv_cc_rpath=no]) LIBS=$SAVE_LIBS]) -AC_MSG_RESULT([$php_cv_cc_dashr]) -if test $php_cv_cc_dashr = "yes"; then - ld_runpath_switch=-R +AC_MSG_RESULT([$php_cv_cc_rpath]) +if test $php_cv_cc_rpath = "yes"; then + ld_runpath_switch=-Wl,-rpath, else - AC_MSG_CHECKING([if compiler supports -Wl,-rpath,]) - AC_CACHE_VAL(php_cv_cc_rpath,[ + AC_MSG_CHECKING([if compiler supports -R]) + AC_CACHE_VAL(php_cv_cc_dashr,[ SAVE_LIBS=$LIBS - LIBS="-Wl,-rpath,/usr/$PHP_LIBDIR $LIBS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],[php_cv_cc_rpath=yes],[php_cv_cc_rpath=no]) + LIBS="-R /usr/$PHP_LIBDIR $LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],[php_cv_cc_dashr=yes],[php_cv_cc_dashr=no]) LIBS=$SAVE_LIBS]) - AC_MSG_RESULT([$php_cv_cc_rpath]) - if test $php_cv_cc_rpath = "yes"; then - ld_runpath_switch=-Wl,-rpath, + AC_MSG_RESULT([$php_cv_cc_dashr]) + if test $php_cv_cc_dashr = "yes"; then + ld_runpath_switch=-R else dnl Something innocuous. ld_runpath_switch=-L