All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] llvm: add dependency on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735
@ 2018-04-06  9:00 Thomas Petazzoni
  2018-04-06  9:00 ` [Buildroot] [PATCH 2/2] mesa3d: properly propagate the dependencies of BR2_PACKAGE_LLVM Thomas Petazzoni
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2018-04-06  9:00 UTC (permalink / raw)
  To: buildroot

LLVM uses std::shared_future, which until gcc 7.x isn't available on
architectures that don't provide lock-free atomics, see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735.

Buildroot already has a BR2_TOOLCHAIN_HAS_GCC_BUG_64735 option to
handle such a case, so simply add this new dependency to LLVM. It will
make sure LLVM doesn't get built on ARMv5 platforms using a gcc older
than 7.x.

Fixes:

  http://autobuild.buildroot.net/results/ada497f6a8d20fa1a9adb2b17a138d7b726a6cdc/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/llvm/Config.in | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/llvm/Config.in b/package/llvm/Config.in
index 70f73f4858..15f2507ef2 100644
--- a/package/llvm/Config.in
+++ b/package/llvm/Config.in
@@ -18,6 +18,7 @@ config BR2_PACKAGE_LLVM
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on BR2_INSTALL_LIBSTDCPP
+	depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # std::shared_future
 	help
 	  The LLVM Project is a collection of modular and reusable
 	  compiler and toolchain technologies.
@@ -38,3 +39,7 @@ comment "llvm needs a toolchain w/ threads, C++, gcc >= 4.8, host gcc >= 4.8"
 	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
 	depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP || \
 		!BR2_HOST_GCC_AT_LEAST_4_8 || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+
+comment "llvm needs a toolchain not affected by GCC bug 64735"
+	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735
-- 
2.14.3

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

* [Buildroot] [PATCH 2/2] mesa3d: properly propagate the dependencies of BR2_PACKAGE_LLVM
  2018-04-06  9:00 [Buildroot] [PATCH 1/2] llvm: add dependency on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 Thomas Petazzoni
@ 2018-04-06  9:00 ` Thomas Petazzoni
  2018-04-06  9:17   ` Valentin Korenblit
  2018-04-06  9:36 ` [Buildroot] [PATCH 1/2] llvm: add dependency on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 Valentin Korenblit
  2018-04-06 19:31 ` Thomas Petazzoni
  2 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2018-04-06  9:00 UTC (permalink / raw)
  To: buildroot

We cannot simply select BR2_PACKAGE_LLVM, we need to take into account
all its dependencies. BR2_PACKAGE_LLVM_ARCH_SUPPORTS was already taken
into account, but not the other dependencies.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/mesa3d/Config.in | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/package/mesa3d/Config.in b/package/mesa3d/Config.in
index ffe0287ac5..8f347ffe0c 100644
--- a/package/mesa3d/Config.in
+++ b/package/mesa3d/Config.in
@@ -28,8 +28,22 @@ if BR2_PACKAGE_MESA3D
 config BR2_PACKAGE_MESA3D_LLVM
 	bool "llvm support"
 	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
+	depends on BR2_HOST_GCC_AT_LEAST_4_8
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # std::shared_future
 	select BR2_PACKAGE_LLVM
 
+comment "llvm support needs a toolchain w/ threads, C++, gcc >= 4.8, host gcc >= 4.8"
+	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP || \
+		!BR2_HOST_GCC_AT_LEAST_4_8 || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+
+comment "llvm support needs a toolchain not affected by GCC bug 64735"
+	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735
+
 # inform the .mk file of gallium, dri or vulkan driver selection
 config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
 	bool
-- 
2.14.3

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

* [Buildroot] [PATCH 2/2] mesa3d: properly propagate the dependencies of BR2_PACKAGE_LLVM
  2018-04-06  9:00 ` [Buildroot] [PATCH 2/2] mesa3d: properly propagate the dependencies of BR2_PACKAGE_LLVM Thomas Petazzoni
@ 2018-04-06  9:17   ` Valentin Korenblit
  0 siblings, 0 replies; 6+ messages in thread
From: Valentin Korenblit @ 2018-04-06  9:17 UTC (permalink / raw)
  To: buildroot


Hello Thomas,

On 06/04/2018 11:00, Thomas Petazzoni wrote:
> We cannot simply select BR2_PACKAGE_LLVM, we need to take into account
> all its dependencies. BR2_PACKAGE_LLVM_ARCH_SUPPORTS was already taken
> into account, but not the other dependencies.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

I was preparing that, I did the same for Clang too. I think I'll send
a new version next week.

Acked-by: Valentin Korenblit <valentin.korenblit@smile.fr>

> ---
>   package/mesa3d/Config.in | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>
> diff --git a/package/mesa3d/Config.in b/package/mesa3d/Config.in
> index ffe0287ac5..8f347ffe0c 100644
> --- a/package/mesa3d/Config.in
> +++ b/package/mesa3d/Config.in
> @@ -28,8 +28,22 @@ if BR2_PACKAGE_MESA3D
>   config BR2_PACKAGE_MESA3D_LLVM
>   	bool "llvm support"
>   	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
> +	depends on BR2_HOST_GCC_AT_LEAST_4_8
> +	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
> +	depends on BR2_TOOLCHAIN_HAS_THREADS
> +	depends on BR2_INSTALL_LIBSTDCPP
> +	depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # std::shared_future
>   	select BR2_PACKAGE_LLVM
>   
> +comment "llvm support needs a toolchain w/ threads, C++, gcc >= 4.8, host gcc >= 4.8"
> +	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
> +	depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP || \
> +		!BR2_HOST_GCC_AT_LEAST_4_8 || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
> +
> +comment "llvm support needs a toolchain not affected by GCC bug 64735"
> +	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
> +	depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735
> +
>   # inform the .mk file of gallium, dri or vulkan driver selection
>   config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
>   	bool

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180406/950076bf/attachment.html>

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

* [Buildroot] [PATCH 1/2] llvm: add dependency on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735
  2018-04-06  9:00 [Buildroot] [PATCH 1/2] llvm: add dependency on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 Thomas Petazzoni
  2018-04-06  9:00 ` [Buildroot] [PATCH 2/2] mesa3d: properly propagate the dependencies of BR2_PACKAGE_LLVM Thomas Petazzoni
@ 2018-04-06  9:36 ` Valentin Korenblit
  2018-04-06 11:37   ` Thomas Petazzoni
  2018-04-06 19:31 ` Thomas Petazzoni
  2 siblings, 1 reply; 6+ messages in thread
From: Valentin Korenblit @ 2018-04-06  9:36 UTC (permalink / raw)
  To: buildroot

Hello Thomas,

On 06/04/2018 11:00, Thomas Petazzoni wrote:
> LLVM uses std::shared_future, which until gcc 7.x isn't available on
> architectures that don't provide lock-free atomics, see
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735.
>
> Buildroot already has a BR2_TOOLCHAIN_HAS_GCC_BUG_64735 option to
> handle such a case, so simply add this new dependency to LLVM. It will
> make sure LLVM doesn't get built on ARMv5 platforms using a gcc older
> than 7.x.
>
> Fixes:
>
>    http://autobuild.buildroot.net/results/ada497f6a8d20fa1a9adb2b17a138d7b726a6cdc/
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

The three autotests crashed because of std::shared_future,

I've found the following in: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=820535

"This looks like the kind of failure you get when your host toolchain
doesn't support C++11 properly (specifically lock-free atomics in this
case).  When I've seen it before GCC was defaulting to a CPU that's
too old to do atomics properly, and that configuration is very
unlikely to be supported by LLVM ever (any more)."

I was about to send a patch to blacklist ARMv4 and ARMv5 but this should
be a more appropriate solution (I was not aware of BUG_64735).
I'll try to build with the defconfigs from the autobuilder applying the
patch and adding a dependency on !BR2_STATIC_LIBS.

Acked-by: Valentin Korenblit <valentin.korenblit@smile.fr>

> ---
>   package/llvm/Config.in | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/package/llvm/Config.in b/package/llvm/Config.in
> index 70f73f4858..15f2507ef2 100644
> --- a/package/llvm/Config.in
> +++ b/package/llvm/Config.in
> @@ -18,6 +18,7 @@ config BR2_PACKAGE_LLVM
>   	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
>   	depends on BR2_TOOLCHAIN_HAS_THREADS
>   	depends on BR2_INSTALL_LIBSTDCPP
> +	depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # std::shared_future
>   	help
>   	  The LLVM Project is a collection of modular and reusable
>   	  compiler and toolchain technologies.
> @@ -38,3 +39,7 @@ comment "llvm needs a toolchain w/ threads, C++, gcc >= 4.8, host gcc >= 4.8"
>   	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
>   	depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP || \
>   		!BR2_HOST_GCC_AT_LEAST_4_8 || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
> +
> +comment "llvm needs a toolchain not affected by GCC bug 64735"
> +	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
> +	depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735

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

* [Buildroot] [PATCH 1/2] llvm: add dependency on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735
  2018-04-06  9:36 ` [Buildroot] [PATCH 1/2] llvm: add dependency on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 Valentin Korenblit
@ 2018-04-06 11:37   ` Thomas Petazzoni
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2018-04-06 11:37 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 6 Apr 2018 11:36:26 +0200, Valentin Korenblit wrote:

> The three autotests crashed because of std::shared_future,
> 
> I've found the following in: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=820535
> 
> "This looks like the kind of failure you get when your host toolchain
> doesn't support C++11 properly (specifically lock-free atomics in this
> case).  When I've seen it before GCC was defaulting to a CPU that's
> too old to do atomics properly, and that configuration is very
> unlikely to be supported by LLVM ever (any more)."
> 
> I was about to send a patch to blacklist ARMv4 and ARMv5 but this should
> be a more appropriate solution (I was not aware of BUG_64735).

Note: I didn't test building LLVM for ARMv4/ARMv5, with a gcc 7.x
compiler. But the build error itself clearly points to this gcc
limitation, which has been solved in gcc 7.x.

> I'll try to build with the defconfigs from the autobuilder applying the
> patch and adding a dependency on !BR2_STATIC_LIBS.

So far, there hasn't been any failure to build LLVM in static only
configurations, so let's see if any shows up.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 1/2] llvm: add dependency on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735
  2018-04-06  9:00 [Buildroot] [PATCH 1/2] llvm: add dependency on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 Thomas Petazzoni
  2018-04-06  9:00 ` [Buildroot] [PATCH 2/2] mesa3d: properly propagate the dependencies of BR2_PACKAGE_LLVM Thomas Petazzoni
  2018-04-06  9:36 ` [Buildroot] [PATCH 1/2] llvm: add dependency on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 Valentin Korenblit
@ 2018-04-06 19:31 ` Thomas Petazzoni
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2018-04-06 19:31 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri,  6 Apr 2018 11:00:12 +0200, Thomas Petazzoni wrote:
> LLVM uses std::shared_future, which until gcc 7.x isn't available on
> architectures that don't provide lock-free atomics, see
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735.
> 
> Buildroot already has a BR2_TOOLCHAIN_HAS_GCC_BUG_64735 option to
> handle such a case, so simply add this new dependency to LLVM. It will
> make sure LLVM doesn't get built on ARMv5 platforms using a gcc older
> than 7.x.
> 
> Fixes:
> 
>   http://autobuild.buildroot.net/results/ada497f6a8d20fa1a9adb2b17a138d7b726a6cdc/
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  package/llvm/Config.in | 5 +++++
>  1 file changed, 5 insertions(+)

Both patches applied.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2018-04-06 19:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-06  9:00 [Buildroot] [PATCH 1/2] llvm: add dependency on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 Thomas Petazzoni
2018-04-06  9:00 ` [Buildroot] [PATCH 2/2] mesa3d: properly propagate the dependencies of BR2_PACKAGE_LLVM Thomas Petazzoni
2018-04-06  9:17   ` Valentin Korenblit
2018-04-06  9:36 ` [Buildroot] [PATCH 1/2] llvm: add dependency on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 Valentin Korenblit
2018-04-06 11:37   ` Thomas Petazzoni
2018-04-06 19:31 ` 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.