<?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>14112</bug_id>
          
          <creation_ts>2020-11-02 23:29:10 +0000</creation_ts>
          <short_desc>nspr-native with OE/Yocto build tools doesn&apos;t build [Ubuntu 16.04.6]: undefined reference  to `__clock_getres@GLIBC_PRIVATE&apos;</short_desc>
          <delta_ts>2021-02-09 14:26:26 +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>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>backport?</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.3 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Abdurachmanov">david.abdurachmanov</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>akuster808</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88538</commentid>
    <comment_count>0</comment_count>
    <who name="David Abdurachmanov">david.abdurachmanov</who>
    <bug_when>2020-11-02 23:29:10 +0000</bug_when>
    <thetext>I am running Ubuntu 16.04.6 LTS which has too old GCC (5.4) for OpenEmbedded. I use build tools from Yocto which brings 10.2.0 version. It used to work just fine until very recently.

I am no more able to build nspr-native. OE-Core (check out at Nov 3rd, master branch, 34ef5c2a8d77fcb4a51c875a443f7b97b409586e). Meta-OE (check out at Nov 3rd, master branch, ac4ccd2fbbb599d75ca4051911fcbaca39dbe6d7).

[..]
| gcc  -o abstract.o -c -fvisibility=hidden   -isystem/build/tmp-glibc/work/x86_64-linux/nspr-native/4.29-r0/recipe-sysroot-native/usr/include -isystem/build/tmp-glib
c/work/x86_64-linux/nspr-native/4.29-r0/recipe-sysroot-native/usr/include -O2 -pipe -Wall -pthread -g -fno-inline -fPIC  -UNDEBUG -DDEBUG_not_whoami -DPACKAGE_NAME=\&quot;\&quot; -DPACKAGE_TARNAME=\&quot;\&quot; -DPACKAGE_VERSION=\&quot;\&quot; -DPACKAGE_STR
ING=\&quot;\&quot; -DPACKAGE_BUGREPORT=\&quot;\&quot; -DPACKAGE_URL=\&quot;\&quot; -DDEBUG=1 -DHAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1 -DHAVE_VISIBILITY_PRAGMA=1 -DXP_UNIX=1 -D_GNU_SOURCE=1 -DHAVE_FCNTL_FILE_LOCKING=1 -DHAVE_POINTER_LOCALTIME_R=1 -DLINUX=1 -DHAVE
_DLADDR=1 -DHAVE_GETTID=1 -DHAVE_LCHOWN=1 -DHAVE_SETPRIORITY=1 -DHAVE_STRERROR=1 -DHAVE_SYSCALL=1 -DHAVE_SECURE_GETENV=1 -D_REENTRANT=1 -DFORCE_PR_LOG -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM -D_PR_INET6 -I../../dist/include/nspr
 -I../../../nspr-4.29/nspr/pr/include -I../../../nspr-4.29/nspr/pr/include/private  ../../../nspr-4.29/nspr/pr/tests/abstract.c
| gcc   abstract.o -Xlinker -L../../dist/lib -lplc4 -L../../dist/lib -lnspr4 -lpthread -o abstract
| /openembedded-core/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/10.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib/x86_64-linux-gnu/librt.so.1: undefined reference 
to `__clock_getcpuclockid@GLIBC_PRIVATE&apos;
| /openembedded-core/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/10.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib/x86_64-linux-gnu/librt.so.1: undefined reference 
to `__clock_nanosleep@GLIBC_PRIVATE&apos;
| /openembedded-core/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/10.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib/x86_64-linux-gnu/librt.so.1: undefined reference 
to `__clock_settime@GLIBC_PRIVATE&apos;
| /openembedded-core/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/10.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib/x86_64-linux-gnu/librt.so.1: undefined reference 
to `__clock_getres@GLIBC_PRIVATE&apos;
| collect2: error: ld returned 1 exit status
| make: *** [Makefile:380: abstract] Error 1
| make: Leaving directory &apos;/build/tmp-glibc/work/x86_64-linux/nspr-native/4.29-r0/build/pr/tests&apos;
| WARNING: /build/tmp-glibc/work/x86_64-linux/nspr-native/4.29-r0/temp/run.do_compile.458191:196 exit 1 from &apos;exit 1&apos;
[..]

The same issue was reported back in May 2020:

https://patchwork.openembedded.org/patch/172346/

I have tried to incl. nativesdk-glibc into buildtools-extended-tarball, but that didn&apos;t solve the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88539</commentid>
    <comment_count>1</comment_count>
    <who name="David Abdurachmanov">david.abdurachmanov</who>
    <bug_when>2020-11-03 01:37:51 +0000</bug_when>
    <thetext>I noticed that my old builds are working fine, so I tested the last 3 versions of build tools:

./openembedded-core/scripts/install-buildtools -r yocto-3.2_M1 -t 20200617
./openembedded-core/scripts/install-buildtools -r yocto-3.2_M2 -t 20200729
./openembedded-core/scripts/install-buildtools -r yocto-3.2_M3 -t 20200923

M1 and M2 worked fine with oe-core &amp; meta-oe being at master. M3 and my own built from the master do not work with nspr-native package.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88553</commentid>
    <comment_count>2</comment_count>
    <who name="akuster">akuster808</who>
    <bug_when>2020-11-05 07:48:46 +0000</bug_when>
    <thetext>meta-oe did update the nspr package oct 19.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88565</commentid>
    <comment_count>3</comment_count>
    <who name="David Abdurachmanov">david.abdurachmanov</who>
    <bug_when>2020-11-05 08:19:58 +0000</bug_when>
    <thetext>I have tried to downgrade nspr version, but that was failing the same way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89185</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-02-09 14:21:55 +0000</bug_when>
    <thetext>As mentioned in:

https://patchwork.openembedded.org/patch/172346/

the real issue is that you likely need:

https://patchwork.openembedded.org/patch/171584/

which is a patch for binutils. That should ensure it looks at librt from the sysroot before it looks at the one from host system and should resolve this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89186</commentid>
    <comment_count>5</comment_count>
    <who name="David Abdurachmanov">david.abdurachmanov</who>
    <bug_when>2021-02-09 14:26:26 +0000</bug_when>
    <thetext>IIRC it did incl. this commit, but the patch didn&apos;t solve the problem.

The patch was committed in April, and I was using oe-core master in November.

Maybe I should give it another try as ~3 months have passed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>