All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] mesa: fix build with llvm (branch yem/meson-extra-progs)
@ 2019-09-28 20:04 Yann E. MORIN
  2019-09-28 20:04 ` [Buildroot] [PATCH 1/2] core/pkg-meson: allow packages to add extra [binaries] Yann E. MORIN
  2019-09-28 20:04 ` [Buildroot] [PATCH 2/2] package/mesa3d: add llvm-config to meson [binaries] Yann E. MORIN
  0 siblings, 2 replies; 6+ messages in thread
From: Yann E. MORIN @ 2019-09-28 20:04 UTC (permalink / raw)
  To: buildroot

Hello All!

This two-patch series allows fixing mesa3d with llvm support enabled.

To do so, it introduces a way by which packages can add extra entries to
the meson cross-compilation.conf file.


Regards,
Yann E. MORIN.


The following changes since commit 39248bba259d1b35d224285d4379844b2a551fff

  package/mesa3d: add support for gallium tegra driver (2019-09-28 21:57:00 +0200)


are available in the git repository at:

  git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to 71bd376fbcc68a2171acdc72d9bfddd0e60bcefd

  package/mesa3d: add llvm-config to meson [binaries] (2019-09-28 22:04:01 +0200)


----------------------------------------------------------------
Yann E. MORIN (2):
      core/pkg-meson: allow packages to add extra [binaries]
      package/mesa3d: add llvm-config to meson [binaries]

 docs/manual/adding-packages-meson.txt | 7 +++++++
 package/mesa3d/mesa3d.mk              | 2 +-
 package/pkg-meson.mk                  | 3 +++
 3 files changed, 11 insertions(+), 1 deletion(-)

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 1/2] core/pkg-meson: allow packages to add extra [binaries]
  2019-09-28 20:04 [Buildroot] [PATCH 0/2] mesa: fix build with llvm (branch yem/meson-extra-progs) Yann E. MORIN
@ 2019-09-28 20:04 ` Yann E. MORIN
  2019-10-05  9:14   ` Romain Naour
  2019-10-05 20:33   ` Thomas Petazzoni
  2019-09-28 20:04 ` [Buildroot] [PATCH 2/2] package/mesa3d: add llvm-config to meson [binaries] Yann E. MORIN
  1 sibling, 2 replies; 6+ messages in thread
From: Yann E. MORIN @ 2019-09-28 20:04 UTC (permalink / raw)
  To: buildroot

meson does not allow passing path to helper programs (e.g. pkgconfig)
using variables in the environment. Instead, it insists that those paths
be defined in the cross-compilation.conf file, in the [binaries]
section [0]

As such, allow packages to declare such a list of arbitrary entries to
add in the [binaries] section.

[0] https://github.com/mesonbuild/meson/issues/3327 for the LLVM_CONFIG
    example, which we'll address in a follow=up patch.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Cc: Peter Seiderer <ps.report@gmx.net>
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 docs/manual/adding-packages-meson.txt | 7 +++++++
 package/pkg-meson.mk                  | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/docs/manual/adding-packages-meson.txt b/docs/manual/adding-packages-meson.txt
index 8e2d448788..e84bf7f60a 100644
--- a/docs/manual/adding-packages-meson.txt
+++ b/docs/manual/adding-packages-meson.txt
@@ -109,6 +109,13 @@ will therefore only use a few of them.
   +cross-compile.conf+ file +c_link_args+ and +cpp_link_args+ properties. By
   default, the value of +TARGET_LDFLAGS+.
 
+* +FOO_MESON_EXTRA_BINARIES+, to specify a space-separated list of programs
+  to add to the `[binaries]` section of the meson `cross-compilation.conf`
+  configuration file. The format is `program-name='/path/to/program'`, with
+  no space around the +=+ sign, and with the path of the program between
+  single quotes. By default, empty. Note that Buildroot already sets the
+  correct values for +c+, +cpp+, +ar+, +strip+, and +pkgconfig+.
+
 * +FOO_NINJA_ENV+, to specify additional environment variables to pass to
   +ninja+, meson companion tool in charge of the build operations. By default,
   empty.
diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index 0b811d1cc0..f5c7b8ced3 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -79,6 +79,9 @@ define $(2)_CONFIGURE_CMDS
 	    -e "s%@TARGET_LDFLAGS@%$$($(2)_MESON_SED_LDFLAGS)%g" \
 	    -e "s%@TARGET_CXXFLAGS@%$$($(2)_MESON_SED_CXXFLAGS)%g" \
 	    -e "s%@HOST_DIR@%$$(HOST_DIR)%g" \
+	    $$(foreach x,$$($(2)_MESON_EXTRA_BINARIES), \
+	        -e "/\(\[binaries\]\)/s:$$$$:\n$$(x):" \
+	    ) \
 	    package/meson/cross-compilation.conf.in \
 	    > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf
 	PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) $$(MESON) \
-- 
2.20.1

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

* [Buildroot] [PATCH 2/2] package/mesa3d: add llvm-config to meson [binaries]
  2019-09-28 20:04 [Buildroot] [PATCH 0/2] mesa: fix build with llvm (branch yem/meson-extra-progs) Yann E. MORIN
  2019-09-28 20:04 ` [Buildroot] [PATCH 1/2] core/pkg-meson: allow packages to add extra [binaries] Yann E. MORIN
@ 2019-09-28 20:04 ` Yann E. MORIN
  2019-10-05  9:15   ` Romain Naour
  1 sibling, 1 reply; 6+ messages in thread
From: Yann E. MORIN @ 2019-09-28 20:04 UTC (permalink / raw)
  To: buildroot

The meson buildsystem does not honour environment variables; instead, it
insists that path to programs be passed in the [binaries] section of the
cross-compilation.conf.

So, that is what we must do to pass the path to llvm-config.

Note that, LLVM_CONFIG does exist in the mesa3d source code, but it is
limited to the Scons buildsystem, and is also a leftover from when
mesa3d was using the autotools. It has never worked with the meson
buildsystem.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Romain Naour <romain.naour@gmail.com>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/mesa3d/mesa3d.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk
index b47c6b9b2e..205bf96285 100644
--- a/package/mesa3d/mesa3d.mk
+++ b/package/mesa3d/mesa3d.mk
@@ -33,7 +33,7 @@ MESA3D_CONF_OPTS = \
 
 ifeq ($(BR2_PACKAGE_MESA3D_LLVM),y)
 MESA3D_DEPENDENCIES += host-llvm llvm
-MESA3D_CONF_ENV += LLVM_CONFIG=$(STAGING_DIR)/usr/bin/llvm-config
+MESA3D_MESON_EXTRA_BINARIES += llvm-config='$(STAGING_DIR)/usr/bin/llvm-config'
 MESA3D_CONF_OPTS += -Dllvm=true
 else
 # Avoid automatic search of llvm-config
-- 
2.20.1

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

* [Buildroot] [PATCH 1/2] core/pkg-meson: allow packages to add extra [binaries]
  2019-09-28 20:04 ` [Buildroot] [PATCH 1/2] core/pkg-meson: allow packages to add extra [binaries] Yann E. MORIN
@ 2019-10-05  9:14   ` Romain Naour
  2019-10-05 20:33   ` Thomas Petazzoni
  1 sibling, 0 replies; 6+ messages in thread
From: Romain Naour @ 2019-10-05  9:14 UTC (permalink / raw)
  To: buildroot

Hi Yann,

Le 28/09/2019 ? 22:04, Yann E. MORIN a ?crit?:
> meson does not allow passing path to helper programs (e.g. pkgconfig)
> using variables in the environment. Instead, it insists that those paths
> be defined in the cross-compilation.conf file, in the [binaries]
> section [0]
> 
> As such, allow packages to declare such a list of arbitrary entries to
> add in the [binaries] section.
> 
> [0] https://github.com/mesonbuild/meson/issues/3327 for the LLVM_CONFIG
>     example, which we'll address in a follow=up patch.
> 
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> Cc: Peter Seiderer <ps.report@gmx.net>
> Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>

Tested with mesa3d and llvm support.

Reviewed-by: Romain Naour <romain.naour@gmail.com>
Tested-by: Romain Naour <romain.naour@gmail.com>

Best regards,
Romain

> ---
>  docs/manual/adding-packages-meson.txt | 7 +++++++
>  package/pkg-meson.mk                  | 3 +++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/docs/manual/adding-packages-meson.txt b/docs/manual/adding-packages-meson.txt
> index 8e2d448788..e84bf7f60a 100644
> --- a/docs/manual/adding-packages-meson.txt
> +++ b/docs/manual/adding-packages-meson.txt
> @@ -109,6 +109,13 @@ will therefore only use a few of them.
>    +cross-compile.conf+ file +c_link_args+ and +cpp_link_args+ properties. By
>    default, the value of +TARGET_LDFLAGS+.
>  
> +* +FOO_MESON_EXTRA_BINARIES+, to specify a space-separated list of programs
> +  to add to the `[binaries]` section of the meson `cross-compilation.conf`
> +  configuration file. The format is `program-name='/path/to/program'`, with
> +  no space around the +=+ sign, and with the path of the program between
> +  single quotes. By default, empty. Note that Buildroot already sets the
> +  correct values for +c+, +cpp+, +ar+, +strip+, and +pkgconfig+.
> +
>  * +FOO_NINJA_ENV+, to specify additional environment variables to pass to
>    +ninja+, meson companion tool in charge of the build operations. By default,
>    empty.
> diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
> index 0b811d1cc0..f5c7b8ced3 100644
> --- a/package/pkg-meson.mk
> +++ b/package/pkg-meson.mk
> @@ -79,6 +79,9 @@ define $(2)_CONFIGURE_CMDS
>  	    -e "s%@TARGET_LDFLAGS@%$$($(2)_MESON_SED_LDFLAGS)%g" \
>  	    -e "s%@TARGET_CXXFLAGS@%$$($(2)_MESON_SED_CXXFLAGS)%g" \
>  	    -e "s%@HOST_DIR@%$$(HOST_DIR)%g" \
> +	    $$(foreach x,$$($(2)_MESON_EXTRA_BINARIES), \
> +	        -e "/\(\[binaries\]\)/s:$$$$:\n$$(x):" \
> +	    ) \
>  	    package/meson/cross-compilation.conf.in \
>  	    > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf
>  	PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) $$(MESON) \
> 

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

