<?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>9639</bug_id>
          
          <creation_ts>2016-05-16 13:37:03 +0000</creation_ts>
          <short_desc>cmake-native autodetects libidn-native</short_desc>
          <delta_ts>2016-10-17 17:19:50 +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>devtools / tool chain</component>
          <version>2.1</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>critical</bug_severity>
          <target_milestone>2.2 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Martin Jansa">Martin.Jansa</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>clopez</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>ross.burton</cc>
    
    <cc>sgw</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>62217</commentid>
    <comment_count>0</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2016-05-16 13:37:03 +0000</bug_when>
    <thetext>There is no explicit dependency on libidn, so rebuilds from sstate can fail with:

| DEBUG: Executing shell function do_configure
| cmake: error while loading shared libraries: libidn.so.11: cannot open shared object file: No such file or directory

When in previous build cmake-native was build after libidn-native.

Please fix in master and krogoth.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64568</commentid>
    <comment_count>1</comment_count>
    <who name="dengke">dengke.du</who>
    <bug_when>2016-07-28 03:25:05 +0000</bug_when>
    <thetext>Hi Martin

I can&apos;t reappear it. This is my steps:

1. bitbake libidn-native
2. bitbake cmake-native
3. make another build(share the above build sstate)
4. bitbake cmake-native

Can you give me more details about you steps?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64626</commentid>
    <comment_count>2</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2016-07-29 02:05:23 +0000</bug_when>
    <thetext>Martin, please review the steps provided and give any additional details</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64990</commentid>
    <comment_count>3</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2016-08-09 13:28:51 +0000</bug_when>
    <thetext>It sometimes uses libidn from host, but sometimes libidn from native sysroot:

OE qemux86@ ~/build/oe-core $ ldd tmp-glibc/sysroots/x86_64-linux/usr/bin/cmake
        linux-vdso.so.1 (0x00007ffc485a8000)
        libidn.so.11 =&gt; /usr/lib64/libidn.so.11 (0x00007f3fee06e000)
        libdl.so.2 =&gt; /lib64/libdl.so.2 (0x00007f3fede66000)
        libstdc++.so.6 =&gt; /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libstdc++.so.6 (0x00007f3feda6e000)
        libm.so.6 =&gt; /lib64/libm.so.6 (0x00007f3fed766000)
        libgcc_s.so.1 =&gt; /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_s.so.1 (0x00007f3fed54e000)
        libc.so.6 =&gt; /lib64/libc.so.6 (0x00007f3fed1ae000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f3fee2a6000)

OE qemux86@ ~/build/oe-core $ bitbake libidn-native

OE qemux86@ ~/build/oe-core $ ldd tmp-glibc/sysroots/x86_64-linux/usr/bin/cmake
        linux-vdso.so.1 (0x00007ffef4208000)
        libidn.so.11 =&gt; /OE/build/oe-core/tmp-glibc/sysroots/x86_64-linux/usr/bin/../lib/libidn.so.11 (0x00007f0292cd6000)
        libdl.so.2 =&gt; /lib64/libdl.so.2 (0x00007f0292ace000)
        libstdc++.so.6 =&gt; /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libstdc++.so.6 (0x00007f02926d6000)
        libm.so.6 =&gt; /lib64/libm.so.6 (0x00007f02923ce000)
        libgcc_s.so.1 =&gt; /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_s.so.1 (0x00007f02921b6000)
        libc.so.6 =&gt; /lib64/libc.so.6 (0x00007f0291e16000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f0292f0e000)

So when cmake is built on host with net-dns/libidn installed (or libidn-native built before cmake-native) and then this cmake build from sstate is reused on host without net-dns/libidn installed it will fail as shown in description.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64991</commentid>
    <comment_count>4</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2016-08-09 13:56:33 +0000</bug_when>
    <thetext>It should be possible to reproduce also with cmake target build if you disable libidn PACKAGECONFIG in gnutls or gnutls PACKAGECONFIG in curl.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65001</commentid>
    <comment_count>5</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2016-08-09 20:57:01 +0000</bug_when>
    <thetext>You need to test it on host without libidn installed, see comments above.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65003</commentid>
    <comment_count>6</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2016-08-09 21:39:21 +0000</bug_when>
    <thetext>This is on host without libidn installed:

rm -rf tmp-glibc
bitbake -c cleansstate cmake-native &amp;&amp; bitbake -c build cmake-native
mv tmp-glibc/work/x86_64-linux/cmake-native/*/ cmake-native-no-libidn
rm -rf tmp-glibc
bitbake -c cleansstate cmake-native &amp;&amp; bitbake -c build libidn-native &amp;&amp;
bitbake -c build cmake-native
mv tmp-glibc/work/x86_64-linux/cmake-native/*/ cmake-native-libidn

OE qemux86@ ~/build/oe-core $ ldd cmake-native-*/image/OE/build/oe-core/tmp-glibc/sysroots/x86_64-linux/usr/bin/cmake
cmake-native-libidn/image/OE/build/oe-core/tmp-glibc/sysroots/x86_64-linux/usr/bin/cmake:
        linux-vdso.so.1 (0x00007ffdab3c0000)
        libidn.so.11 =&gt; not found
        libdl.so.2 =&gt; /lib64/libdl.so.2 (0x00007f9c636be000)
        libstdc++.so.6 =&gt; /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libstdc++.so.6 (0x00007f9c632c6000)
        libm.so.6 =&gt; /lib64/libm.so.6 (0x00007f9c62fbe000)
        libgcc_s.so.1 =&gt; /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_s.so.1 (0x00007f9c62da6000)
        libc.so.6 =&gt; /lib64/libc.so.6 (0x00007f9c62a06000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f9c638c6000)
cmake-native-no-libidn/image/OE/build/oe-core/tmp-glibc/sysroots/x86_64-linux/usr/bin/cmake:
        linux-vdso.so.1 (0x00007fff53710000)
        libdl.so.2 =&gt; /lib64/libdl.so.2 (0x00007f61f5996000)
        libstdc++.so.6 =&gt; /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libstdc++.so.6 (0x00007f61f559e000)
        libm.so.6 =&gt; /lib64/libm.so.6 (0x00007f61f5296000)
        libgcc_s.so.1 =&gt; /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_s.so.1 (0x00007f61f507e000)
        libc.so.6 =&gt; /lib64/libc.so.6 (0x00007f61f4cde000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f61f5b9e000)

On host with libidn installed, you will probably see libidn support always enabled (even without libidn-native in OE sysroot) and when the lib isn&apos;t in sysroot, the one from host is used instead - so you won&apos;t notice cmake binary failing. But once such cmake-native sstate archive is re-used on host without libidn installed it will start failing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65067</commentid>
    <comment_count>7</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2016-08-11 15:49:39 +0000</bug_when>
    <thetext>Things got even worse yesterday thanks to binutils upgrade and also missing openssl-native dependency, see:

http://lists.openembedded.org/pipermail/openembedded-core/2016-August/125007.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65698</commentid>
    <comment_count>8</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2016-09-01 17:33:20 +0000</bug_when>
    <thetext>I&apos;m getting build problems for cmake on oe-core/384cf92 in a debian jessie system

It build fine, but it fails to install with:



[ 87%] Built target memcheck_fail
[ 90%] Built target CPackLib
[ 91%] Built target cpack
[100%] Built target CTestLib
[100%] Built target ctest
Install the project...
bin/cmake: /home/igalia/clopez/yocto/commit-builds/upstream/builds/qemux86-64/tmp-glibc/sysroots/x86_64-linux/usr/lib/libcrypto.so.1.0.0: version `OPENSSL_1.0.0&apos; not found (required by bin/cmake)
bin/cmake: /home/igalia/clopez/yocto/commit-builds/upstream/builds/qemux86-64/tmp-glibc/sysroots/x86_64-linux/usr/lib/libssl.so.1.0.0: version `OPENSSL_1.0.0&apos; not found (required by bin/cmake)
bin/cmake: /home/igalia/clopez/yocto/commit-builds/upstream/builds/qemux86-64/tmp-glibc/sysroots/x86_64-linux/usr/lib/libssl.so.1.0.0: version `OPENSSL_1.0.1&apos; not found (required by bin/cmake)
Makefile:72: recipe for target &apos;install&apos; failed
make: *** [install] Error 1
ERROR: Function failed: do_install (log file is located at /home/igalia/clopez/yocto/commit-builds/upstream/builds/qemux86-64/tmp-glibc/work/x86_64-linux/cmake-native/3.6.1-r0/temp/log.do_install.33739)


I got it working by adding the suggested openssl-native dependency.

--- a/meta/recipes-devtools/cmake/cmake-native_3.6.1.bb
+++ b/meta/recipes-devtools/cmake/cmake-native_3.6.1.bb
@@ -2,7 +2,7 @@ require cmake.inc
 inherit native
 
 # Using cmake&apos;s internal libarchive, so some dependencies are needed
-DEPENDS += &quot;bzip2-native zlib-native&quot;
+DEPENDS += &quot;bzip2-native zlib-native openssl-native&quot;
 
 SRC_URI += &quot;\
     file://cmlibarchive-disable-ext2fs.patch \</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66048</commentid>
    <comment_count>9</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-09-12 17:42:26 +0000</bug_when>
    <thetext>Are openssl/idn worth having as build dependencies for our native needs?  Not sure what a build system is using those for at all to be honest!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66093</commentid>
    <comment_count>10</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2016-09-13 17:54:08 +0000</bug_when>
    <thetext>&gt; Are openssl/idn worth having as build dependencies for our native needs?  Not sure what a build system is using those for at all to be honest!

I don&apos;t know how much these add of build time, but in current state of things when openssl is autodetected from host or from native sysroot and these 2 versions have different ABI (because openssl versioned symbols patch we have in OE&apos;s openssl) - it doesn&apos;t work at all.

You either build against OE&apos;s openssl ABI and then when it doesn&apos;t get populated in sysroot soon enough, it will use openssl from host and fail. Or it autodetects openssl from host when it&apos;s not in native sysroot yet, but then when it gets populated in native sysroot it will again start failing, because it will try to use incompatible ABI again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66149</commentid>
    <comment_count>11</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-09-14 16:42:50 +0000</bug_when>
    <thetext>Patches on the list.

Ended up with depending on curl-native as then cmake-native won&apos;t look for openssl or libidn itself.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66311</commentid>
    <comment_count>12</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-09-19 12:42:34 +0000</bug_when>
    <thetext>Fixed in oe-core f9366799aaf4ad2b98345743c7129fa94d092880.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>