[oe] [meta-oe][PATCH 5/8] luajit: Dont use BUILD_LDFLAGS when compiling host binaries

Andre McCurdy armccurdy at gmail.com
Fri May 18 18:46:19 UTC 2018


On Fri, May 18, 2018 at 6:27 AM, Carlos Alberto Lopez Perez
<clopez at igalia.com> wrote:
> On 18/05/18 06:44, Khem Raj wrote:
>>> I suggest adding something like this:
>>>
>>> EXTRA_OEMAKE_remove_class-target = "'HOST_LDFLAGS=${BUILD_LDFLAGS}'"
>>>

This idea looks right, but be aware that ${BUILD_LDFLAGS} will be
expanded before being processed by _remove. Therefore any individual
string within ${BUILD_LDFLAGS} will be removed from the final value of
EXTRA_OEMAKE, even if it occurs somewhere other than in the value of
HOST_LDFLAGS. For example:

  BUILD_CFLAGS = "one two three"
  BUILD_LDFLAGS = "one two three"

  FOO = " \
    'HOST_CFLAGS=${BUILD_CFLAGS}' \
    'HOST_LDFLAGS=${BUILD_LDFLAGS}' \
  "

  FOO_remove_class-target = "'HOST_LDFLAGS=${BUILD_LDFLAGS}'"

  $ bitbake recipe -e | grep ^FOO=

  FOO="'HOST_CFLAGS=one three'"

Notice how "two" has been removed from the final value of HOST_CFLAGS
set within FOO.

In this case, if you want to have a HOST_LDFLAGS='...' only for native
builds, it's better to use _append_class-native as required.

In general, it's usually a bug (or at least bad form) to use _remove
in a recipe. It's usually reserved for custom changes in a .bbappend
etc.



More information about the Openembedded-devel mailing list