ID: 48911
Updated by: [email protected]
Reported By: thomas at koch dot ro
Status: Closed
Bug Type: Compile Failure
Operating System: Debian Lenny
PHP Version: 5.3.0
New Comment:
This patch breaks building php5embed on Windows.
On Windows, php5embed is built as a static library, and doesnt need
these functions to be marked as SAPI_API.
Can I suggest we instead use "EMBED_SAPI_API"?
-----
#ifndef PHP_WIN32
#define EMBED_SAPI_API SAPI_API
#else
#define EMBED_SAPI_API
#endif
BEGIN_EXTERN_C()
EMBED_SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC);
EMBED_SAPI_API void php_embed_shutdown(TSRMLS_D);
extern EMBED_SAPI_API sapi_module_struct php_embed_module;
END_EXTERN_C()
Previous Comments:
------------------------------------------------------------------------
[2009-07-28 21:07:52] [email protected]
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2009-07-28 21:07:43] [email protected]
Automatic comment from SVN on behalf of jani
Revision: http://svn.php.net/viewvc/?view=revision&revision=286468
Log: - Fixed bug #48911 (embed sapi misses SAPI_API)
------------------------------------------------------------------------
[2009-07-14 07:16:45] thomas at koch dot ro
Description:
------------
I try the most simple program that uses the embed sapi. Due to missing
SAPI_API macros the symbols
int php_embed_init(int argc, char **argv PTSRMLS_DC);
void php_embed_shutdown(TSRMLS_D);
extern sapi_module_struct php_embed_module;
get visibility hidden in the resulting libphp5.so.
Fix: put SAPI_API before these symbols in sapi/embed/php_embed.c.
(Also in php_embed.h ?)
Thanks to ScottMac for the hint on IRC!
Reproduce code:
---------------
#include <sapi/embed/php_embed.h>
int main(int argc, char *argv[])
{
PHP_EMBED_START_BLOCK(argc,argv)
PHP_EMBED_END_BLOCK()
return 0;
}
Expected result:
----------------
should compile without problems
Actual result:
--------------
gcc -c -I/usr/local/include/php/ -I/usr/local/include/php/main -
I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -Wall -g -o
worker.o worker.c
gcc -L/usr/local/lib -lphp5 -o worker worker.o
worker.o: In function `main':
/var/checkouts/gearman-php-worker/worker.c:5: undefined reference to
`php_embed_init'
/var/checkouts/gearman-php-worker/worker.c:6: undefined reference to
`php_embed_shutdown'
collect2: ld returned 1 exit status
make: *** [all] Error
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48911&edit=1