| Summary: | libgit2 links against build-host libraries | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Gyorgy Sarvari <skandigraun> | ||||
| Component: | core | Assignee: | Ross Burton <ross.burton> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | Medium+ | CC: | meta.mr.watcher, meta.watcher, randy.macleod, richard.purdie, ross.burton | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 6.1 M3 | ||||||
| Hardware: | x86 | ||||||
| OS: | Multiple | ||||||
| Whiteboard: | |||||||
| OS type for building Yocto: | --- | Type of Regression: | --- | ||||
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |||||
| Attachments: |
|
||||||
It looks like the do_install manipulation should be done just for the target packaged filed and not the ones installed into the sysroot. I'm no cmake expert but it feels like switching the sed to ${CMAKE_SYSROOT} would be the easiest solution.
https://cmake.org/cmake/help/latest/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.html is a new bit of cmake to me and reminds me why I dislike it so much.
I _think_ this is the correct fix: https://github.com/libgit2/libgit2/pull/7324. If you understand cmake more than I do, can you have a look? I can't say that I know much about cmake, but at the first sight it makes sense to me. Especially because if one links directly with -lgit2 (without involving cmake), then the extra libraries are not required. Patch sent. FYI I do plan on moving libgit2 out of oe-core and back into meta-oe, as there are no users of it in core. |
Created attachment 5239 [details] project for repro libgit2 recipe removes RECIPE_SYSROOT value from some installed cmake files, however that makes cmake link against libraries on the build host, instead of using the recipe's sysroot to find the required libs. One possible solution would be changing RECIPE_SYSROOT's value to "${CMAKE_SYSROOT}", instead of just deleting it. (There are others too) Attached a small project for reproduction, which ends in the following error when being cross-compiled: ``` ERROR: gittest-1.0-r0 do_compile: Execution of '/yocto/master/build/tmp/work/cortexa57-oe-linux/gittest/1.0/temp/run.do_compile.22668' failed with exit code 1 ERROR: Logfile of failure stored in: /yocto/master/build/tmp/work/cortexa57-oe-linux/gittest/1.0/temp/log.do_compile.22668 Log data follows: | DEBUG: Executing shell function do_compile | NOTE: VERBOSE=1 cmake --build /yocto/master/build/tmp/work/cortexa57-oe-linux/gittest/1.0/build --target all -- | Change Dir: '/yocto/master/build/tmp/work/cortexa57-oe-linux/gittest/1.0/build' | | Run Build Command(s): ninja -v -j 32 all | ninja: error: '/usr/lib/libssl.so', needed by 'gittest', missing and no known rule to make it | | WARNING: exit code 1 from a shell command. ERROR: Task (/yocto/master/build/../oe-core/meta/recipes-core/gittest/gittest.bb:do_compile) failed with exit code '1' ```