diff --git a/TSRM/threads.m4 b/TSRM/threads.m4 index 38494ce7cae9b..c36b5034e6ce2 100644 --- a/TSRM/threads.m4 +++ b/TSRM/threads.m4 @@ -90,6 +90,10 @@ int main() { case $host_alias in *netware*) pthreads_working=yes + ;; + *nacl*) + pthreads_working=yes + ;; esac ] ) ] )dnl diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index a29350d7bf11b..155ae88b6bc20 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -664,7 +664,7 @@ static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_ static inline unsigned int zend_mm_high_bit(size_t _size) { -#if defined(__GNUC__) && defined(i386) +#if defined(__GNUC__) && (defined(__native_client__) || defined(i386)) unsigned int n; __asm__("bsrl %1,%0\n\t" : "=r" (n) : "rm" (_size)); @@ -690,7 +690,7 @@ static inline unsigned int zend_mm_high_bit(size_t _size) static inline unsigned int zend_mm_low_bit(size_t _size) { -#if defined(__GNUC__) && defined(i386) +#if defined(__GNUC__) && (defined(__native_client__) || defined(i386)) unsigned int n; __asm__("bsfl %1,%0\n\t" : "=r" (n) : "rm" (_size)); @@ -2454,7 +2454,7 @@ ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_ return _zend_mm_block_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); } -#if defined(__GNUC__) && defined(i386) +#if defined(__GNUC__) && (defined(__native_client__) || defined(i386)) static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) { diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h index 33a86d7dd81e9..8ac2b9f533683 100644 --- a/Zend/zend_multiply.h +++ b/Zend/zend_multiply.h @@ -19,7 +19,7 @@ /* $Id$ */ -#if defined(__i386__) && defined(__GNUC__) +#if (defined(__i386__) || defined(__native_client__)) && defined(__GNUC__) #define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ long __tmpvar; \ diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 08a6b19bd44b9..96d6228054282 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -477,7 +477,7 @@ ZEND_API void zend_update_current_locale(void); static zend_always_inline int fast_increment_function(zval *op1) { if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { -#if defined(__GNUC__) && defined(__i386__) +#if defined(__GNUC__) && (defined(__native_client__) || defined(__i386__)) __asm__( "incl (%0)\n\t" "jno 0f\n\t" @@ -514,7 +514,7 @@ static zend_always_inline int fast_increment_function(zval *op1) static zend_always_inline int fast_decrement_function(zval *op1) { if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { -#if defined(__GNUC__) && defined(__i386__) +#if defined(__GNUC__) && (defined(__native_client__) || defined(__i386__)) __asm__( "decl (%0)\n\t" "jno 0f\n\t" @@ -552,7 +552,7 @@ static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *o { if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { -#if defined(__GNUC__) && defined(__i386__) +#if defined(__GNUC__) && (defined(__native_client__) || defined(__i386__)) __asm__( "movl (%1), %%eax\n\t" "addl (%2), %%eax\n\t" @@ -627,7 +627,7 @@ static zend_always_inline int fast_sub_function(zval *result, zval *op1, zval *o { if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { -#if defined(__GNUC__) && defined(__i386__) +#if defined(__GNUC__) && (defined(__native_client__) || defined(__i386__)) __asm__( "movl (%1), %%eax\n\t" "subl (%2), %%eax\n\t" diff --git a/acinclude.m4 b/acinclude.m4 index ad4f7474b385a..bc4266963d86f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1124,9 +1124,15 @@ dnl dnl PHP_CHECK_TYPES(type-list, include-file [, extra-headers]) dnl AC_DEFUN([PHP_CHECK_TYPES], [ + cross_compile_value=0 + case $host_alias in + *nacl*) + cross_compile_value=1 + ;; + esac for php_typename in $1; do AC_MSG_CHECKING([whether $php_typename exists]) - _PHP_CHECK_SIZEOF($php_typename, 0, $3, [ + _PHP_CHECK_SIZEOF($php_typename, cross_compile_value, $3, [ _PHP_DEF_HAVE_FILE($php_typename, $2) AC_MSG_RESULT([yes]) ], [ diff --git a/config.sub b/config.sub index 6759825a5b7fc..7071fff552dd7 100644 --- a/config.sub +++ b/config.sub @@ -739,6 +739,10 @@ case $basic_machine in basic_machine=i370-ibm os=-mvs ;; + nacl) + basic_machine=i686-pc + os=-nacl + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -1388,6 +1392,8 @@ case $os in -zvmoe) os=-zvmoe ;; + -nacl*) + ;; -none) ;; *)