* [Buildroot] [PATCH v2, 1/2] boost: context needs thread if gcc <= 4.6
@ 2018-08-20 22:12 Fabrice Fontaine
2018-08-20 22:12 ` [Buildroot] [PATCH v2,2/2] boost: context needs C++11 Fabrice Fontaine
2018-08-21 9:27 ` [Buildroot] [PATCH v2, 1/2] boost: context needs thread if gcc <= 4.6 Thomas Petazzoni
0 siblings, 2 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2018-08-20 22:12 UTC (permalink / raw)
To: buildroot
mutex is available on gcc 4.7.x, the issue is that boost does not
correctly detect it because -std=c++11 is missing.
Keep thread select for gcc version lower or equal to 4.6
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v1 -> v2 (after review of Thomas Petazzoni):
- Update first patch to keep selection of boost-thread but lower gcc
version from 4.8 to 4.7
- Update second patch to add -std=c++11 only if gcc >= 4.7
package/boost/Config.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/boost/Config.in b/package/boost/Config.in
index 965d198ebf..627cf2f356 100644
--- a/package/boost/Config.in
+++ b/package/boost/Config.in
@@ -83,7 +83,7 @@ config BR2_PACKAGE_BOOST_CONTEXT
bool "boost-context"
depends on BR2_PACKAGE_BOOST_CONTEXT_ARCH_SUPPORTS
depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735
- select BR2_PACKAGE_BOOST_THREAD if !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+ select BR2_PACKAGE_BOOST_THREAD if !BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
help
C++11 context switching library.
--
2.14.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v2,2/2] boost: context needs C++11
2018-08-20 22:12 [Buildroot] [PATCH v2, 1/2] boost: context needs thread if gcc <= 4.6 Fabrice Fontaine
@ 2018-08-20 22:12 ` Fabrice Fontaine
2018-08-21 9:27 ` [Buildroot] [PATCH v2, 1/2] boost: context needs thread if gcc <= 4.6 Thomas Petazzoni
1 sibling, 0 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2018-08-20 22:12 UTC (permalink / raw)
To: buildroot
Without this flag, mutex is not always correctly detected with gcc 4.x
or 5.x. As a result, boost_thread is wrongly selected by boost_context.
Fixes:
- http://autobuild.buildroot.net/results/fb046c04fe18bec973d120e4ab33971f32ba5769
- http://autobuild.buildroot.net/results/99f1a255b78a973faeb8bf3b94d78efc54426a8b
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v1 -> v2 (after review of Thomas Petazzoni):
- Update first patch to keep selection of boost-thread but lower gcc
version from 4.8 to 4.7
- Update second patch to add -std=c++11 only if gcc >= 4.7
package/boost/boost.mk | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/package/boost/boost.mk b/package/boost/boost.mk
index 14f6162003..f4a44fa123 100644
--- a/package/boost/boost.mk
+++ b/package/boost/boost.mk
@@ -61,6 +61,11 @@ else
BOOST_FLAGS += --without-icu
endif
+# boost-context needs C++11
+ifeq ($(BR2_PACKAGE_BOOST_CONTEXT)$(BR2_TOOLCHAIN_GCC_AT_LEAST_4_7),yy)
+BOOST_TARGET_CXXFLAGS += -std=c++11
+endif
+
ifeq ($(BR2_PACKAGE_BOOST_IOSTREAMS),y)
BOOST_DEPENDENCIES += bzip2 zlib
endif
--
2.14.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v2, 1/2] boost: context needs thread if gcc <= 4.6
2018-08-20 22:12 [Buildroot] [PATCH v2, 1/2] boost: context needs thread if gcc <= 4.6 Fabrice Fontaine
2018-08-20 22:12 ` [Buildroot] [PATCH v2,2/2] boost: context needs C++11 Fabrice Fontaine
@ 2018-08-21 9:27 ` Thomas Petazzoni
2018-08-21 18:26 ` Fabrice Fontaine
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2018-08-21 9:27 UTC (permalink / raw)
To: buildroot
Hello,
On Tue, 21 Aug 2018 00:12:56 +0200, Fabrice Fontaine wrote:
> mutex is available on gcc 4.7.x, the issue is that boost does not
> correctly detect it because -std=c++11 is missing.
Where did you get the information that mutex is available since gcc
4.7 ? Is it by testing gcc 4.6 and 4.7 ?
I couldn't get this information by looking at
https://gcc.gnu.org/projects/cxx-status.html#cxx11.
Also, I am wondering if the two patches should really be separate.
Aren't they in fact both intimately related, where std::mutex will only
be visible in gcc >= 4.7 if std=c++11 is passed ?
To me, they are basically one single patch:
- Below gcc 4.7, we don't have std::mutex, so boost-thread must be used
- Above gcc 4.7, we have std::mutex, but we need to pass std=c++11 for
std::mutex to be visible/usable
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v2, 1/2] boost: context needs thread if gcc <= 4.6
2018-08-21 9:27 ` [Buildroot] [PATCH v2, 1/2] boost: context needs thread if gcc <= 4.6 Thomas Petazzoni
@ 2018-08-21 18:26 ` Fabrice Fontaine
0 siblings, 0 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2018-08-21 18:26 UTC (permalink / raw)
To: buildroot
Dear Thomas,
Le mar. 21 ao?t 2018 ? 11:27, Thomas Petazzoni <thomas.petazzoni@bootlin.com>
a ?crit :
> Hello,
>
> On Tue, 21 Aug 2018 00:12:56 +0200, Fabrice Fontaine wrote:
> > mutex is available on gcc 4.7.x, the issue is that boost does not
> > correctly detect it because -std=c++11 is missing.
>
> Where did you get the information that mutex is available since gcc
> 4.7 ? Is it by testing gcc 4.6 and 4.7 ?
>
I tested with 4.7. but std::mutex is very old, it exists since gcc 4.4 (see
history of
https://github.com/gcc-mirror/gcc/blob/gcc-4_7_0-release/libstdc%2B%2B-v3/include/std/mutex
).
As a result, it probably also works on gcc 4.4, 4.5 and 4.6 but we'll have
to add std=c++0x instead of std=c++11. However, it seems that the current
best practice in buildroot is to add a dependency on gcc 4.7 (poppler), 4.8
(mongodb) or 4.9 (upmpdcli) for C+11 packages (depending on the C++11
features required by the package). We're also adding std=c++11 for 6 C++11
packages (flatbuffers, libcrossguid, libmediaart, libv4l, mosh, ...) but we
never add std=c++0x (except for host-kodi).
>
> I couldn't get this information by looking at
> https://gcc.gnu.org/projects/cxx-status.html#cxx11.
>
> Also, I am wondering if the two patches should really be separate.
> Aren't they in fact both intimately related, where std::mutex will only
> be visible in gcc >= 4.7 if std=c++11 is passed ?
>
> To me, they are basically one single patch:
>
> - Below gcc 4.7, we don't have std::mutex, so boost-thread must be used
> - Above gcc 4.7, we have std::mutex, but we need to pass std=c++11 for
> std::mutex to be visible/usable
>
OK I will merge both patches.
>
> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
> 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/20180821/77062737/attachment.html>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-08-21 18:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-20 22:12 [Buildroot] [PATCH v2, 1/2] boost: context needs thread if gcc <= 4.6 Fabrice Fontaine
2018-08-20 22:12 ` [Buildroot] [PATCH v2,2/2] boost: context needs C++11 Fabrice Fontaine
2018-08-21 9:27 ` [Buildroot] [PATCH v2, 1/2] boost: context needs thread if gcc <= 4.6 Thomas Petazzoni
2018-08-21 18:26 ` Fabrice Fontaine
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox