Bug#643622: leveldb: FTBFS: ./port/atomic_pointer.h:133:2: error: #error Please implement AtomicPointer for this platform.

2011-10-04 Thread Alessio Treglia
tags 643622 pending
thanks

Thank you so much for the patches, applied in git.

Cya!

-- 
Alessio Treglia          | www.alessiotreglia.com
Debian Developer         | ales...@debian.org
Ubuntu Core Developer    | quadris...@ubuntu.com
0FEC 59A5 E18E E04F 6D40 593B 45D4 8C7C DCFC 3FD0



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Processed: Re: Bug#643622: leveldb: FTBFS: ./port/atomic_pointer.h:133:2: error: #error Please implement AtomicPointer for this platform.

2011-10-04 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

 tags 643622 pending
Bug #643622 [src:leveldb] leveldb: FTBFS: ./port/atomic_pointer.h:133:2: error: 
#error Please implement AtomicPointer for this platform.
Added tag(s) pending.
 thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
643622: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=643622
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#643622: leveldb: FTBFS: ./port/atomic_pointer.h:133:2: error: #error Please implement AtomicPointer for this platform.

2011-10-04 Thread Nobuhiro Iwamatsu
Hi,

2011/10/5 Alessio Treglia ales...@debian.org:
 tags 643622 pending
 thanks

 Thank you so much for the patches, applied in git.


Thanks!
If no problem on buildd, please send these patches to upsrtream.

Best regards,
  Nobuhiro
-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#643622: leveldb: FTBFS: ./port/atomic_pointer.h:133:2: error: #error Please implement AtomicPointer for this platform.

2011-09-28 Thread Nobuhiro Iwamatsu
Source: leveldb
Version: 0+20110901.git7263023-2
Severity: serious
Justification: fails to build from source
Tags: patch

Hi,

leveldb FTBFS some architecture.
  https://buildd.debian.org/status/package.php?p=leveldbsuite=sid
  http://buildd.debian-ports.org/status/package.php?p=leveldbsuite=sid

Because leveldb does not support these architecture.

-
   dh_auto_configure -O--parallel
   dh_auto_build -O--parallel
make[1]: Entering directory
`/build/buildd-leveldb_0+20110901.git7263023-2-ia64-gm7mku/leveldb-0+20110901.git7263023'
g++ -g -O2 -c -I. -I./include -fno-builtin-memcmp
-DLEVELDB_PLATFORM_POSIX -pthread -DOS_LINUX -O2 -DNDEBUG
-fPIC db/builder.cc -o db/builder.o
g++ -g -O2 -c -I. -I./include -fno-builtin-memcmp
-DLEVELDB_PLATFORM_POSIX -pthread -DOS_LINUX -O2 -DNDEBUG
-fPIC db/c.cc -o db/c.o
In file included from ./port/port_posix.h:28:0,
 from ./port/port.h:14,
 from ./db/filename.h:14,
 from db/builder.cc:7:
./port/atomic_pointer.h:133:2: error: #error Please implement
AtomicPointer for this platform.
make[1]: *** [db/builder.o] Error 1
make[1]: *** Waiting for unfinished jobs
make[1]: Leaving directory
`/build/buildd-leveldb_0+20110901.git7263023-2-ia64-gm7mku/leveldb-0+20110901.git7263023'
dh_auto_build: make -j2 returned exit code 2
make: *** [build] Error 2
-

I created patch which revise this problem.
Could you check and apply these?
I tested on i386, amd64 and sh4.

Best regards,
 Nobuhiro

-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
From 9257ab3a17963b043dbc6e53a094e13a5b54488c Mon Sep 17 00:00:00 2001
From: Nobuhiro Iwamatsu iwama...@debian.org
Date: Wed, 28 Sep 2011 12:25:23 +0900
Subject: [PATCH 1/9] Add ReadMemoryBarrier and WriteMemoryBarrier methods

Some CPUs differ in the order of the memory barrier of read and write.
For other CPUs, this adds the memory barrier method the memory barrier
for read and write metohds.

