| Summary: | Please add per-toolchain CMake toolchain file which does not rely on setting up environment variables | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Jan Dorniak <jaskij> |
| Component: | devtools / tool chain | Assignee: | Jagadeesh Krishnanjanappa <workjagadeesh> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | meta.mr.watcher, meta.watcher, randy.macleod, workjagadeesh |
| Version: | 4.0 | ||
| Target Milestone: | 4.0 M4 | ||
| Hardware: | All | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Yes (doc changes required) | |
| Attachments: | |||
Created attachment 4848 [details]
creates per-toolchain cmake file in the SDK
Hi Jan,
The attached patch creates ${MULTIMACH_TARGET_SYS}-toolchain.cmake file
at ${SDK_INSTALL_DIR}/sysroots/${SDK_SYS}/usr/share/cmake/, which is
per-toolchain CMake toolchain file containing
arch-specific values and independent of OE environment variables.
The file gets created after installing SDK toolchain installer obtained
by running "bitbake -c populate_sdk <image>".
Please try this patch let me know if any issues. If the patch works as
expected then it can be pushed for review and merge.
Note:
1. From ${SDK_INSTALL_DIR}/${SDKMACHINE}/usr/share/cmake
we need "../../../../../" rather than "../../../../" to go SDK install
directory.
2. Changes to install cmake template file(as present in the patch) and cmake-setup.py should go into cmake recipe as it overrides the some of the functions/variables specific to nativesdk. So kept the changes into cmake recipe rather than cmake-native.
Regards,
Jagadeesh
Created attachment 4849 [details]
sample per-toolchain cmake file generated in SDK using the attached patch
Any feedback on the attached patch? Regards Jagadeesh Jan, please review and/or try Jagadeesh's patch and provide feedback. Thanks. Jagadeesh, Randy, sorry for not replying earlier - I actually thought that replying to Bugzilla's notification would create a comment. Back on topic, I have tested Jagadeesh's patch against current master (with the minor tweak that master uses CMake 3.22.2 and the filenames in the patch had to be adjusted accordingly). I was able to build and SDK and install it. Building both manually from the terminal and via IDE (JetBrains CLion), using only the generated toolchain file worked marvelously, with no issues. The project I have tested with links to two libraries: pthread and OpenMP. I have been unable to actually test run the build binary on the target because of connection issues - but should be able to do so in the next few days. Once again, sorry for not replying earlier. Everything best Jan Hi Jan, Thank you for taking time to test it. I will try to push the patch for commit in the oe-core mailing list. Thanks Randy and Stephen for the follow-up. Regards Jagadeesh I would defer submitting the patch in the mailing list until the built binary runs fine on the target. Jan, Please let us know if you face any issues while running the binary on the target. Regards, Jagadeesh Thanks everyone. Waiting for testing results and commenting for those who track the status of bugs... Jagadeesh any testing results? (In reply to comment #9) > Jagadeesh any testing results? Hi Randy, I do not have a setup to verify the patch. I am waiting for Jan to give testing results once he is able to solve connection issues as per comment 5. Regards, Jagadeesh I am sorry for not responding earlier. Finally got to testing this, using the files generated during my previous test. It works just fine. Once again, sorry for the delay Jan P.S. I would change the status, but am not sure which is appropriate. Thanks Jan. Posted the patch for review and commit in the OE-core mailing list [https://lists.openembedded.org/g/openembedded-core/message/163800| here] Regards, Jagadeesh Patch Posted The patch is merged to master at https://git.openembedded.org/openembedded-core/commit/?id=42e68397ec74b3cd8ae5df45355c8f6254b48cd8. Can we change the resolution of bug to fixed? Regards, Jagadeesh @Jagadeesh, I've assigned this back to you. I think you should have been able to just click the 'take' link if you had enough info from Jan. Anyway, there's no formal per bug testing process that I'm aware of so since there seems to be consensus that this is fixed, please go ahead and close the defect as resolved / fixed. You have already include a link to the master commit which we like to see so it seems we're done. Moving to fixed as the patch is committed to master at .https://git.openembedded.org/openembedded-core/commit/?id=42e68397ec74b3cd8ae5df45355c8f6254b48cd8 Regards, Jagadeesh |
Created attachment 4845 [details] cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi.toolchain.cmake The life of developers using IDEs with OE's toolchain would be greatly improved by generating per-toolchain CMake toolchain files. The toolchain files generated should have a name based on the TARGET_PREFIX of the target machine and be installated besides OEToolchainConfig.cmake As an example/template there's an attached file I have manually written for cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi, with comments indicating which flags I believe should replace hardcoded strings. The next steps to go from here would be: 1. Making sure which variables to use to replace the hardcoded strings 2. Generate the file in `cmake-native` when building the SDK