Freescale / meta-freescale

Layer containing NXP hardware support metadata
Other
172 stars 257 forks source link

jailhouse-imx: Avoid the build error when using -mcpu and -march #1746

Closed angolini closed 9 months ago

angolini commented 9 months ago

It changes the Makefile, so the recipe is the only one controlling the build arguments.

It is related to [1]

[1] https://git.yoctoproject.org/poky/commit/?id=04eac1f2b67eac5f892a9e0f8fcfe54849923af5


Now it builds

angolini commented 9 months ago

Looks good to me except that the patch cannot be upstreamed as-is. Can you see if there is some way to keep the existing config as the default but overridable by our recipe?

@thochstein I couldn't think of a way to override the default from Makefile. Do you know how?

Another way would be using sed, do you prefer this instead?

@@ -60,6 +59,9 @@ do_configure:prepend() {
    then
       cp "${STAGING_DIR_HOST}/${CELLCONF_DIR}/"*.c ${S}/configs/${ARCH}/
    fi
+
+   sed -i "/KBUILD_CFLAGS/d" ./hypervisor/arch/arm64/Makefile
+   sed -i "/KBUILD_CFLAGS/d" ./hypervisor/arch/arm/Makefile
 }
thochstein commented 9 months ago

Looks good to me except that the patch cannot be upstreamed as-is. Can you see if there is some way to keep the existing config as the default but overridable by our recipe?

I couldn't think of a way to override the default from Makefile. Do you know how?

Another way would be using sed, do you prefer this instead?

I don't know of a better fix off hand, but I think the patch is preferable to the sed operation. Please comment on this in the patch commit message and add an Upstream-Status: Inappropriate [See above].