Skip to contentSkip to conversation

Native recipe still contains non-native compilation flags #bitbake

DISCUSSION [email protected] 3 participants 6 messages Jun 5, 2025 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

So I have two recipes, app and app-native.

Inside app.bb I have DEPENDS = "app-native"

Inside app-native.bb I have BBCLASSEXTEND = "native"

I can execute bitbake build app and I can see that the app-native is first being built, so that's great.

However, I'm having compilation errors(non-bitbake related) and went to investigate, I captured the environment variables and noticed things like:

export CXX="arm-openbmc-linux-gnueabi-g++  -march=armv7-a -mfpu=vfpv4-d16.......

when, for the native, I would have expected:

export CXX="g++  -march=x86-64 -mfpu=somethingelse.....

I do see export BUILD_CC="gcc " and export BUILD_CXX="g++ ", but I want to say from previously attempts playing around, the same flags are seen in the non-native recipe build as well.

Also, another thing that feels like an oversight is that I would have expected some sort of automatic flag in the environmental during configure/build/install. Executing 'bitbake -e app' I can see BBCLASSEXTEND="native" in the native output, but not the target, and I kind of assumed it would make it's way into the build environment as an indicator.

#1 lore raw
Quoted 6 lines · joseph.maniaci via lists.yoctoproject.org

So I have two recipes, app and app-native.

Inside app.bb I have DEPENDS = "app-native"

Inside app-native.bb I have BBCLASSEXTEND = "native"

you do not need app-native.bb as separate recipe, Adding BBCLASSEXTEND = "native" to app.bb should get you app-native

Quoted 28 lines

I can execute bitbake build app and I can see that the app-native is first being built, so that's great.

However, I'm having compilation errors(non-bitbake related) and went to investigate, I captured the environment variables and noticed things like:

export CXX="arm-openbmc-linux-gnueabi-g++ -march=armv7-a -mfpu=vfpv4-d16.......

when, for the native, I would have expected:

export CXX="g++ -march=x86-64 -mfpu=somethingelse.....

I do see export BUILD_CC="gcc " and export BUILD_CXX="g++ ", but I want to say from previously attempts playing around, the same flags are seen in the non-native recipe build as well.

Also, another thing that feels like an oversight is that I would have expected some sort of automatic flag in the environmental during configure/build/install. Executing 'bitbake -e app' I can see BBCLASSEXTEND="native" in the native output, but not the target, and I kind of assumed it would make it's way into the build environment as an indicator.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
You automatically follow any topics you start or reply to. View/Reply Online (#65476): https://lists.yoctoproject.org/g/yocto/message/65476
Mute This Topic: https://lists.yoctoproject.org/mt/113491223/1997914
Mute #bitbake:https://lists.yoctoproject.org/g/yocto/mutehashtag/bitbake Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
In reply to [email protected]
Quoted 2 lines · joseph.maniaci via lists.yoctoproject.org

Inside app-native.bb I have BBCLASSEXTEND = “native"

That’s your problem: if you have an app-native.bb recipe then you should just “inherit native”.

What BBCLASSEXTEND=“native” does is take the current recipe (app-native), clone it to <name>-native so app-native-native, and inherit native inside that class. You built app-native which may _look_ like a native recipe but is just a very badly named target recipe.

Maybe there should be a QA check that this hasn’t happened...

As Khem said, you could just put the BBCLASSEXTEND inside the app.bb and use overrides to control what happens in native builds. Both approaches are valid: if you just want to build a single small binary instead of a large application then there’s an argument that a separate app-native recipe is easier to manage. But if they’re basically the same thing, BBCLASSEXTEND means you don’t duplicate anything.

Ross

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Well so long as I'm not the only one.....

I'm guessing my higher-level layer(s) aren't configured for native builds????

ERROR: app-1.0+git-r0 do_collect_spdx_deps: The sstate manifest for task 'gettext-minimal-native:populate_sysroot' (multilib variant '') could not be found. The pkgarchs considered were: openbmc-arm, openbmc-arm_linuxmint-21.3.
But none of these manifests exists:
/home/user/eps-yocto/build/exos-x-vanadium-bmc/tmp/sstate-control/manifest-openbmc-arm-gettext-minimal-native.populate_sysroot /home/user/eps-yocto/build/exos-x-vanadium-bmc/tmp/sstate-control/manifest-openbmc-arm_linuxmint-21.3-gettext-minimal-native.populate_sysroot