[yocto] Changing HOST_CC_ARCH temporarily in recipe

Damien LEFEVRE lefevre.da at gmail.com
Wed Sep 18 01:26:29 PDT 2019


Hi,

I have a package which requires to first build a x64 binary which is then
used to compile the target platform binaries.

The way I got away with it was to build that host binary from
do_configure_prepend() and then continue with the build procedure.

I recently upgraded to GCC7 + warrior and now building the host binary
from do_configure_prepend fails due to this error:
testCCompiler.c:1:0: error: bad value (armv8-a+crc) for -march= switch

I figured that the arch switch (building for tegra) is defined
in HOST_CC_ARCH as:
-march=armv8-a+crc -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat
-Wformat-security -Werror=format-security

If I clear HOST_CC_ARCH in my recipe file, do_configure_prepend succeeds
but of course the rest of the build will fail.

So i'm trying to do something like this:
do_configure_prepend(){
    export HOST_CC_ARCH_BACKUP="${HOST_CC_ARCH}"
    HOST_CC_ARCH=""
    echo "HOST_CC_ARCH before cmake: ${HOST_CC_ARCH}"
    CC="${BUILD_CC}" CXX="${BUILD_CXX}" CCFLAGS="${BUILD_CFLAGS}"
 CXXFLAGS="${BUILD_CPPFLAGS} -std=c++11" LDFLAGS="${BUILD_LDFLAGS}" cmake
${S}
    make
    HOST_CC_ARCH="${HOST_CC_ARCH_BACKUP}"
}

There I still get:
HOST_CC_ARCH before cmake:  -march=armv8-a+crc -fstack-protector-strong
 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security

So HOST_CC_ARCH doesn't get updated.

How can I temporarily reset HOST_CC_ARCH?

Thanks,
-Damien
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20190918/7bf02f6a/attachment.html>


More information about the yocto mailing list