[PATCH 1/2] bitbake.conf: ensure BUILD_* tools match target tools


Richard Purdie
 

On Wed, 2021-03-24 at 09:41 +0000, Ross Burton wrote:
On Tue, 23 Mar 2021 at 21:53, Andre McCurdy <armccurdy@...> wrote:
@@ -541,7 +541,10 @@ export BUILD_AR = "${BUILD_PREFIX}ar"
 export BUILD_AS = "${BUILD_PREFIX}as ${BUILD_AS_ARCH}"
 export BUILD_RANLIB = "${BUILD_PREFIX}ranlib"
 export BUILD_STRIP = "${BUILD_PREFIX}strip"
+export BUILD_OBJCOPY = "${BUILD_PREFIX}objcopy"
+export BUILD_OBJDUMP = "${BUILD_PREFIX}objdump"
 export BUILD_NM = "${BUILD_PREFIX}nm"
+export BUILD_READELF = "${BUILD_PREFIX}readelf"
Do these new variables need to be exported?

As far as I remember a few of the BUILD_xxx variables are "official"
autotools variables which some autotools packages may expect to find
in the environment (although googling now doesn't find any
references).

If so then the rest (i.e. most of them, and certainly these newly
added ones) are OE specific and only used in OE recipes and classes...
and therefore don't need to be exported here.
It was all in the name of consistency.

The Meson cross-file sets readelf, so to mirror the new native-file
also sets readelf. There wasn't a BUILD_READELF and if someone is
changing BUILD_CC there's a good chance they'll be changing the entire
toochain, so I added any missing entries.

Yes, BUILD_* are effectively OE-specific so we could unexport the
entire set. I'd prefer to do that than have some exported and some
not.
It is really hard to determine if we can unexport something so whilst I
appreciate the symmetry desire, lets not add any exports we don't need.
Exports are pretty ugly from a signatures standpoint as they have to be
added to all shell tasks.

Cheers,

Richard


Ross Burton <ross@...>
 

On Tue, 23 Mar 2021 at 21:53, Andre McCurdy <armccurdy@...> wrote:
@@ -541,7 +541,10 @@ export BUILD_AR = "${BUILD_PREFIX}ar"
export BUILD_AS = "${BUILD_PREFIX}as ${BUILD_AS_ARCH}"
export BUILD_RANLIB = "${BUILD_PREFIX}ranlib"
export BUILD_STRIP = "${BUILD_PREFIX}strip"
+export BUILD_OBJCOPY = "${BUILD_PREFIX}objcopy"
+export BUILD_OBJDUMP = "${BUILD_PREFIX}objdump"
export BUILD_NM = "${BUILD_PREFIX}nm"
+export BUILD_READELF = "${BUILD_PREFIX}readelf"
Do these new variables need to be exported?

As far as I remember a few of the BUILD_xxx variables are "official"
autotools variables which some autotools packages may expect to find
in the environment (although googling now doesn't find any
references).

If so then the rest (i.e. most of them, and certainly these newly
added ones) are OE specific and only used in OE recipes and classes...
and therefore don't need to be exported here.
It was all in the name of consistency.

The Meson cross-file sets readelf, so to mirror the new native-file
also sets readelf. There wasn't a BUILD_READELF and if someone is
changing BUILD_CC there's a good chance they'll be changing the entire
toochain, so I added any missing entries.

Yes, BUILD_* are effectively OE-specific so we could unexport the
entire set. I'd prefer to do that than have some exported and some
not.

Ross


Andre McCurdy
 

On Tue, Mar 23, 2021 at 2:29 PM Ross Burton <ross@...> wrote:

Add a few more tools to the BUILD_* list, to match the target tool list.

Signed-off-by: Ross Burton <ross.burton@...>
---
meta/conf/bitbake.conf | 3 +++
1 file changed, 3 insertions(+)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index ecd4d1638e..d4bda80736 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -541,7 +541,10 @@ export BUILD_AR = "${BUILD_PREFIX}ar"
export BUILD_AS = "${BUILD_PREFIX}as ${BUILD_AS_ARCH}"
export BUILD_RANLIB = "${BUILD_PREFIX}ranlib"
export BUILD_STRIP = "${BUILD_PREFIX}strip"
+export BUILD_OBJCOPY = "${BUILD_PREFIX}objcopy"
+export BUILD_OBJDUMP = "${BUILD_PREFIX}objdump"
export BUILD_NM = "${BUILD_PREFIX}nm"
+export BUILD_READELF = "${BUILD_PREFIX}readelf"
Do these new variables need to be exported?

As far as I remember a few of the BUILD_xxx variables are "official"
autotools variables which some autotools packages may expect to find
in the environment (although googling now doesn't find any
references).

If so then the rest (i.e. most of them, and certainly these newly
added ones) are OE specific and only used in OE recipes and classes...
and therefore don't need to be exported here.

export MAKE = "make"
EXTRA_OEMAKE = ""
--
2.25.1




Ross Burton <ross@...>
 

Add a few more tools to the BUILD_* list, to match the target tool list.

Signed-off-by: Ross Burton <ross.burton@...>
---
meta/conf/bitbake.conf | 3 +++
1 file changed, 3 insertions(+)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index ecd4d1638e..d4bda80736 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -541,7 +541,10 @@ export BUILD_AR =3D "${BUILD_PREFIX}ar"
export BUILD_AS =3D "${BUILD_PREFIX}as ${BUILD_AS_ARCH}"
export BUILD_RANLIB =3D "${BUILD_PREFIX}ranlib"
export BUILD_STRIP =3D "${BUILD_PREFIX}strip"
+export BUILD_OBJCOPY =3D "${BUILD_PREFIX}objcopy"
+export BUILD_OBJDUMP =3D "${BUILD_PREFIX}objdump"
export BUILD_NM =3D "${BUILD_PREFIX}nm"
+export BUILD_READELF =3D "${BUILD_PREFIX}readelf"
=20
export MAKE =3D "make"
EXTRA_OEMAKE =3D ""
--=20
2.25.1