Signed-off-by: Nobuhiro Iwamatsu iwama...@debian.org
---
 port/atomic_pointer.h |   31 +--
 1 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/port/atomic_pointer.h b/port/atomic_pointer.h
index c20b1bd..022a3a6 100644
--- a/port/atomic_pointer.h
+++ b/port/atomic_pointer.h
@@ -48,9 +48,17 @@ namespace port {
 // http://msdn.microsoft.com/en-us/library/ms684208(v=vs.85).aspx
 #define LEVELDB_HAVE_MEMORY_BARRIER
 
+#define ReadMemoryBarrier MemoryBarrier()
+#define WriteMemoryBarrier MemoryBarrier()
+
 // Gcc on x86
 #elif defined(ARCH_CPU_X86_FAMILY)  defined(__GNUC__)
-inline void MemoryBarrier() {
+inline void ReadMemoryBarrier() {
+  // See http://gcc.gnu.org/ml/gcc/2003-04/msg01180.html for a discussion on
+  // this idiom. Also see http://en.wikipedia.org/wiki/Memory_ordering.
+  __asm__ __volatile__( : : : memory);
+}
+inline void WriteMemoryBarrier() {
   // See http://gcc.gnu.org/ml/gcc/2003-04/msg01180.html for a discussion on
   // this idiom. Also see http://en.wikipedia.org/wiki/Memory_ordering.
   __asm__ __volatile__( : : : memory);
@@ -59,7 +67,12 @@ inline void MemoryBarrier() {
 
 // Sun Studio
 #elif defined(ARCH_CPU_X86_FAMILY)  defined(__SUNPRO_CC)
-inline void MemoryBarrier() {
+inline void ReadMemoryBarrier() {
+  // See http://gcc.gnu.org/ml/gcc/2003-04/msg01180.html for a discussion on
+  // this idiom. Also see http://en.wikipedia.org/wiki/Memory_ordering.
+  asm volatile( : : : memory);
+}
+inline void WriteMemoryBarrier() {
   // See http://gcc.gnu.org/ml/gcc/2003-04/msg01180.html for a discussion on
   // this idiom. Also see http://en.wikipedia.org/wiki/Memory_ordering.
   asm volatile( : : : memory);
@@ -68,7 +81,10 @@ inline void MemoryBarrier() {
 
 // Mac OS
 #elif defined(OS_MACOSX)
-inline void MemoryBarrier() {
+inline void ReadMemoryBarrier() {
+  OSMemoryBarrier();
+}
+inline void WriteMemoryBarrier() {
   OSMemoryBarrier();
 }
 #define LEVELDB_HAVE_MEMORY_BARRIER
@@ -78,7 +94,10 @@ inline void MemoryBarrier() {
 typedef void (*LinuxKernelMemoryBarrierFunc)(void);
 LinuxKernelMemoryBarrierFunc pLinuxKernelMemoryBarrier __attribute__((weak)) =
 (LinuxKernelMemoryBarrierFunc) 0x0fa0;
-inline void MemoryBarrier() {
+inline void ReadMemoryBarrier() {
+  pLinuxKernelMemoryBarrier();
+}
+inline void WriteMemoryBarrier() {
   pLinuxKernelMemoryBarrier();
 }
 #define LEVELDB_HAVE_MEMORY_BARRIER
@@ -97,11 +116,11 @@ class AtomicPointer {
   inline void NoBarrier_Store(void* v) { rep_ = v; }
   inline void* Acquire_Load() const {
 void* result = rep_;
-MemoryBarrier();
+ReadMemoryBarrier();
 return result;
   }
   inline void Release_Store(void* v) {
-MemoryBarrier();
+WriteMemoryBarrier();
 rep_ = v;
   }
 };
-- 
1.7.6.3

From 6805877f8913935071fb97c1b76e4f0ce992d8a6 Mon Sep 17 00:00:00 2001
From: Nobuhiro Iwamatsu iwama...@debian.org
Date: Wed, 28 Sep 2011 12:27:19 +0900
Subject: [PATCH 2/9] Add support PPC

Signed-off-by: Nobuhiro Iwamatsu iwama...@debian.org
---