Commit 2be17766 authored by Leonardo Arena's avatar Leonardo Arena

main/php-memcache: fix relocation error. Fixes #5064

(cherry picked from commit 0aa4af1a)
parent bb64ed8d
......@@ -4,7 +4,7 @@ pkgname=php-memcache
_pkgreal=memcache
pkgver=3.0.8
_pkgver=${pkgver/_rc/RC}
pkgrel=3
pkgrel=4
pkgdesc="PHP extension memcache"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
......@@ -14,10 +14,22 @@ pecldepends="php-dev autoconf"
makedepends="$pecldepends zlib-dev"
install=""
subpackages=""
source="http://pecl.php.net/get/$_pkgreal-$_pkgver.tgz"
source="http://pecl.php.net/get/$_pkgreal-$_pkgver.tgz
memcache-faulty-inline.patch
"
_builddir="$srcdir"/$_pkgreal-$_pkgver
prepare() {
local i
cd "$_builddir"
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
}
build() {
cd "$_builddir"
phpize || return 1
......@@ -32,6 +44,9 @@ package() {
echo "extension=$_pkgreal.so" > "$pkgdir"/etc/php/conf.d/$_pkgreal.ini
}
md5sums="24505e9b263d2c77f8ae5e9b4725e7d1 memcache-3.0.8.tgz"
sha256sums="2cae5b423ffbfd33a259829849f6000d4db018debe3e29ecf3056f06642e8311 memcache-3.0.8.tgz"
sha512sums="916c6b21ab7c1021128626c0df35ef0b83cb76b6115fe7c45b003ca4f78ad9484bf3c998bc7ebdee19f84349ff1e56759f74e75aee5bc70b1de9a03c45a99bc3 memcache-3.0.8.tgz"
md5sums="24505e9b263d2c77f8ae5e9b4725e7d1 memcache-3.0.8.tgz
15c48766f52bb560bbf02b5015800ef4 memcache-faulty-inline.patch"
sha256sums="2cae5b423ffbfd33a259829849f6000d4db018debe3e29ecf3056f06642e8311 memcache-3.0.8.tgz
f0eaec9c3f9715ea1cf7e75f2ae4a7e3558751058a1dc16ebe206e18682faf67 memcache-faulty-inline.patch"
sha512sums="916c6b21ab7c1021128626c0df35ef0b83cb76b6115fe7c45b003ca4f78ad9484bf3c998bc7ebdee19f84349ff1e56759f74e75aee5bc70b1de9a03c45a99bc3 memcache-3.0.8.tgz
236e0ae64e64d6874d0f3aa9951b14e6125c88250f5ffa876fa5906473a94fa9d70e95df2e6b9cc52fadcc90b1a3655cbac9dea5300b828ca4f70ca0e6b69ce5 memcache-faulty-inline.patch"
diff -ru a/memcache_pool.c b/memcache_pool.c
--- a/memcache_pool.c
+++ b/memcache_pool.c
@@ -40,7 +40,7 @@
ZEND_DECLARE_MODULE_GLOBALS(memcache)
-inline void mmc_buffer_alloc(mmc_buffer_t *buffer, unsigned int size) /*
+void mmc_buffer_alloc(mmc_buffer_t *buffer, unsigned int size) /*
ensures space for an additional size bytes {{{ */
{
register size_t newlen;
@@ -48,7 +48,7 @@
}
/* }}} */
-inline void mmc_buffer_free(mmc_buffer_t *buffer) /* {{{ */
+void mmc_buffer_free(mmc_buffer_t *buffer) /* {{{ */
{
if (buffer->value.c != NULL) {
smart_str_free(&(buffer->value));
@@ -1677,7 +1677,7 @@
}
/* }}} */
-inline int mmc_prepare_key_ex(const char *key, unsigned int key_len, char *result, unsigned int *result_len) /* {{{ */
+int mmc_prepare_key_ex(const char *key, unsigned int key_len, char *result, unsigned int *result_len) /* {{{ */
{
unsigned int i;
if (key_len == 0) {
@@ -1695,7 +1695,7 @@
}
/* }}} */
-inline int mmc_prepare_key(zval *key, char *result, unsigned int *result_len) /* {{{ */
+int mmc_prepare_key(zval *key, char *result, unsigned int *result_len) /* {{{ */
{
if (Z_TYPE_P(key) == IS_STRING) {
return mmc_prepare_key_ex(Z_STRVAL_P(key), Z_STRLEN_P(key), result, result_len);
diff -ru a/memcache_pool.h b/memcache_pool.h
--- a/memcache_pool.h
+++ b/memcache_pool.h
@@ -129,8 +129,8 @@
#define mmc_buffer_release(b) memset((b), 0, sizeof(*(b)))
#define mmc_buffer_reset(b) (b)->value.len = (b)->idx = 0
-inline void mmc_buffer_alloc(mmc_buffer_t *, unsigned int);
-inline void mmc_buffer_free(mmc_buffer_t *);
+void mmc_buffer_alloc(mmc_buffer_t *, unsigned int);
+void mmc_buffer_free(mmc_buffer_t *);
/* stream handlers */
typedef struct mmc_stream mmc_stream_t;
@@ -385,8 +385,8 @@
double timeval_to_double(struct timeval tv);
struct timeval double_to_timeval(double sec);
-inline int mmc_prepare_key_ex(const char *, unsigned int, char *, unsigned int *);
-inline int mmc_prepare_key(zval *, char *, unsigned int *);
+int mmc_prepare_key_ex(const char *, unsigned int, char *, unsigned int *);
+int mmc_prepare_key(zval *, char *, unsigned int *);
#define mmc_str_left(h, n, hlen, nlen) ((hlen) >= (nlen) ? memcmp((h), (n), (nlen)) == 0 : 0)
diff -ru a/memcache_queue.c b/memcache_queue.c
--- a/memcache_queue.c
+++ b/memcache_queue.c
@@ -26,7 +26,7 @@
#include "php.h"
#include "memcache_queue.h"
-MMC_QUEUE_INLINE void mmc_queue_push(mmc_queue_t *queue, void *ptr) {
+void mmc_queue_push(mmc_queue_t *queue, void *ptr) {
if (mmc_queue_contains(queue, ptr)) return;
if (queue->len >= queue->alloc) {
@@ -53,7 +53,7 @@
queue->len++;
}
-MMC_QUEUE_INLINE void *mmc_queue_pop(mmc_queue_t *queue) {
+void *mmc_queue_pop(mmc_queue_t *queue) {
if (queue->len) {
void *ptr;
@@ -73,7 +73,7 @@
return NULL;
}
-MMC_QUEUE_INLINE int mmc_queue_contains(mmc_queue_t *queue, void *ptr) {
+int mmc_queue_contains(mmc_queue_t *queue, void *ptr) {
if (queue != NULL) {
int i;
@@ -87,14 +87,14 @@
return 0;
}
-MMC_QUEUE_INLINE void mmc_queue_free(mmc_queue_t *queue) {
+void mmc_queue_free(mmc_queue_t *queue) {
if (queue->items != NULL) {
efree(queue->items);
}
memset(queue, 0, sizeof(*queue));
}
-MMC_QUEUE_INLINE void mmc_queue_copy(mmc_queue_t *target, mmc_queue_t *source) {
+void mmc_queue_copy(mmc_queue_t *target, mmc_queue_t *source) {
if (target->alloc != source->alloc) {
target->alloc = source->alloc;
target->items = erealloc(target->items, sizeof(*target->items) * target->alloc);
@@ -106,7 +106,7 @@
target->len = source->len;
}
-MMC_QUEUE_INLINE void mmc_queue_remove(mmc_queue_t *queue, void *ptr) {
+void mmc_queue_remove(mmc_queue_t *queue, void *ptr) {
void *item;
mmc_queue_t original = *queue;
mmc_queue_release(queue);
diff -ru a/memcache_queue.h b/memcache_queue.h
--- a/memcache_queue.h
+++ b/memcache_queue.h
@@ -43,12 +43,12 @@
#define MMC_QUEUE_INLINE inline
#endif
-MMC_QUEUE_INLINE void mmc_queue_push(mmc_queue_t *, void *);
-MMC_QUEUE_INLINE void *mmc_queue_pop(mmc_queue_t *);
-MMC_QUEUE_INLINE int mmc_queue_contains(mmc_queue_t *, void *);
-MMC_QUEUE_INLINE void mmc_queue_free(mmc_queue_t *);
-MMC_QUEUE_INLINE void mmc_queue_copy(mmc_queue_t *, mmc_queue_t *);
-MMC_QUEUE_INLINE void mmc_queue_remove(mmc_queue_t *, void *);
+extern void mmc_queue_push(mmc_queue_t *, void *);
+extern void *mmc_queue_pop(mmc_queue_t *);
+extern int mmc_queue_contains(mmc_queue_t *, void *);
+extern void mmc_queue_free(mmc_queue_t *);
+extern void mmc_queue_copy(mmc_queue_t *, mmc_queue_t *);
+extern void mmc_queue_remove(mmc_queue_t *, void *);
#endif /*MEMCACHE_QUEUE_H_*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment