diff mbox series

[RFC] package/boost: Boost.Atomic needs atomic intrinsics

Message ID 20221205125423.13983-1-buildroot@heine.tech
State Superseded
Headers show
Series [RFC] package/boost: Boost.Atomic needs atomic intrinsics | expand

Commit Message

Michael Nosthoff Dec. 5, 2022, 12:54 p.m. UTC
From: Michael <buildroot@heine.tech>

similar to previous problems with nios2 and not-available atomic ints
the build for Boost.Atomics also fails for ARC Targets which don't
have the ATOMICS_EXT flag set.

according to [0] "Boost.Atomic has a hard requirement of the native
atomic operations on bytes". The same tests mentioned there fail for
ARC.

so introduce a dependency on BR2_ARC_ATOMIC_EXT for BR2_arc.

Fixes:
  http://autobuild.buildroot.net/results/4ca54a85672d7b9328b1909b457e548c6032a493

[0] https://github.com/boostorg/atomic/issues/42#issuecomment-734130348

Signed-off-by: Michael Nosthoff <buildroot@heine.tech>

---

I'm not 100% sure if BR2_ARC_ATOMIC_EXT is the correct
flag to use. I'm open to suggestions for better ways and what to
propagate to dependent packages.
---
 package/boost/Config.in | 1 +
 1 file changed, 1 insertion(+)

Comments

Thomas Petazzoni Dec. 5, 2022, 5:19 p.m. UTC | #1
On Mon,  5 Dec 2022 13:54:22 +0100
Michael Nosthoff via buildroot <buildroot@buildroot.org> wrote:

> From: Michael <buildroot@heine.tech>
> 
> similar to previous problems with nios2 and not-available atomic ints
> the build for Boost.Atomics also fails for ARC Targets which don't
> have the ATOMICS_EXT flag set.
> 
> according to [0] "Boost.Atomic has a hard requirement of the native
> atomic operations on bytes". The same tests mentioned there fail for
> ARC.
> 
> so introduce a dependency on BR2_ARC_ATOMIC_EXT for BR2_arc.
> 
> Fixes:
>   http://autobuild.buildroot.net/results/4ca54a85672d7b9328b1909b457e548c6032a493
> 
> [0] https://github.com/boostorg/atomic/issues/42#issuecomment-734130348
> 
> Signed-off-by: Michael Nosthoff <buildroot@heine.tech>

I wish it would be this simple, but this new "depends on" needs to be
propagated to all places where BR2_PACKAGE_BOOST_ATOMIC is selected.

Aka:

package/boost/Config.in:        select BR2_PACKAGE_BOOST_ATOMIC
package/boost/Config.in:        select BR2_PACKAGE_BOOST_ATOMIC
package/domoticz/Config.in:     select BR2_PACKAGE_BOOST_ATOMIC
package/gnuradio/Config.in:     select BR2_PACKAGE_BOOST_ATOMIC
package/libcpprestsdk/Config.in:        select BR2_PACKAGE_BOOST_ATOMIC
package/log4cxx/Config.in:      select BR2_PACKAGE_BOOST_ATOMIC if !BR2_TOOLCHAIN_GCC_AT_LEAST_7
package/uhd/Config.in:  select BR2_PACKAGE_BOOST_ATOMIC

And of course, if there's anything that selects those options, the new
depends on should be propagated to them again.

Thomas
Michael Nosthoff Dec. 5, 2022, 8:14 p.m. UTC | #2
Hi Thomas,

On Monday, December 05, 2022 18:19 CET, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> On Mon,  5 Dec 2022 13:54:22 +0100
> Michael Nosthoff via buildroot <buildroot@buildroot.org> wrote:
> 
> > From: Michael <buildroot@heine.tech>
> > 
> > similar to previous problems with nios2 and not-available atomic ints
> > the build for Boost.Atomics also fails for ARC Targets which don't
> > have the ATOMICS_EXT flag set.
> > 
> > according to [0] "Boost.Atomic has a hard requirement of the native
> > atomic operations on bytes". The same tests mentioned there fail for
> > ARC.
> > 
> > so introduce a dependency on BR2_ARC_ATOMIC_EXT for BR2_arc.
> > 
> > Fixes:
> >   http://autobuild.buildroot.net/results/4ca54a85672d7b9328b1909b457e548c6032a493
> > 
> > [0] https://github.com/boostorg/atomic/issues/42#issuecomment-734130348
> > 
> > Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
> 
> I wish it would be this simple, but this new "depends on" needs to be
> propagated to all places where BR2_PACKAGE_BOOST_ATOMIC is selected.
> 
> Aka:
> 
> package/boost/Config.in:        select BR2_PACKAGE_BOOST_ATOMIC
> package/boost/Config.in:        select BR2_PACKAGE_BOOST_ATOMIC
> package/domoticz/Config.in:     select BR2_PACKAGE_BOOST_ATOMIC
> package/gnuradio/Config.in:     select BR2_PACKAGE_BOOST_ATOMIC
> package/libcpprestsdk/Config.in:        select BR2_PACKAGE_BOOST_ATOMIC
> package/log4cxx/Config.in:      select BR2_PACKAGE_BOOST_ATOMIC if !BR2_TOOLCHAIN_GCC_AT_LEAST_7
> package/uhd/Config.in:  select BR2_PACKAGE_BOOST_ATOMIC
> 
> And of course, if there's anything that selects those options, the new
> depends on should be propagated to them again.

I'm aware of these dependencies. That's why I submitted this RFC Patch because I wanted to be sure to
use the right dependency before going through all those packages. (I guess you missed my "below the commit
message" part).

Does it make sense to add 
  depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT)
to all those packages or is there something "smarter"?

Would it make sense to group it with the dependency on 
BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS  and add something like 
BR2_PACKAGE_BOOST_ATOMIC_ARCH_SUPPORT?

Regards,
Michael
diff mbox series

Patch

diff --git a/package/boost/Config.in b/package/boost/Config.in
index b99b01f22e..e012f5050f 100644
--- a/package/boost/Config.in
+++ b/package/boost/Config.in
@@ -19,6 +19,7 @@  if BR2_PACKAGE_BOOST
 config BR2_PACKAGE_BOOST_ATOMIC
 	bool "boost-atomic"
 	depends on BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS
+	depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT)
 	help
 	  C++11-style atomic<>.