Skip to content

Commit a8c2ef8

Browse files
committed
Autotools: Enable tsrmls cache in hash extension on big endian
When system is detected as big endian this enables the TSRM Local Storage static cache with the ZEND_ENABLE_STATIC_TSRMLS_CACHE compilation flag. Previously it was enabled only on little endian systems.
1 parent 6eca783 commit a8c2ef8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/hash/config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ else
3131
SHA3_OPT_SRC="$SHA3_DIR/KeccakP-1600-opt64.c"
3232
])
3333
EXT_HASH_SHA3_SOURCES="$SHA3_OPT_SRC $SHA3_DIR/KeccakHash.c $SHA3_DIR/KeccakSponge.c hash_sha3.c"
34-
PHP_HASH_CFLAGS="$PHP_HASH_CFLAGS -I@ext_srcdir@/$SHA3_DIR -DKeccakP200_excluded -DKeccakP400_excluded -DKeccakP800_excluded -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
34+
PHP_HASH_CFLAGS="$PHP_HASH_CFLAGS -I@ext_srcdir@/$SHA3_DIR -DKeccakP200_excluded -DKeccakP400_excluded -DKeccakP800_excluded"
3535
fi
3636

3737
EXT_HASH_SOURCES="hash.c hash_md.c hash_sha.c hash_sha_sse2.c hash_sha_ni.c hash_ripemd.c hash_haval.c \
3838
hash_tiger.c hash_gost.c hash_snefru.c hash_whirlpool.c hash_adler32.c \
3939
hash_crc32.c hash_fnv.c hash_joaat.c $EXT_HASH_SHA3_SOURCES
4040
murmur/PMurHash.c murmur/PMurHash128.c hash_murmur.c hash_xxhash.c"
4141

42-
PHP_NEW_EXTENSION([hash], [$EXT_HASH_SOURCES], [no],, [$PHP_HASH_CFLAGS])
42+
PHP_NEW_EXTENSION([hash], [$EXT_HASH_SOURCES], [no],, [$PHP_HASH_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
4343
PHP_ADD_BUILD_DIR([$ext_builddir/murmur])
4444
AS_VAR_IF([SHA3_DIR],,, [PHP_ADD_BUILD_DIR([$ext_builddir/$SHA3_DIR])])
4545
PHP_INSTALL_HEADERS([ext/hash], m4_normalize([

0 commit comments

Comments
 (0)