- Removed the experimental RPL (master/slave) functions from mysqli. (Andrey)
+- Improved PHP binary size and startup speed with GCC4 visibility control.
+ (Nuno)
- Improved engine stack implementation for better performance and stability.
(Dmitry)
- Improved php.ini handling: (Jani)
#ifdef TSRM_WIN32
# ifdef TSRM_EXPORTS
-# define TSRM_API __declspec(dllexport)
+# define TSRM_API __declspec(dllexport)
# else
-# define TSRM_API __declspec(dllimport)
+# define TSRM_API __declspec(dllimport)
# endif
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define TSRM_API __attribute__ ((visibility("default")))
#else
# define TSRM_API
#endif
#endif
#ifdef TSRM_WIN32
-# ifdef CWD_EXPORTS
-# define CWD_API __declspec(dllexport)
-# else
-# define CWD_API __declspec(dllimport)
-# endif
+# ifdef CWD_EXPORTS
+# define CWD_API __declspec(dllexport)
+# else
+# define CWD_API __declspec(dllimport)
+# endif
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define CWD_API __attribute__ ((visibility("default")))
#else
-#define CWD_API
+# define CWD_API
#endif
#ifdef TSRM_WIN32
/* $Id$ */
-#define ZEND_API
-#define ZEND_DLEXPORT
+#if defined(__GNUC__) && __GNUC__ >= 4
+# define ZEND_API __attribute__ ((visibility("default")))
+# define ZEND_DLEXPORT __attribute__ ((visibility("default")))
+#else
+# define ZEND_API
+# define ZEND_DLEXPORT
+#endif
+
#define ZEND_DLIMPORT
@TOP@
;;
esac
+dnl activate some gcc specific optimizations for gcc >= 4
+if test "$GCC" = "yes"; then
+ GCC_MAJOR_VERSION=`$CC --version | $SED -n '1s/[[^0-9]]*\([[0-9]]\+\)\.[[0-9]]\+\..*/\1/;1p'`
+ if test $GCC_MAJOR_VERSION -ge 4; then
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ fi
+fi
+
case $host_alias in
*solaris*)
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
#endif
#ifdef PHP_WIN32
-# ifdef PHP_BZ2_EXPORTS
-# define PHP_BZ2_API __declspec(dllexport)
-# elif defined(COMPILE_DL_BZ2)
-# define PHP_BZ2_API __declspec(dllimport)
-# else
-# define PHP_BZ2_API /* nothing special */
-# endif
+# ifdef PHP_BZ2_EXPORTS
+# define PHP_BZ2_API __declspec(dllexport)
+# elif defined(COMPILE_DL_BZ2)
+# define PHP_BZ2_API __declspec(dllimport)
+# else
+# define PHP_BZ2_API /* nothing special */
+# endif
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define PHP_BZ2_API __attribute__ ((visibility("default")))
#else
-# define PHP_BZ2_API
+# define PHP_BZ2_API
#endif
PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
} dom_object;
#ifdef PHP_WIN32
-#ifdef PHPAPI
-#undef PHPAPI
-#endif
-#ifdef DOM_EXPORTS
-#define PHPAPI __declspec(dllexport)
-#else
-#define PHPAPI __declspec(dllimport)
-#endif /* DOM_EXPORTS */
+# ifdef PHPAPI
+# undef PHPAPI
+# endif
+# ifdef DOM_EXPORTS
+# define PHPAPI __declspec(dllexport)
+# else
+# define PHPAPI __declspec(dllimport)
+# endif /* DOM_EXPORTS */
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# ifdef PHPAPI
+# undef PHPAPI
+# endif
+# define PHPAPI __attribute__ ((visibility("default")))
#endif /* PHP_WIN32 */
#define PHP_DOM_EXPORT PHPAPI
#define PHP_GDIMG_TYPE_GD2PART 10
#ifdef PHP_WIN32
-#define PHP_GD_API __declspec(dllexport)
+# define PHP_GD_API __declspec(dllexport)
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define PHP_GD_API __attribute__ ((visibility("default")))
#else
-#define PHP_GD_API
+# define PHP_GD_API
#endif
PHPAPI extern const char php_sig_gif[3];
#define phpext_hash_ptr &hash_module_entry
#ifdef PHP_WIN32
-#define PHP_HASH_API __declspec(dllexport)
+# define PHP_HASH_API __declspec(dllexport)
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define PHP_HASH_API __attribute__ ((visibility("default")))
#else
-#define PHP_HASH_API
+# define PHP_HASH_API
#endif
#ifdef ZTS
#define PHP_ICONV_H
#ifdef PHP_WIN32
-#ifdef PHP_ICONV_EXPORTS
-#define PHP_ICONV_API __declspec(dllexport)
+# ifdef PHP_ICONV_EXPORTS
+# define PHP_ICONV_API __declspec(dllexport)
+# else
+# define PHP_ICONV_API __declspec(dllimport)
+# endif
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define PHP_ICONV_API __attribute__ ((visibility("default")))
#else
-#define PHP_ICONV_API __declspec(dllimport)
-#endif
-#else
-#define PHP_ICONV_API
+# define PHP_ICONV_API
#endif
#ifdef PHP_ATOM_INC
#define libxml_module_ptr &libxml_module_entry
#ifdef PHP_WIN32
-#define PHP_LIBXML_API __declspec(dllexport)
+# define PHP_LIBXML_API __declspec(dllexport)
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define PHP_LIBXML_API __attribute__ ((visibility("default")))
#else
-#define PHP_LIBXML_API
+# define PHP_LIBXML_API
#endif
#include "ext/standard/php_smart_str.h"
#endif
#ifdef PHP_WIN32
-# undef MBSTRING_API
-# ifdef MBSTRING_EXPORTS
-# define MBSTRING_API __declspec(dllexport)
-# elif defined(COMPILE_DL_MBSTRING)
-# define MBSTRING_API __declspec(dllimport)
-# else
-# define MBSTRING_API /* nothing special */
-# endif
+# undef MBSTRING_API
+# ifdef MBSTRING_EXPORTS
+# define MBSTRING_API __declspec(dllexport)
+# elif defined(COMPILE_DL_MBSTRING)
+# define MBSTRING_API __declspec(dllimport)
+# else
+# define MBSTRING_API /* nothing special */
+# endif
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# undef MBSTRING_API
+# define MBSTRING_API __attribute__ ((visibility("default")))
#else
-# undef MBSTRING_API
-# define MBSTRING_API /* nothing special */
+# undef MBSTRING_API
+# define MBSTRING_API /* nothing special */
#endif
#define L64(x) x##i64
typedef __int64 my_longlong;
#else
-#define PHP_MYSQLI_API
+# if defined(__GNUC__) && __GNUC__ >= 4
+# define PHP_MYSQLI_API __attribute__ ((visibility("default")))
+# else
+# define PHP_MYSQLI_API
+# endif
#define MYSQLI_LLU_SPEC "%llu"
#define MYSQLI_LL_SPEC "%lld"
#define L64(x) x##LL
#define phpext_pdo_ptr &pdo_module_entry
#ifdef PHP_WIN32
-# if defined(PDO_EXPORTS) || (!defined(COMPILE_DL_PDO))
-# define PDO_API __declspec(dllexport)
-# elif defined(COMPILE_DL_PDO)
-# define PDO_API __declspec(dllimport)
-# else
-# define PDO_API /* nothing special */
-# endif
+# if defined(PDO_EXPORTS) || (!defined(COMPILE_DL_PDO))
+# define PDO_API __declspec(dllexport)
+# elif defined(COMPILE_DL_PDO)
+# define PDO_API __declspec(dllimport)
+# else
+# define PDO_API /* nothing special */
+# endif
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define PDO_API __attribute__ ((visibility("default")))
#else
-# define PDO_API /* nothing special */
+# define PDO_API /* nothing special */
#endif
#ifdef ZTS
#endif
#else
#include <libpq/libpq-fs.h>
-#define PHP_PGSQL_API /* nothing special */
+# if defined(__GNUC__) && __GNUC__ >= 4
+# define PHP_PGSQL_API __attribute__ ((visibility("default")))
+# else
+# define PHP_PGSQL_API
+# endif
#endif
#ifdef HAVE_PG_CONFIG_H
#define phpext_extname_ptr &extname_module_entry
#ifdef PHP_WIN32
-#define PHP_EXTNAME_API __declspec(dllexport)
+# define PHP_EXTNAME_API __declspec(dllexport)
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define PHP_EXTNAME_API __attribute__ ((visibility("default")))
#else
-#define PHP_EXTNAME_API
+# define PHP_EXTNAME_API
#endif
#ifdef ZTS
#define phpext_spl_ptr &spl_module_entry
#ifdef PHP_WIN32
-# ifdef SPL_EXPORTS
-# define SPL_API __declspec(dllexport)
-# elif defined(COMPILE_DL_SPL)
-# define SPL_API __declspec(dllimport)
-# else
-# define SPL_API /* nothing */
-# endif
+# ifdef SPL_EXPORTS
+# define SPL_API __declspec(dllexport)
+# elif defined(COMPILE_DL_SPL)
+# define SPL_API __declspec(dllimport)
+# else
+# define SPL_API /* nothing */
+# endif
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define SPL_API __attribute__ ((visibility("default")))
#else
-# define SPL_API
+# define SPL_API
#endif
#if defined(PHP_WIN32) && !defined(COMPILE_DL_SPL)
/* #defines that rename all zip_ functions and structs */
#include "zip_alias.h"
#ifdef PHP_WIN32
-#include "zip_win32.h"
-# ifdef PHP_ZIP_EXPORTS
-# define PHPZIPAPI __declspec(dllexport)
-# else
-# define PHPZIPAPI
-# endif
+# include "zip_win32.h"
+# ifdef PHP_ZIP_EXPORTS
+# define PHPZIPAPI __declspec(dllexport)
+# else
+# define PHPZIPAPI
+# endif
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define PHPZIPAPI __attribute__ ((visibility("default")))
#else
-#define PHPZIPAPI
+# define PHPZIPAPI
#endif
BEGIN_EXTERN_C()
#include <sys/types.h>
#ifdef PHP_WIN32
# ifdef SAPI_EXPORTS
-# define SAPI_API __declspec(dllexport)
+# define SAPI_API __declspec(dllexport)
# else
-# define SAPI_API __declspec(dllimport)
+# define SAPI_API __declspec(dllimport)
# endif
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define SAPI_API __attribute__ ((visibility("default")))
#else
-#define SAPI_API
+# define SAPI_API
#endif
#undef shutdown
#define PHP_DEBUG ZEND_DEBUG
#ifdef PHP_WIN32
-#include "tsrm_win32.h"
-#include "win95nt.h"
+# include "tsrm_win32.h"
+# include "win95nt.h"
# ifdef PHP_EXPORTS
-# define PHPAPI __declspec(dllexport)
+# define PHPAPI __declspec(dllexport)
# else
-# define PHPAPI __declspec(dllimport)
+# define PHPAPI __declspec(dllimport)
# endif
-#define PHP_DIR_SEPARATOR '\\'
-#define PHP_EOL "\r\n"
+# define PHP_DIR_SEPARATOR '\\'
+# define PHP_EOL "\r\n"
#else
-#define PHPAPI
+# if defined(__GNUC__) && __GNUC__ >= 4
+# define PHPAPI __attribute__ ((visibility("default")))
+# else
+# define PHPAPI
+# endif
+
#define THREAD_LS
#define PHP_DIR_SEPARATOR '/'
#if defined(__MacOSX__)
#define AP(v) (php_apache_info.v)
#endif
+/* fix for gcc4 visibility patch */
+#ifndef PHP_WIN32
+# undef MODULE_VAR_EXPORT
+# define MODULE_VAR_EXPORT PHPAPI
+#endif
+
#endif /* MOD_PHP5_H */
/*
#define APR_ARRAY_FOREACH_CLOSE() }}
+/* fix for gcc4 visibility patch */
+#ifndef PHP_WIN32
+# undef AP_MODULE_DECLARE_DATA
+# define AP_MODULE_DECLARE_DATA PHPAPI
+#endif
+
#endif /* PHP_APACHE_H */
#define AP2(v) (php_apache2_info.v)
#endif
+/* fix for gcc4 visibility patch */
+#ifndef PHP_WIN32
+# undef AP_MODULE_DECLARE_DATA
+# define AP_MODULE_DECLARE_DATA PHPAPI
+#endif
#endif /* PHP_APACHE_H */
#define AP_LOGGING 10
#define AP_CLEANUP 11
+
+/* fix for gcc4 visibility patch */
+#ifndef PHP_WIN32
+# undef MODULE_VAR_EXPORT
+# define MODULE_VAR_EXPORT PHPAPI
+#endif
+
#endif /* MOD_PHP5_H */
/*
# define MODULE_API __declspec(dllimport)
# endif
#else
+# if defined(__GNUC__) && __GNUC__ >= 4
+# define MODULE_API __attribute__ ((visibility("default")))
+# else
+# define MODULE_API
+# endif
# define far
-# define MODULE_API
typedef int BOOL;
typedef void far *LPVOID;