Skip to content

Commit 9a75fa2

Browse files
committed
disable virtual table pointer checks for C++
1 parent 4f7c91f commit 9a75fa2

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

build/php.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,7 @@ AC_DEFUN([PHP_REQUIRE_CXX],[
745745
case "$CXX" in
746746
*clang++*)
747747
PHP_ADD_LIBRARY(c++)
748+
PHP_ADD_LIBRARY(c++abi)
748749
;;
749750
*)
750751
PHP_ADD_LIBRARY(stdc++)

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,7 @@ int main(void) {
16471647
CFLAGS="$OLD_CFLAGS"
16481648
if test "$php_cv_ubsan_no_function" = yes; then
16491649
CFLAGS="$CFLAGS -fno-sanitize=function"
1650-
CXXFLAGS="$CFLAGS -fno-sanitize=function"
1650+
CXXFLAGS="$CFLAGS -fno-sanitize=function,vptr"
16511651
fi
16521652
], [AC_MSG_ERROR([UndefinedBehaviorSanitizer is not available])])
16531653
fi

ext/intl/config.m4

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ if test "$PHP_INTL" != "no"; then
8585
AS_IF([$PKG_CONFIG icu-uc --atleast-version=74],[
8686
AC_MSG_RESULT([yes])
8787
PHP_CXX_COMPILE_STDCXX(17, mandatory, PHP_INTL_STDCXX)
88+
case $CXX in
89+
*clang++*) ICU_CXXFLAGS="$ICU_CXXFLAGS -stdlib=libc++" PHP_ADD_LIBRARY(c++) PHP_ADD_LIBRARY(c++abi)
90+
esac
8891
],[
8992
AC_MSG_RESULT([no])
9093
PHP_CXX_COMPILE_STDCXX(11, mandatory, PHP_INTL_STDCXX)
@@ -94,6 +97,7 @@ if test "$PHP_INTL" != "no"; then
9497
case $host_alias in
9598
*cygwin*) PHP_INTL_CXX_FLAGS="$PHP_INTL_CXX_FLAGS -D_POSIX_C_SOURCE=200809L"
9699
esac
100+
97101
if test "$ext_shared" = "no"; then
98102
PHP_ADD_SOURCES(PHP_EXT_DIR(intl), $PHP_INTL_CXX_SOURCES, $PHP_INTL_CXX_FLAGS)
99103
else

0 commit comments

Comments
 (0)