[php-maint] Please include patch fixing m68k FTBFS

Thorsten Glaser tg at mirbsd.de
Sun May 6 18:49:52 UTC 2012


Hi,

applied is a patch against your git packaging-repository
including a fix for an FTBFS on m68k due to php-fpm source
missing atomics for that platform. Please apply with your
next upload. I’ve submitted it upstream as well.

Thanks,
//mirabilos
-- 
  “Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool.”
						-- Edward Burr
-------------- next part --------------
From 09b0aea843a6e23c274c7a0ad013037cdcb8e7d3 Mon Sep 17 00:00:00 2001
From: Thorsten Glaser <tg at mirbsd.org>
Date: Sun, 6 May 2012 18:43:59 +0000
Subject: [PATCH] Add support for Linux/m68k atomics needed by the FPM SAPI


Signed-off-by: Thorsten Glaser <tg at mirbsd.org>
---
 debian/changelog                  |    6 ++++
 debian/patches/php-fpm-m68k.patch |   57 +++++++++++++++++++++++++++++++++++++
 debian/patches/series             |    1 +
 3 files changed, 64 insertions(+)
 create mode 100644 debian/patches/php-fpm-m68k.patch

diff --git a/debian/changelog b/debian/changelog
index 724ab76..619649e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+php5 (5.4.2-1+m68k.1) unreleased; urgency=low
+
+  * Add support for Linux/m68k atomics needed by the FPM SAPI
+
+ -- Thorsten Glaser <tg at mirbsd.de>  Sun, 06 May 2012 18:42:57 +0000
+
 php5 (5.4.2-1) unstable; urgency=low
 
   * Imported Upstream version 5.4.2
diff --git a/debian/patches/php-fpm-m68k.patch b/debian/patches/php-fpm-m68k.patch
new file mode 100644
index 0000000..c175bb4
--- /dev/null
+++ b/debian/patches/php-fpm-m68k.patch
@@ -0,0 +1,57 @@
+Description: add Linux/m68k atomic code
+Origin: libgcc 4.7
+Bug: https://bugs.php.net/bug.php?id=60925
+Author: Thorsten Glaser <tg at debian.org>
+
+Index: php5-5.4.2/sapi/fpm/fpm/fpm_atomic.h
+===================================================================
+--- php5-5.4.2.orig/sapi/fpm/fpm/fpm_atomic.h	2012-03-11 20:06:12.000000000 +0000
++++ php5-5.4.2/sapi/fpm/fpm/fpm_atomic.h	2012-05-06 18:42:08.000000000 +0000
+@@ -5,6 +5,12 @@
+ #ifndef FPM_ATOMIC_H
+ #define FPM_ATOMIC_H 1
+ 
++#if defined(__m68k__)
++#define _GNU_SOURCE
++#include <unistd.h>
++#include <sys/syscall.h>
++#endif
++
+ #if HAVE_INTTYPES_H
+ # include <inttypes.h>
+ #else
+@@ -137,6 +143,34 @@
+ #error Sparc v8 and predecessors are not and will not be supported (see bug report 53310)
+ #endif /* #if (__sparcv9 || __sparcv9__) */
+ 
++#elif defined(__m68k__) && defined(__linux__)
++
++typedef signed int atomic_int_t __attribute__((__aligned__(4)));
++typedef unsigned int atomic_uint_t __attribute__((__aligned__(4)));
++typedef volatile unsigned int atomic_t __attribute__((__aligned__(4)));
++
++#ifndef SYS_atomic_cmpxchg_32
++#define SYS_atomic_cmpxchg_32 335
++#endif
++
++static inline atomic_uint_t atomic_cas_32(atomic_t *lock, atomic_uint_t old, atomic_uint_t new) /* {{{ */
++{
++	register atomic_t *a0 asm("a0") = lock;
++	register atomic_uint_t d2 asm("d2") = old;
++	register atomic_uint_t d1 asm("d1") = new;
++	register atomic_uint_t d0 asm("d0") = SYS_atomic_cmpxchg_32;
++
++	asm volatile("trap #0" : "+r" (d0), "+r" (d1), "+r" (a0) : "r" (d2) : "memory", "a1");
++	return (d0);
++}
++/* }}} */
++
++static inline atomic_uint_t atomic_cmp_set(atomic_t *lock, atomic_uint_t old, atomic_uint_t set) /* {{{ */
++{
++	return (atomic_cas_32(lock, old, set) == old);
++}
++/* }}} */
++
+ #else
+ 
+ #error Unsupported processor. Please open a bug report (bugs.php.net).
diff --git a/debian/patches/series b/debian/patches/series
index 08a2d96..2cccc5d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -56,3 +56,4 @@ php-5.3.3-macropen.patch
 php-5.2.4-norpath.patch
 php-fpm-listen-on-unix-socket.patch
 0001-Add-information-about-which-INI-file-is-which-inside.patch
+php-fpm-m68k.patch
-- 
1.7.10



More information about the pkg-php-maint mailing list