All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] cutelyst: link with libatomic when needed
@ 2018-08-27 16:41 Fabrice Fontaine
  2018-08-27 22:00 ` Peter Korsgaard
  2018-08-28  9:58 ` Thomas Petazzoni
  0 siblings, 2 replies; 6+ messages in thread
From: Fabrice Fontaine @ 2018-08-27 16:41 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:

sparc-buildroot-linux-uclibc/sysroot/lib/libatomic.so.1: error adding symbols: DSO missing from command line

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

Fixes:
 - http://autobuild.buildroot.net/results/9e307ab9c7067b26d7b33a572204394808e25772

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

diff --git a/package/cutelyst/cutelyst.mk b/package/cutelyst/cutelyst.mk
index e8695a7b3a..1f1a5249be 100644
--- a/package/cutelyst/cutelyst.mk
+++ b/package/cutelyst/cutelyst.mk
@@ -16,6 +16,10 @@ CUTELYST_CONF_OPTS += \
 	-DPLUGIN_CSRFPROTECTION=ON \
 	-DPLUGIN_VIEW_GRANTLEE=OFF
 
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+CUTELYST_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
+endif
+
 ifeq ($(BR2_PACKAGE_LIBPWQUALITY),y)
 CUTELYST_CONF_OPTS += -DPLUGIN_VALIDATOR_PWQUALITY=ON
 CUTELYST_DEPENDENCIES += libpwquality
-- 
2.14.1

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

* [Buildroot] [PATCH 1/1] cutelyst: link with libatomic when needed
  2018-08-27 16:41 [Buildroot] [PATCH 1/1] cutelyst: link with libatomic when needed Fabrice Fontaine
@ 2018-08-27 22:00 ` Peter Korsgaard
  2018-08-28  6:52   ` Fabrice Fontaine
  2018-08-28  9:58 ` Thomas Petazzoni
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Korsgaard @ 2018-08-27 22:00 UTC (permalink / raw)
  To: buildroot

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

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

 > sparc-buildroot-linux-uclibc/sysroot/lib/libatomic.so.1: error adding symbols: DSO missing from command line

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

 > Fixes:
 >  - http://autobuild.buildroot.net/results/9e307ab9c7067b26d7b33a572204394808e25772

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

 > diff --git a/package/cutelyst/cutelyst.mk b/package/cutelyst/cutelyst.mk
 > index e8695a7b3a..1f1a5249be 100644
 > --- a/package/cutelyst/cutelyst.mk
 > +++ b/package/cutelyst/cutelyst.mk
 > @@ -16,6 +16,10 @@ CUTELYST_CONF_OPTS += \
 >  	-DPLUGIN_CSRFPROTECTION=ON \
 >  	-DPLUGIN_VIEW_GRANTLEE=OFF
 
 > +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
 > +CUTELYST_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic

I know we are doing this elsewhere as well, but doesn't this override
TARGET_LDFLAGS then?

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH 1/1] cutelyst: link with libatomic when needed
  2018-08-27 22:00 ` Peter Korsgaard
@ 2018-08-28  6:52   ` Fabrice Fontaine
  0 siblings, 0 replies; 6+ messages in thread
From: Fabrice Fontaine @ 2018-08-28  6:52 UTC (permalink / raw)
  To: buildroot

Dear Peter,

Le mar. 28 ao?t 2018 ? 00:00, Peter Korsgaard <peter@korsgaard.com> a
?crit :

> >>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:
>
>  > On some architectures, atomic binutils are provided by the libatomic
>  > library from gcc. Linking with libatomic is therefore necessary,
>  > otherwise the build fails with:
>
>  > sparc-buildroot-linux-uclibc/sysroot/lib/libatomic.so.1: error adding
> symbols: DSO missing from command line
>
>  > This is often for example the case on sparcv8 32 bit.
>
>  > Fixes:
>  >  -
> http://autobuild.buildroot.net/results/9e307ab9c7067b26d7b33a572204394808e25772
>
>  > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
>  > ---
>  >  package/cutelyst/cutelyst.mk | 4 ++++
>  >  1 file changed, 4 insertions(+)
>
>  > diff --git a/package/cutelyst/cutelyst.mk b/package/cutelyst/
> cutelyst.mk
>  > index e8695a7b3a..1f1a5249be 100644
>  > --- a/package/cutelyst/cutelyst.mk
>  > +++ b/package/cutelyst/cutelyst.mk
>  > @@ -16,6 +16,10 @@ CUTELYST_CONF_OPTS += \
>  >      -DPLUGIN_CSRFPROTECTION=ON \
>  >      -DPLUGIN_VIEW_GRANTLEE=OFF
>
>  > +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
>  > +CUTELYST_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
>
> I know we are doing this elsewhere as well, but doesn't this override
> TARGET_LDFLAGS then?
>
Indeed, we're already doing this for gnuradio but you're right, I will
update my patch to use CMAKE_CXX_FLAGS.

>
> --
> Bye, Peter Korsgaard
>

Best Regards,

Fabrice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180828/1d9ec552/attachment.html>

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

* [Buildroot] [PATCH 1/1] cutelyst: link with libatomic when needed
  2018-08-27 16:41 [Buildroot] [PATCH 1/1] cutelyst: link with libatomic when needed Fabrice Fontaine
  2018-08-27 22:00 ` Peter Korsgaard
@ 2018-08-28  9:58 ` Thomas Petazzoni
  2018-08-28 11:31   ` Fabrice Fontaine
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2018-08-28  9:58 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 27 Aug 2018 18:41:02 +0200, Fabrice Fontaine 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:
> 
> sparc-buildroot-linux-uclibc/sysroot/lib/libatomic.so.1: error adding symbols: DSO missing from command line
> 
> This is often for example the case on sparcv8 32 bit.
> 
> Fixes:
>  - http://autobuild.buildroot.net/results/9e307ab9c7067b26d7b33a572204394808e25772
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

If this package unconditionally needs atomic intrinsics, then it also
needs to depends on BR2_TOOLCHAIN_HAS_ATOMIC. Indeed, libatomic is not
available in gcc < 4.8.

Best regards,

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

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

* [Buildroot] [PATCH 1/1] cutelyst: link with libatomic when needed
  2018-08-28  9:58 ` Thomas Petazzoni
@ 2018-08-28 11:31   ` Fabrice Fontaine
  2018-08-28 13:24     ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Fabrice Fontaine @ 2018-08-28 11:31 UTC (permalink / raw)
  To: buildroot

Dear Thomas,

Le mar. 28 ao?t 2018 ? 11:59, Thomas Petazzoni <thomas.petazzoni@bootlin.com>
a ?crit :

> Hello,
>
> On Mon, 27 Aug 2018 18:41:02 +0200, Fabrice Fontaine 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:
> >
> > sparc-buildroot-linux-uclibc/sysroot/lib/libatomic.so.1: error adding
> symbols: DSO missing from command line
> >
> > This is often for example the case on sparcv8 32 bit.
> >
> > Fixes:
> >  -
> http://autobuild.buildroot.net/results/9e307ab9c7067b26d7b33a572204394808e25772
> >
> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
>
> If this package unconditionally needs atomic intrinsics, then it also
> needs to depends on BR2_TOOLCHAIN_HAS_ATOMIC. Indeed, libatomic is not
> available in gcc < 4.8.
>
cutelyst does not directly depends on atomic, this dependency is linked to
Qt 5.8.
Here is an extrat of qt5base.mk:
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC)$(BR2_PACKAGE_QT5_VERSION_LATEST),yy)
# Qt 5.8 needs atomics, which on various architectures are in -latomic
define QT5BASE_CONFIGURE_ARCH_CONFIG
        printf 'LIBS += -latomic\n' >$(QT5BASE_ARCH_CONFIG_FILE)
endef

So what should we do?
Should we add a dependency to BR2_TOOLCHAIN_HAS_ATOMIC if
BR2_PACKAGE_QT5_VERSION_LATEST in qt5/Config.in?

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

Fabrice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180828/67037aa0/attachment.html>

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

* [Buildroot] [PATCH 1/1] cutelyst: link with libatomic when needed
  2018-08-28 11:31   ` Fabrice Fontaine
@ 2018-08-28 13:24     ` Thomas Petazzoni
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2018-08-28 13:24 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 28 Aug 2018 13:31:51 +0200, Fabrice Fontaine wrote:

> cutelyst does not directly depends on atomic, this dependency is linked to
> Qt 5.8.

Argh. Ideally, cutelyst should pick this up from Qt's pkg-config file
or something like that. But I guess "ideal" and "build system" are not
always aligned :-)

> Here is an extrat of qt5base.mk:
> ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC)$(BR2_PACKAGE_QT5_VERSION_LATEST),yy)
> # Qt 5.8 needs atomics, which on various architectures are in -latomic
> define QT5BASE_CONFIGURE_ARCH_CONFIG
>         printf 'LIBS += -latomic\n' >$(QT5BASE_ARCH_CONFIG_FILE)
> endef
> 
> So what should we do?
> Should we add a dependency to BR2_TOOLCHAIN_HAS_ATOMIC if
> BR2_PACKAGE_QT5_VERSION_LATEST in qt5/Config.in?

It depends whether Qt needs atomic intrinsics unconditionally or not.
If it does need atomic intrinsics unconditionally, then yes, it needs a
BR2_TOOLCHAIN_HAS_ATOMIC dependency.

We should perhaps have an older toolchain that doesn't provide atomic
intrinsics to be able to verify this.

*But*, BR2_PACKAGE_QT5_VERSION_LATEST already depends on
BR2_TOOLCHAIN_GCC_AT_LEAST_4_8, so anyway libatomic will always be
available, which makes the entire discussion moot.

Except for cutelyst built against Qt5.6, which doesn't need libatomic.
So perhaps the link of cutelyst on libatomic should be conditional on
the version of Qt5 ?

Best regards,

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

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

end of thread, other threads:[~2018-08-28 13:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-27 16:41 [Buildroot] [PATCH 1/1] cutelyst: link with libatomic when needed Fabrice Fontaine
2018-08-27 22:00 ` Peter Korsgaard
2018-08-28  6:52   ` Fabrice Fontaine
2018-08-28  9:58 ` Thomas Petazzoni
2018-08-28 11:31   ` Fabrice Fontaine
2018-08-28 13:24     ` 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.