<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>16373</bug_id>
          
          <creation_ts>2026-07-23 10:06:37 +0000</creation_ts>
          <short_desc>libgit2 links against build-host libraries</short_desc>
          <delta_ts>2026-07-29 20:04:07 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.1 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gyorgy Sarvari">skandigraun</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>106288</commentid>
    <comment_count>0</comment_count>
      <attachid>5239</attachid>
    <who name="Gyorgy Sarvari">skandigraun</who>
    <bug_when>2026-07-23 10:06:37 +0000</bug_when>
    <thetext>Created attachment 5239
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&apos;s sysroot to find the required libs.

One possible solution would be changing RECIPE_SYSROOT&apos;s value to &quot;${CMAKE_SYSROOT}&quot;, 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 &apos;/yocto/master/build/tmp/work/cortexa57-oe-linux/gittest/1.0/temp/run.do_compile.22668&apos; 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: &apos;/yocto/master/build/tmp/work/cortexa57-oe-linux/gittest/1.0/build&apos;
| 
| Run Build Command(s): ninja -v -j 32 all
| ninja: error: &apos;/usr/lib/libssl.so&apos;, needed by &apos;gittest&apos;, 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 &apos;1&apos;
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106300</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2026-07-23 14:52:26 +0000</bug_when>
    <thetext>It looks like the do_install manipulation should be done just for the target packaged filed and not the ones installed into the sysroot.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106302</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2026-07-23 15:09:14 +0000</bug_when>
    <thetext>I&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106321</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2026-07-23 16:40:53 +0000</bug_when>
    <thetext>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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106322</commentid>
    <comment_count>4</comment_count>
    <who name="Gyorgy Sarvari">skandigraun</who>
    <bug_when>2026-07-23 18:42:49 +0000</bug_when>
    <thetext>I can&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106323</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2026-07-23 19:39:59 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106370</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2026-07-29 20:04:07 +0000</bug_when>
    <thetext>https://git.openembedded.org/openembedded-core/commit/?id=a3d381bd80bcb73097dc68c46c725f3122dca49b</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>5239</attachid>
            <date>2026-07-23 10:06:37 +0000</date>
            <delta_ts>2026-07-23 10:06:37 +0000</delta_ts>
            <desc>project for repro</desc>
            <filename>gittest.tar.gz</filename>
            <type>application/gzip</type>
            <size>647</size>
            <attacher name="Gyorgy Sarvari">skandigraun</attacher>
            
              <data encoding="base64">H4sIAAAAAAAAA+2WXU/bMBSGe51fYWVMaieUOh9OWBmTSpp1EW1hCeVmTFE+3NajDcxxEAjx3+dU
WRBoG5pW2Kad56J2fOxjK2/OW2vdOROCFqLbejKwxCGkanWH4LrV1+M1LZ0YJjaJYxGzhXXdse0W
Ik93pDvKQsQcodb8uuTsJ/Mei/+jaI3+daslyab3qAS2LeuH+puW0+gvPwCpv7nWH2/6IN/jP9d/
5LveJPTQHlLH/rGqyOfonT/ywsh9fxBOx1Vgxpa01+1u3biH4/HhJKrXRAM/uO3KVburjOzhHZPE
GbVf71CcpLMdgm2aZrExcxJrZmJDVZQwcKNp4Fcp0amCJHXmb59een/YHcdndMQKUWjiSsiYzMHy
BeVMoHQlY4oy8I68ySCsUi5ZIvOs96ket26mk6O+e1AdUlX+9Gv+a7mr/+qlF0/yL/Ar/m/aVlX/
2NHB/5+Dh/rfr7nN7PGo/2Or1t82TMOR+hPb0MH/n4O1j0YrlrNVuYo4/VIyTrP2iReE/uEEmRrp
KMoFP/9MU9GuPxU06k+G0/7QC5Ero3GWRfSKpqWIkyVtJjWmLqfMWJ5FF3F6Fs9puzZqFHgfpn7g
DTqKVGBORbRk+Zn8SXjMGS2aREeBf9I/9lC9rterO3W+Dpj7b/Cw/hvVNrjHY/Vv6Fbj/5jYsv4t
Rzeh/p+DFyxPl2VG0ZtCZOxcW7xVmiG1qjJtsb51CbSKWd6uOrJY022ULmL+qupffvzUuZHXtgsu
g7O2OpS3s0vKC3ae99DL4jTfv6baaa5uo5G/P/SPjag2l86uXMWpKHmO8K5yC3UMAAAAAAAAAAAA
AAAAAAAAAACwAb4CF2tPGAAoAAA=
</data>

          </attachment>
      

    </bug>

</bugzilla>