Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imx93: add fixes to enable multilib out-of-the-box #1713

Merged
merged 4 commits into from
Dec 29, 2023

Conversation

jmarcoscosta
Copy link

Hello,

I have been trying to build a 32-bit userspace + 64-bit kernel system through multilib. However, this feature doesn't seem to work out-of-the-box, and some fixes were needed so I could have a flawless build. The target I used in this context was lib32-core-image-minimal.

The main goal of this PR is to fix erroneous overrides that end up using the userspace architecture. Those overrides are not taken into consideration if the userspace architecture is something other than aarch64.

Best regards,
João

@jmarcoscosta jmarcoscosta force-pushed the fix-overrides-for-multilib branch from 98b165a to 47bbd3f Compare December 28, 2023 12:20
@jmarcoscosta
Copy link
Author

Update: the override I previously used was restricted to iMX9, even though iMX8 is also aarch64, and that would break the build for iMX8.

I added a new override, namely imx-aarch64 to represent them both, and updated the following commits to use it instead of mx9-generic-bsp.

@otavio
Copy link
Member

otavio commented Dec 28, 2023

Thank you for your work on this pull request. However, I would prefer to explicitly keep the overrides. Would you mind reworking it to use mx8-generic-bsp and mx9-generic-bsp?

@jmarcoscosta
Copy link
Author

Hello, @otavio

I'm not sure if I understood you correctly. Did you mean having each variable defined twice, using the two overrides?

Like this:

foo:mx8-generic-bsp = "bar"
foo:mx9-generic-bsp = "bar"

Best regards,
João

@otavio
Copy link
Member

otavio commented Dec 29, 2023

@jmarcoscosta exactly! 👍🏻

Using 'aarch64', as if the KERNEL_IMAGETYPE was conditioned to the
userspace's architecture, will cause the wrong image type to be built in
a multilib context (e.g., for a 32-bit userspace). This happens because
'aarch64' will not be listed in OVERRIDES, and the error below will come
up during do_image_wic task:

output: install:
cannot stat '...build/tmp-glibc/deploy/images/microej-imx93/zImage':
No such file or directory

Replace 'aarch64' by mx*-generic-bsp, for both imx8 and imx9, as these
two are aarch64 platforms.

Signed-off-by: Joao Marcos Costa <[email protected]>
Using 'aarch64', as if the OPTEE_BOOT_IMAGE was conditioned to the
userspace's architecture, will include uTee-${OPTEE_BIN_EXT} in a multilib
context (e.g., for a 32-bit userspace). This happens because 'aarch64' will not
be listed in OVERRIDES, and the error below will come up during do_image_wic
task:

output: install:
cannot stat '...build/tmp-glibc/deploy/images/microej-imx93/uTee-':
No such file or directory

Replace 'aarch64' by mx*-generic-bsp, for both imx8 and imx9, as these
two are aarch64 platforms.

Signed-off-by: Joao Marcos Costa <[email protected]>
Using 'aarch64', as if the WKS_FILE_DEPENDS was conditioned to the
userspace's architecture, will not include imx-boot in a multilib context
(e.g., for a 32-bit userspace). This happens because 'aarch64' will not
be listed in OVERRIDES, and the error below will come up during do_image_wic
task:

wic.filemap.Error: cannot open image file
'.../build/tmp-glibc/deploy/images/microej-imx93/imx-boot':
[Errno 2] No such file or directory

Replace 'aarch64' by mx*-generic-bsp, for both imx8 and imx9, as these
two are aarch64 platforms.

Signed-off-by: Joao Marcos Costa <[email protected]>
The sstate manifest for populate_sysroot was not being named
properly for firmware-sentinel and imx-boot-firmware-files, raising the
following error:

The sstate manifest for task 'firmware-sentinel:populate_sysroot'
(multilib variant '') could not be found.
The pkgarchs considered were: microej_imx93, armv7ahf-neon-vfpv4-mx93,
armv7ahf-neon-mx93, (and so on...)

But none of these manifests exists:
    ...build/tmp-glibc/sstate-control/manifest-microej_imx93-imx-boot-firmware-files.populate_sysroot
    ...build/tmp-glibc/sstate-control/manifest-armv7ahf-neon-vfpv4-mx93-imx-boot-firmware-files.populate_sysroot
... and so on.

All the other packages were suffixed with TUNE_PKGARCH only, so I couldn't
see the reason why only some specific packages from meta-freescale were using
that.

Remove MACHINE_SOCARCH_SUFFIX so as the sstate manifest is compatible
with what's expected in populate_sysroot.

Signed-off-by: Joao Marcos Costa <[email protected]>
@jmarcoscosta jmarcoscosta force-pushed the fix-overrides-for-multilib branch from 47bbd3f to 6579ce9 Compare December 29, 2023 13:51
@jmarcoscosta
Copy link
Author

PR updated.

@otavio otavio merged commit 5d963d1 into Freescale:master Dec 29, 2023
@@ -74,7 +74,7 @@ python __anonymous () {
d.appendVar("PACKAGE_EXTRA_ARCHS", " %s" % d.getVar("THUMB_EXTRA_SOCARCH"))
}

MACHINE_SOCARCH = "${TUNE_PKGARCH}${MACHINE_SOCARCH_SUFFIX}"
MACHINE_SOCARCH = "${TUNE_PKGARCH}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see #1717.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants