Created attachment 206869 [details] patch The script for detecting what atomic barrier is available doesn't run because of ports' tree patches from the framework. Add statically -DLEVELDB_CSTDATOMIC_PRESENT to CFLAGS when using gcc and change include cstdatomic (removed in gcc 4.5) to atomic.
Why not just include <atomic> unconditionally? --- port/atomic_pointer.h.orig 2011-11-14 02:54:56 UTC +++ port/atomic_pointer.h @@ -20,6 +20,7 @@ #define PORT_ATOMIC_POINTER_H_ #include <stdint.h> +#include <atomic> #ifdef LEVELDB_CSTDATOMIC_PRESENT #include <cstdatomic> #endif
This fails to build for me: In file included from ./port/port_posix.h:28, from port/port_posix.cc:5: ./port/atomic_pointer.h:24:10: fatal error: cstdatomic: No such file or directory #include <cstdatomic>
(In reply to Mark Linimon from comment #2) I forgot to say not to add CFLAGS hack to Makefile. That would keep LEVELDB_CSTDATOMIC_PRESENT undefined and "#include <cstdatomic>" skipped for gcc on powerpc64.
(In reply to Sunpoet Po-Chuan Hsieh from comment #3) The complete patch: https://people.FreeBSD.org/~sunpoet/patch/databases-p5-Tie-LevelDB.txt @Mark and @Piotr, does it work for you?
(In reply to Sunpoet Po-Chuan Hsieh from comment #4) No. The reason is that there's a ifdef block starting at line 90, which defines AtomicPointer according to how LEVELDB_HAVE_MEMORY_BARRIER is defined. Build with your patch fails with: In file included from ./port/port_posix.h:28, from port/port_posix.cc:5: ./port/atomic_pointer.h:134:2: error: #error Please implement AtomicPointer for this platform. 134 | #error Please implement AtomicPointer for this platform. | ^~~~~
(In reply to Piotr Kubaj from comment #5) OK, I missed the #elif defined(LEVELDB_CSTDATOMIC_PRESENT) on line 110 which defines class AtomicPointer (from line 111 to 129). I'll commit your patch. Thanks!
A commit references this bug: Author: sunpoet Date: Tue Sep 3 19:12:52 UTC 2019 New revision: 511027 URL: https://svnweb.freebsd.org/changeset/ports/511027 Log: Fix build on powerpc64 PR: 240088 Submitted by: pkubaj Changes: head/databases/p5-Tie-LevelDB/Makefile head/databases/p5-Tie-LevelDB/files/ head/databases/p5-Tie-LevelDB/files/patch-port-atomic_pointer.h
Committed. Thanks!