* [Buildroot] [PATCH 2/2] package/mesa3d: add llvm-config to meson [binaries]
  2019-09-28 20:04 ` [Buildroot] [PATCH 2/2] package/mesa3d: add llvm-config to meson [binaries] Yann E. MORIN
@ 2019-10-05  9:15   ` Romain Naour
  0 siblings, 0 replies; 6+ messages in thread
From: Romain Naour @ 2019-10-05  9:15 UTC (permalink / raw)
  To: buildroot

Hi Yann,

Le 28/09/2019 ? 22:04, Yann E. MORIN a ?crit?:
> The meson buildsystem does not honour environment variables; instead, it
> insists that path to programs be passed in the [binaries] section of the
> cross-compilation.conf.
> 
> So, that is what we must do to pass the path to llvm-config.
> 
> Note that, LLVM_CONFIG does exist in the mesa3d source code, but it is
> limited to the Scons buildsystem, and is also a leftover from when
> mesa3d was using the autotools. It has never worked with the meson
> buildsystem.
> 
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Romain Naour <romain.naour@gmail.com>
> Cc: Bernd Kuhls <bernd.kuhls@t-online.de>

Tested with mesa3d and llvm support.

Reviewed-by: Romain Naour <romain.naour@gmail.com>
Tested-by: Romain Naour <romain.naour@gmail.com>

Best regards,
Romain

> ---
>  package/mesa3d/mesa3d.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk
> index b47c6b9b2e..205bf96285 100644
> --- a/package/mesa3d/mesa3d.mk
> +++ b/package/mesa3d/mesa3d.mk
> @@ -33,7 +33,7 @@ MESA3D_CONF_OPTS = \
>  
>  ifeq ($(BR2_PACKAGE_MESA3D_LLVM),y)
>  MESA3D_DEPENDENCIES += host-llvm llvm
> -MESA3D_CONF_ENV += LLVM_CONFIG=$(STAGING_DIR)/usr/bin/llvm-config
> +MESA3D_MESON_EXTRA_BINARIES += llvm-config='$(STAGING_DIR)/usr/bin/llvm-config'
>  MESA3D_CONF_OPTS += -Dllvm=true
>  else
>  # Avoid automatic search of llvm-config
> 

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

* [Buildroot] [PATCH 1/2] core/pkg-meson: allow packages to add extra [binaries]
  2019-09-28 20:04 ` [Buildroot] [PATCH 1/2] core/pkg-meson: allow packages to add extra [binaries] Yann E. MORIN
  2019-10-05  9:14   ` Romain Naour
@ 2019-10-05 20:33   ` Thomas Petazzoni
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2019-10-05 20:33 UTC (permalink / raw)
  To: buildroot

On Sat, 28 Sep 2019 22:04:30 +0200
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> meson does not allow passing path to helper programs (e.g. pkgconfig)
> using variables in the environment. Instead, it insists that those paths
> be defined in the cross-compilation.conf file, in the [binaries]
> section [0]
> 
> As such, allow packages to declare such a list of arbitrary entries to
> add in the [binaries] section.
> 
> [0] https://github.com/mesonbuild/meson/issues/3327 for the LLVM_CONFIG
>     example, which we'll address in a follow=up patch.
> 
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> Cc: Peter Seiderer <ps.report@gmx.net>
> Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
> ---
>  docs/manual/adding-packages-meson.txt | 7 +++++++
>  package/pkg-meson.mk                  | 3 +++
>  2 files changed, 10 insertions(+)

Both applied. Thanks!

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:[~2019-10-05 20:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-28 20:04 [Buildroot] [PATCH 0/2] mesa: fix build with llvm (branch yem/meson-extra-progs) Yann E. MORIN
2019-09-28 20:04 ` [Buildroot] [PATCH 1/2] core/pkg-meson: allow packages to add extra [binaries] Yann E. MORIN
2019-10-05  9:14   ` Romain Naour
2019-10-05 20:33   ` Thomas Petazzoni
2019-09-28 20:04 ` [Buildroot] [PATCH 2/2] package/mesa3d: add llvm-config to meson [binaries] Yann E. MORIN
2019-10-05  9:15   ` Romain Naour

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.