Skip to contentSkip to conversation

package/boost: Boost.Atomic needs atomic intrinsics

RFC PATCH Superseded Michael Nosthoff via buildroot 1 participant 3 messages Dec 5, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 package/boost: Boost.Atomic needs atomic intrinsics

From: Michael <[email protected]>

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

---

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(+)
package/boost/Config.in +1 -0
index b99b01f22e..e012f5050f 100644
@@ -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<>.
 
Signature · 6 lines
2.37.1 (Apple Git-137.1)

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 10 lines · On Mon, 5 Dec 2022 13:54:22 +0100 Michael Nosthoff via buildroot…

From: Michael <[email protected]>

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.

Quoted 8 lines

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

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

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Hi Thomas,

Quoted 35 lines · Thomas Petazzoni
Quoted 10 lines · On Mon, 5 Dec 2022 13:54:22 +0100 Michael Nosthoff via buildroot…

From: Michael <[email protected]>

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.

Quoted 8 lines

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

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
Quoted 2 lines

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

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot