If you attempt to use flex on the target it tries to call m4 at the sysroot path and fails: flex: fatal internal error, exec of /opt/yocto_builder/build/tmp/sysroots/x86_64-linux/usr/bin/m4 failed This was fixed earlier using a wrapper script: http://cgit.openembedded.org/openembedded-core/commit/?id=7bdb617f2f0e246feb4dc32931fdb87258fd1207 But then seems to have regressed after this change: http://cgit.openembedded.org/openembedded-core/commit/?id=2ca72d35e839a0fa24d33bf75343f187792f4e2c It's also worth noting that flex currently doesn't have a runtime dependency on m4. I'm not 100% sure that it's needed, but if it can't process the examples/testxxLexer.l file supplied with flex without calling it (as seen here) it does suggest that it is required.
will EXTRA_OECONF += " ac_cv_path_M4=${M4}" EXTRA_OEMAKE += " m4=${M4_class-native}" solve it?
That would be preferable to the profile.d-based fix, however it's somewhat unorthodox to use overrides in the manner the second line does. We do also need the extra RDEPENDS as far as I can tell.
When it is really too unorthodix, then add add a helper variable M4NATIVE = "${STAGING_BINDIR_NATIVE}/m4" M4_class-native = "${M4NATIVE}" EXTRA_OECONF += "ac_cv_path_M4=${M4}" EXTRA_OEMAKE += "m4=${M4NATIVE}" About which RDEPENDS are you speaking? By using fix above, all the 'create_wrapper' appends can be removed.
By looker further into it, the M4 variable can be removed completely when 'create_wrapper' scripts are removed. So, add EXTRA_OECONF += "ac_cv_path_M4=${bindir}/m4" EXTRA_OEMAKE += "m4=${STAGING_BINDIR_NATIVE}/m4" and remove 'M4* = ...' and the do_install_append...()
Merged in master: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=9a6ee8b447ee6070b23bb11fd3dd7fabf0d9ab80