All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2, 1/2] package/leveldb: disable benchmarks and tests
@ 2019-12-27  9:39 Fabrice Fontaine
  2019-12-27  9:40 ` [Buildroot] [PATCH v2, 2/2] package/leveldb: fix static build with -latomic Fabrice Fontaine
  2020-01-07 20:24 ` [Buildroot] [PATCH v2, 1/2] package/leveldb: disable benchmarks and tests Thomas Petazzoni
  0 siblings, 2 replies; 5+ messages in thread
From: Fabrice Fontaine @ 2019-12-27  9:39 UTC (permalink / raw)
  To: buildroot

Benchmarks and tests are enabled by default and benchmarks optionally
depend on sqlite

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v1 -> v2:
 - Remove trailing backslash

 package/leveldb/leveldb.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/leveldb/leveldb.mk b/package/leveldb/leveldb.mk
index 5baf56c718..5f5288be1c 100644
--- a/package/leveldb/leveldb.mk
+++ b/package/leveldb/leveldb.mk
@@ -10,6 +10,9 @@ LEVELDB_LICENSE = BSD-3-Clause
 LEVELDB_LICENSE_FILES = LICENSE
 LEVELDB_INSTALL_STAGING = YES
 LEVELDB_DEPENDENCIES = snappy
+LEVELDB_CONF_OPTS = \
+	-DLEVELDB_BUILD_BENCHMARKS=OFF \
+	-DLEVELDB_BUILD_TESTS=OFF
 
 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
 LEVELDB_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
-- 
2.24.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2, 2/2] package/leveldb: fix static build with -latomic
  2019-12-27  9:39 [Buildroot] [PATCH v2, 1/2] package/leveldb: disable benchmarks and tests Fabrice Fontaine
@ 2019-12-27  9:40 ` Fabrice Fontaine
  2020-01-07 20:27   ` Thomas Petazzoni
  2020-01-10 20:13   ` Peter Korsgaard
  2020-01-07 20:24 ` [Buildroot] [PATCH v2, 1/2] package/leveldb: disable benchmarks and tests Thomas Petazzoni
  1 sibling, 2 replies; 5+ messages in thread
From: Fabrice Fontaine @ 2019-12-27  9:40 UTC (permalink / raw)
  To: buildroot

Drop workaround and use an upstreamable solution to link with -latomic

Fixes:
 - http://autobuild.buildroot.org/results/01d5a50581ac9e9b46f40e6f9665f74897db5e6f

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...keLists.txt-check-for-atomic-library.patch | 49 +++++++++++++++++++
 package/leveldb/leveldb.mk                    |  4 --
 2 files changed, 49 insertions(+), 4 deletions(-)
 create mode 100644 package/leveldb/0003-CMakeLists.txt-check-for-atomic-library.patch

diff --git a/package/leveldb/0003-CMakeLists.txt-check-for-atomic-library.patch b/package/leveldb/0003-CMakeLists.txt-check-for-atomic-library.patch
new file mode 100644
index 0000000000..98609b6b93
--- /dev/null
+++ b/package/leveldb/0003-CMakeLists.txt-check-for-atomic-library.patch
@@ -0,0 +1,49 @@
+From 9e82eb57870ec7c01734b44ed4bb994362004df3 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Fri, 27 Dec 2019 10:20:53 +0100
+Subject: [PATCH] CMakeLists.txt: check for atomic library
+
+On some architectures, atomic binutils are provided by the libatomic
+library from gcc. Linking with libatomic is therefore necessary,
+otherwise the build fails with:
+
+[100%] Linking CXX executable leveldbutil
+/home/fabrice/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: libleveldb.a(env_posix.cc.o): in function `leveldb::(anonymous namespace)::Limiter::Acquire()':
+env_posix.cc:(.text+0x124): undefined reference to `__atomic_fetch_sub_4'
+
+This is often for example the case on sparcv8 32 bit.
+
+Fixes:
+ - http://autobuild.buildroot.org/results/01d5a50581ac9e9b46f40e6f9665f74897db5e6f
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/google/leveldb/pull/765]
+---
+ CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index be41ba4..9d6773f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -41,6 +41,7 @@ include(CheckIncludeFile)
+ check_include_file("unistd.h" HAVE_UNISTD_H)
+ 
+ include(CheckLibraryExists)
++check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_ATOMIC)
+ check_library_exists(crc32c crc32c_value "" HAVE_CRC32C)
+ check_library_exists(snappy snappy_compress "" HAVE_SNAPPY)
+ check_library_exists(tcmalloc malloc "" HAVE_TCMALLOC)
+@@ -270,6 +271,9 @@ if(HAVE_CLANG_THREAD_SAFETY)
+       -Werror -Wthread-safety)
+ endif(HAVE_CLANG_THREAD_SAFETY)
+ 
++if(HAVE_ATOMIC)
++  target_link_libraries(leveldb atomic)
++endif(HAVE_ATOMIC)
+ if(HAVE_CRC32C)
+   target_link_libraries(leveldb crc32c)
+ endif(HAVE_CRC32C)
+-- 
+2.24.0
+
diff --git a/package/leveldb/leveldb.mk b/package/leveldb/leveldb.mk
index 5f5288be1c..cf3c096f5d 100644
--- a/package/leveldb/leveldb.mk
+++ b/package/leveldb/leveldb.mk
@@ -14,8 +14,4 @@ LEVELDB_CONF_OPTS = \
 	-DLEVELDB_BUILD_BENCHMARKS=OFF \
 	-DLEVELDB_BUILD_TESTS=OFF
 
-ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
-LEVELDB_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
-endif
-
 $(eval $(cmake-package))
-- 
2.24.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2, 1/2] package/leveldb: disable benchmarks and tests
  2019-12-27  9:39 [Buildroot] [PATCH v2, 1/2] package/leveldb: disable benchmarks and tests Fabrice Fontaine
  2019-12-27  9:40 ` [Buildroot] [PATCH v2, 2/2] package/leveldb: fix static build with -latomic Fabrice Fontaine
@ 2020-01-07 20:24 ` Thomas Petazzoni
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2020-01-07 20:24 UTC (permalink / raw)
  To: buildroot

On Fri, 27 Dec 2019 10:39:59 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Benchmarks and tests are enabled by default and benchmarks optionally
> depend on sqlite
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> Changes v1 -> v2:
>  - Remove trailing backslash

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2, 2/2] package/leveldb: fix static build with -latomic
  2019-12-27  9:40 ` [Buildroot] [PATCH v2, 2/2] package/leveldb: fix static build with -latomic Fabrice Fontaine
@ 2020-01-07 20:27   ` Thomas Petazzoni
  2020-01-10 20:13   ` Peter Korsgaard
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2020-01-07 20:27 UTC (permalink / raw)
  To: buildroot

On Fri, 27 Dec 2019 10:40:00 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Drop workaround and use an upstreamable solution to link with -latomic
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/01d5a50581ac9e9b46f40e6f9665f74897db5e6f
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...keLists.txt-check-for-atomic-library.patch | 49 +++++++++++++++++++
>  package/leveldb/leveldb.mk                    |  4 --
>  2 files changed, 49 insertions(+), 4 deletions(-)
>  create mode 100644 package/leveldb/0003-CMakeLists.txt-check-for-atomic-library.patch

Applied to master, thanks. Seems like a good approach that we should
probably use on other CMake-based packages.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2, 2/2] package/leveldb: fix static build with -latomic
  2019-12-27  9:40 ` [Buildroot] [PATCH v2, 2/2] package/leveldb: fix static build with -latomic Fabrice Fontaine
  2020-01-07 20:27   ` Thomas Petazzoni
@ 2020-01-10 20:13   ` Peter Korsgaard
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2020-01-10 20:13 UTC (permalink / raw)
  To: buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Drop workaround and use an upstreamable solution to link with -latomic
 > Fixes:
 >  - http://autobuild.buildroot.org/results/01d5a50581ac9e9b46f40e6f9665f74897db5e6f

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2019.11.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-01-10 20:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-27  9:39 [Buildroot] [PATCH v2, 1/2] package/leveldb: disable benchmarks and tests Fabrice Fontaine
2019-12-27  9:40 ` [Buildroot] [PATCH v2, 2/2] package/leveldb: fix static build with -latomic Fabrice Fontaine
2020-01-07 20:27   ` Thomas Petazzoni
2020-01-10 20:13   ` Peter Korsgaard
2020-01-07 20:24 ` [Buildroot] [PATCH v2, 1/2] package/leveldb: disable benchmarks and tests Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.