All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3, 1/3] package/sysrepo: link with libatomic when needed
@ 2019-10-31 13:15 Fabrice Fontaine
  2019-10-31 13:15 ` [Buildroot] [PATCH v3,2/3] package/sysrepo: needs NPTL Fabrice Fontaine
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Fabrice Fontaine @ 2019-10-31 13:15 UTC (permalink / raw)
  To: buildroot

On some architectures, atomic binutils are provided by the libatomic
library from gcc. Linking with libatomic is therefore necessary,
otherwise the build fails with:

/home/buildroot/autobuild/instance-2/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: libsysrepo.so.0.7.8: undefined reference to `__atomic_fetch_add_4'

This is often for example the case on sparcv8 32 bit.

Fixes:
 - http://autobuild.buildroot.org/results/d807f3dc922a61e099a66de3bc340c018a86e150

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/sysrepo/sysrepo.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/sysrepo/sysrepo.mk b/package/sysrepo/sysrepo.mk
index 31317d6236..72c380768d 100644
--- a/package/sysrepo/sysrepo.mk
+++ b/package/sysrepo/sysrepo.mk
@@ -29,6 +29,10 @@ SYSREPO_CONF_OPTS = \
 # build .. https://github.com/sysrepo/sysrepo/issues/947
 SYSREPO_CONF_OPTS += -DUSE_SR_MEM_MGMT=OFF
 
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+SYSREPO_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
+endif
+
 define SYSREPO_INSTALL_INIT_SYSV
 	$(INSTALL) -m 755 -D package/sysrepo/S50sysrepod \
 		$(TARGET_DIR)/etc/init.d/S50sysrepod
-- 
2.23.0

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

* [Buildroot] [PATCH v3,2/3] package/sysrepo: needs NPTL
  2019-10-31 13:15 [Buildroot] [PATCH v3, 1/3] package/sysrepo: link with libatomic when needed Fabrice Fontaine
@ 2019-10-31 13:15 ` Fabrice Fontaine
  2019-10-31 13:15 ` [Buildroot] [PATCH v3,3/3] package/sysrepo: fix debug build Fabrice Fontaine
  2019-10-31 21:34 ` [Buildroot] [PATCH v3, 1/3] package/sysrepo: link with libatomic when needed Thomas Petazzoni
  2 siblings, 0 replies; 5+ messages in thread
From: Fabrice Fontaine @ 2019-10-31 13:15 UTC (permalink / raw)
  To: buildroot

sysrepo needs pthread_rwlock_timedrdlock

Fixes:
 - http://autobuild.buildroot.org/results/f0e4368977f257d76aedff335af3068deafaf28f

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v1 -> v2 (after review of Baruch Siach):
 - Update package dependency and not only the comment

 package/sysrepo/Config.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/sysrepo/Config.in b/package/sysrepo/Config.in
index 3ad6040858..64050adfda 100644
--- a/package/sysrepo/Config.in
+++ b/package/sysrepo/Config.in
@@ -3,7 +3,7 @@ config BR2_PACKAGE_SYSREPO
 	depends on BR2_USE_MMU # libnetconf2
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_INSTALL_LIBSTDCPP
-	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_HAS_NPTL
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" # host-protobuf
 	select BR2_PACKAGE_LIBAVL
@@ -28,8 +28,8 @@ config BR2_PACKAGE_SYSREPO_EXAMPLES
 
 endif
 
-comment "sysrepo needs a toolchain w/ C++, threads, dynamic library, gcc >= 4.8"
+comment "sysrepo needs a toolchain w/ C++, NPTL, dynamic library, gcc >= 4.8"
 	depends on BR2_USE_MMU
 	depends on BR2_STATIC_LIBS || !BR2_INSTALL_LIBSTDCPP \
-		|| !BR2_TOOLCHAIN_HAS_THREADS
+		|| !BR2_TOOLCHAIN_HAS_NPTL
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
-- 
2.23.0

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

* [Buildroot] [PATCH v3,3/3] package/sysrepo: fix debug build
  2019-10-31 13:15 [Buildroot] [PATCH v3, 1/3] package/sysrepo: link with libatomic when needed Fabrice Fontaine
  2019-10-31 13:15 ` [Buildroot] [PATCH v3,2/3] package/sysrepo: needs NPTL Fabrice Fontaine
@ 2019-10-31 13:15 ` Fabrice Fontaine
  2019-10-31 14:39   ` Heiko Thiery
  2019-10-31 21:34 ` [Buildroot] [PATCH v3, 1/3] package/sysrepo: link with libatomic when needed Thomas Petazzoni
  2 siblings, 1 reply; 5+ messages in thread
From: Fabrice Fontaine @ 2019-10-31 13:15 UTC (permalink / raw)
  To: buildroot

Set IS_DEVELOPER_CONFIGURATION to OFF to avoid a build failure due to
files being installed in wrong directory

Fixes:
 - http://autobuild.buildroot.org/results/bcd9bdd3bc83c1f2ab0b24348d51de27d88649b4

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v2 -> v3:
 - fix typo in package's name

 package/sysrepo/sysrepo.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/sysrepo/sysrepo.mk b/package/sysrepo/sysrepo.mk
index 72c380768d..8676158a19 100644
--- a/package/sysrepo/sysrepo.mk
+++ b/package/sysrepo/sysrepo.mk
@@ -13,6 +13,7 @@ SYSREPO_DEPENDENCIES = libev libnetconf2 libavl libyang pcre protobuf-c host-sys
 HOST_SYSREPO_DEPENDENCIES = host-libev host-libnetconf2 host-libavl host-libyang host-pcre host-protobuf-c
 
 SYSREPO_CONF_OPTS = \
+	-DIS_DEVELOPER_CONFIGURATION=OFF \
 	-DGEN_PYTHON2_TESTS=OFF \
 	-DENABLE_TESTS=OFF \
 	-DGEN_CPP_BINDINGS=OFF \
-- 
2.23.0

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

* [Buildroot] [PATCH v3,3/3] package/sysrepo: fix debug build
  2019-10-31 13:15 ` [Buildroot] [PATCH v3,3/3] package/sysrepo: fix debug build Fabrice Fontaine
@ 2019-10-31 14:39   ` Heiko Thiery
  0 siblings, 0 replies; 5+ messages in thread
From: Heiko Thiery @ 2019-10-31 14:39 UTC (permalink / raw)
  To: buildroot

Am Do., 31. Okt. 2019 um 14:14 Uhr schrieb Fabrice Fontaine
<fontaine.fabrice@gmail.com>:
>
> Set IS_DEVELOPER_CONFIGURATION to OFF to avoid a build failure due to
> files being installed in wrong directory
>
> Fixes:
>  - http://autobuild.buildroot.org/results/bcd9bdd3bc83c1f2ab0b24348d51de27d88649b4
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Acked-by: Heiko Thiery <heiko.thiery@kontron.com>

I was struggling with that issue since some hours  ;-) thanks for that patch

> ---
> Changes v2 -> v3:
>  - fix typo in package's name
>
>  package/sysrepo/sysrepo.mk | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/package/sysrepo/sysrepo.mk b/package/sysrepo/sysrepo.mk
> index 72c380768d..8676158a19 100644
> --- a/package/sysrepo/sysrepo.mk
> +++ b/package/sysrepo/sysrepo.mk
> @@ -13,6 +13,7 @@ SYSREPO_DEPENDENCIES = libev libnetconf2 libavl libyang pcre protobuf-c host-sys
>  HOST_SYSREPO_DEPENDENCIES = host-libev host-libnetconf2 host-libavl host-libyang host-pcre host-protobuf-c
>
>  SYSREPO_CONF_OPTS = \
> +       -DIS_DEVELOPER_CONFIGURATION=OFF \
>         -DGEN_PYTHON2_TESTS=OFF \
>         -DENABLE_TESTS=OFF \
>         -DGEN_CPP_BINDINGS=OFF \
> --
> 2.23.0
>

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

* [Buildroot] [PATCH v3, 1/3] package/sysrepo: link with libatomic when needed
  2019-10-31 13:15 [Buildroot] [PATCH v3, 1/3] package/sysrepo: link with libatomic when needed Fabrice Fontaine
  2019-10-31 13:15 ` [Buildroot] [PATCH v3,2/3] package/sysrepo: needs NPTL Fabrice Fontaine
  2019-10-31 13:15 ` [Buildroot] [PATCH v3,3/3] package/sysrepo: fix debug build Fabrice Fontaine
@ 2019-10-31 21:34 ` Thomas Petazzoni
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2019-10-31 21:34 UTC (permalink / raw)
  To: buildroot

On Thu, 31 Oct 2019 14:15:05 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> On some architectures, atomic binutils are provided by the libatomic
> library from gcc. Linking with libatomic is therefore necessary,
> otherwise the build fails with:
> 
> /home/buildroot/autobuild/instance-2/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: libsysrepo.so.0.7.8: undefined reference to `__atomic_fetch_add_4'
> 
> This is often for example the case on sparcv8 32 bit.
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/d807f3dc922a61e099a66de3bc340c018a86e150
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/sysrepo/sysrepo.mk | 4 ++++
>  1 file changed, 4 insertions(+)

Series applied, thanks!

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

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

end of thread, other threads:[~2019-10-31 21:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31 13:15 [Buildroot] [PATCH v3, 1/3] package/sysrepo: link with libatomic when needed Fabrice Fontaine
2019-10-31 13:15 ` [Buildroot] [PATCH v3,2/3] package/sysrepo: needs NPTL Fabrice Fontaine
2019-10-31 13:15 ` [Buildroot] [PATCH v3,3/3] package/sysrepo: fix debug build Fabrice Fontaine
2019-10-31 14:39   ` Heiko Thiery
2019-10-31 21:34 ` [Buildroot] [PATCH v3, 1/3] package/sysrepo: link with libatomic when needed 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.