Skip to contentSkip to conversation

nspr-native: build correclty with extended buildtools.

PATCH In review Jeremy A. Puhlman 3 participants 8 messages Mar 9, 2022 – Mar 10, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nspr-native: build correclty with extended buildtools.

From: Jeremy Puhlman <[email protected]>

gcc abstract.o -Xlinker -L../../dist/lib -lplc4 -L../../dist/lib -lnspr4 -lpthread -o abstract
/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __libc_dlsym@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __pthread_unwind@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__libc_dlopen_mode@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getcpuclockid@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_nanosleep@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_settime@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getres@GLIBC_PRIVATE'

The linker is not correctly pulling in lrt as needed.

---
 meta-oe/recipes-support/nspr/nspr_4.29.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-support/nspr/nspr_4.29.bb +2 -0
index f224bcd34..2717f37bc 100644
@@ -160,6 +160,8 @@ PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
 # preferred path upstream.
 EXTRA_OECONF += "--includedir=${includedir}/nspr"
 
+EXTRA_OEMAKE:append:class-native = " EXTRA_LIBS='-lpthread -lrt'"
+
 do_compile:prepend() {
 	oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX ${BUILD_CFLAGS}" LDFLAGS="" CC="${BUILD_CC}" -C config export
 }
Signature · 1 line
2.31.1
#1 lore raw

Thanks Jeremy

I wonder why we don't see it failing on AB or in my local testing. is it specific to some build host distro ?

Quoted 44 lines · Jeremy Puhlman

From: Jeremy Puhlman <[email protected]>

gcc abstract.o -Xlinker -L../../dist/lib -lplc4 -L../../dist/lib -lnspr4 -lpthread -o abstract
/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __libc_dlsym@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __pthread_unwind@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__libc_dlopen_mode@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getcpuclockid@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_nanosleep@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_settime@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getres@GLIBC_PRIVATE'

The linker is not correctly pulling in lrt as needed.

---
 meta-oe/recipes-support/nspr/nspr_4.29.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-support/nspr/nspr_4.29.bb +2 -1
index f224bcd34..2717f37bc 100644
@@ -160,6 +160,8 @@ PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
 # preferred path upstream.
 EXTRA_OECONF += "--includedir=${includedir}/nspr"
 
+EXTRA_OEMAKE:append:class-native = " EXTRA_LIBS='-lpthread -lrt'"
+
 do_compile:prepend() {
        oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX ${BUILD_CFLAGS}" LDFLAGS="" CC="${BUILD_CC}" -C config export
 }
--

2.31.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#95912): https://lists.openembedded.org/g/openembedded-devel/message/95912
Mute This Topic: https://lists.openembedded.org/mt/89670512/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
Quoted 4 lines · Khem Raj

Thanks Jeremy

I wonder why we don't see it failing on AB or in my local testing. is it specific to some build host distro ?

I am seeing the same issue reported on ubuntu 18.04, centos 7 and 8, but its only with the extended buildtools.

Quoted 45 lines · Jeremy Puhlman
Quoted 43 lines

From: Jeremy Puhlman <[email protected]>

gcc abstract.o -Xlinker -L../../dist/lib -lplc4 -L../../dist/lib -lnspr4 -lpthread -o abstract
/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __libc_dlsym@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __pthread_unwind@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__libc_dlopen_mode@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getcpuclockid@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_nanosleep@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_settime@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getres@GLIBC_PRIVATE'

The linker is not correctly pulling in lrt as needed.

---
  meta-oe/recipes-support/nspr/nspr_4.29.bb | 2 ++
  1 file changed, 2 insertions(+)
meta-oe/recipes-support/nspr/nspr_4.29.bb +2 -1
index f224bcd34..2717f37bc 100644
@@ -160,6 +160,8 @@ PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
  # preferred path upstream.
  EXTRA_OECONF += "--includedir=${includedir}/nspr"
 
+EXTRA_OEMAKE:append:class-native = " EXTRA_LIBS='-lpthread -lrt'"
+
  do_compile:prepend() {
         oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX ${BUILD_CFLAGS}" LDFLAGS="" CC="${BUILD_CC}" -C config export
  }
--

2.31.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#95912): https://lists.openembedded.org/g/openembedded-devel/message/95912
Mute This Topic: https://lists.openembedded.org/mt/89670512/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

sadly I am seeing this failure

https://errors.yoctoproject.org/Errors/Details/651342/

Quoted 58 lines · Jeremy Puhlman
Quoted 4 lines · Khem Raj

Thanks Jeremy

I wonder why we don't see it failing on AB or in my local testing. is it specific to some build host distro ?

I am seeing the same issue reported on ubuntu 18.04, centos 7 and 8, but its only with the extended buildtools.

Quoted 45 lines · Jeremy Puhlman
Quoted 43 lines

From: Jeremy Puhlman <[email protected]>

gcc abstract.o -Xlinker -L../../dist/lib -lplc4 -L../../dist/lib -lnspr4 -lpthread -o abstract
/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __libc_dlsym@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __pthread_unwind@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__libc_dlopen_mode@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getcpuclockid@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_nanosleep@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_settime@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getres@GLIBC_PRIVATE'

The linker is not correctly pulling in lrt as needed.

---
  meta-oe/recipes-support/nspr/nspr_4.29.bb | 2 ++
  1 file changed, 2 insertions(+)
meta-oe/recipes-support/nspr/nspr_4.29.bb +2 -1
index f224bcd34..2717f37bc 100644
@@ -160,6 +160,8 @@ PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
  # preferred path upstream.
  EXTRA_OECONF += "--includedir=${includedir}/nspr"
 
+EXTRA_OEMAKE:append:class-native = " EXTRA_LIBS='-lpthread -lrt'"
+
  do_compile:prepend() {
         oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX ${BUILD_CFLAGS}" LDFLAGS="" CC="${BUILD_CC}" -C config export
  }
--

2.31.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#95912): https://lists.openembedded.org/g/openembedded-devel/message/95912
Mute This Topic: https://lists.openembedded.org/mt/89670512/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw

I came here to say the same. :)

Ross

Quoted 67 lines · Khem Raj

sadly I am seeing this failure

https://errors.yoctoproject.org/Errors/Details/651342/

Quoted 40 lines · Jeremy Puhlman
Quoted 4 lines · Khem Raj

Thanks Jeremy

I wonder why we don't see it failing on AB or in my local testing. is it specific to some build host distro ?

I am seeing the same issue reported on ubuntu 18.04, centos 7 and 8, but its only with the extended buildtools.

Quoted 28 lines · Jeremy Puhlman
Quoted 26 lines

From: Jeremy Puhlman <[email protected]>

gcc abstract.o -Xlinker -L../../dist/lib -lplc4 -L../../dist/lib -lnspr4 -lpthread -o abstract
/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __libc_dlsym@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __pthread_unwind@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__libc_dlopen_mode@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getcpuclockid@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_nanosleep@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_settime@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getres@GLIBC_PRIVATE'

The linker is not correctly pulling in lrt as needed.

---
  meta-oe/recipes-support/nspr/nspr_4.29.bb | 2 ++
  1 file changed, 2 insertions(+)
meta-oe/recipes-support/nspr/nspr_4.29.bb +0 -0
index f224bcd34..2717f37bc 100644
@@ -160,6 +160,8 @@ PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
  # preferred path upstream.
  EXTRA_OECONF += "--includedir=${includedir}/nspr"
 
Quoted 12 lines
Quoted 11 lines
Quoted 11 lines
meta-oe/recipes-support/nspr/nspr_4.29.bb +2 -1
+EXTRA_OEMAKE:append:class-native = " EXTRA_LIBS='-lpthread -lrt'"
+
  do_compile:prepend() {
         oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX ${BUILD_CFLAGS}" LDFLAGS="" CC="${BUILD_CC}" -C config export
  }
--

2.31.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#95935): https://lists.openembedded.org/g/openembedded-devel/message/95935
Mute This Topic: https://lists.openembedded.org/mt/89670512/1676615
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#5 lore raw
In reply to Khem Raj

Adding -ldl should resolve it. It corrected the issue on ubuntu-18.04 + extended-buildtools and with out. Lemme check centos as well.

Quoted 59 lines · Khem Raj

sadly I am seeing this failure

https://errors.yoctoproject.org/Errors/Details/651342/

Quoted 54 lines · Jeremy Puhlman
Quoted 4 lines · Khem Raj

Thanks Jeremy

I wonder why we don't see it failing on AB or in my local testing. is it specific to some build host distro ?

I am seeing the same issue reported on ubuntu 18.04, centos 7 and 8, but its only with the extended buildtools.

Quoted 44 lines · Jeremy Puhlman
Quoted 43 lines

From: Jeremy Puhlman <[email protected]>

gcc abstract.o -Xlinker -L../../dist/lib -lplc4 -L../../dist/lib -lnspr4 -lpthread -o abstract
/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __libc_dlsym@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __pthread_unwind@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__libc_dlopen_mode@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getcpuclockid@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_nanosleep@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_settime@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getres@GLIBC_PRIVATE'

The linker is not correctly pulling in lrt as needed.

---
   meta-oe/recipes-support/nspr/nspr_4.29.bb | 2 ++
   1 file changed, 2 insertions(+)
meta-oe/recipes-support/nspr/nspr_4.29.bb +2 -1
index f224bcd34..2717f37bc 100644
@@ -160,6 +160,8 @@ PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
   # preferred path upstream.
   EXTRA_OECONF += "--includedir=${includedir}/nspr"
 
+EXTRA_OEMAKE:append:class-native = " EXTRA_LIBS='-lpthread -lrt'"
+
   do_compile:prepend() {
          oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX ${BUILD_CFLAGS}" LDFLAGS="" CC="${BUILD_CC}" -C config export
   }
--

2.31.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#95912): https://lists.openembedded.org/g/openembedded-devel/message/95912
Mute This Topic: https://lists.openembedded.org/mt/89670512/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#6 lore raw
Quoted 4 lines · Jeremy Puhlman

Adding -ldl should resolve it. It corrected the issue on ubuntu-18.04 + extended-buildtools and with out. Lemme check centos as well.

Thanks Jeremy
Since, I merged the patch. Please send and incremental fix.

Quoted 62 lines · Khem Raj
Quoted 59 lines

sadly I am seeing this failure

https://errors.yoctoproject.org/Errors/Details/651342/

Quoted 54 lines · Jeremy Puhlman
Quoted 4 lines · Khem Raj

Thanks Jeremy

I wonder why we don't see it failing on AB or in my local testing. is it specific to some build host distro ?

I am seeing the same issue reported on ubuntu 18.04, centos 7 and 8, but its only with the extended buildtools.

Quoted 44 lines · Jeremy Puhlman
Quoted 43 lines

From: Jeremy Puhlman <[email protected]>

gcc abstract.o -Xlinker -L../../dist/lib -lplc4 -L../../dist/lib -lnspr4 -lpthread -o abstract
/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __libc_dlsym@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __pthread_unwind@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__libc_dlopen_mode@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getcpuclockid@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_nanosleep@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_settime@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getres@GLIBC_PRIVATE'

The linker is not correctly pulling in lrt as needed.

---
   meta-oe/recipes-support/nspr/nspr_4.29.bb | 2 ++
   1 file changed, 2 insertions(+)
meta-oe/recipes-support/nspr/nspr_4.29.bb +2 -1
index f224bcd34..2717f37bc 100644
@@ -160,6 +160,8 @@ PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
   # preferred path upstream.
   EXTRA_OECONF += "--includedir=${includedir}/nspr"
 
+EXTRA_OEMAKE:append:class-native = " EXTRA_LIBS='-lpthread -lrt'"
+
   do_compile:prepend() {
          oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX ${BUILD_CFLAGS}" LDFLAGS="" CC="${BUILD_CC}" -C config export
   }
--

2.31.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#95912): https://lists.openembedded.org/g/openembedded-devel/message/95912
Mute This Topic: https://lists.openembedded.org/mt/89670512/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#7 lore raw
Quoted 6 lines · Khem Raj
Quoted 3 lines · Jeremy Puhlman

Adding -ldl should resolve it. It corrected the issue on ubuntu-18.04 + extended-buildtools and with out. Lemme check centos as well.

Thanks Jeremy
Since, I merged the patch. Please send and incremental fix.

Patch sent. Seems to work fine in:
ubuntu 18.04 + extended-buildtools
ubuntu 18.04
ubuntu 20.04 + extended-buildtools
ubuntu 20.04
centos 8 + extended-buildtools
centos 8
centos 7 + extended-buildtools

Quoted 60 lines
Quoted 60 lines · Khem Raj
Quoted 58 lines

sadly I am seeing this failure

https://errors.yoctoproject.org/Errors/Details/651342/

Quoted 53 lines · Jeremy Puhlman
Quoted 4 lines · Khem Raj

Thanks Jeremy

I wonder why we don't see it failing on AB or in my local testing. is it specific to some build host distro ?

I am seeing the same issue reported on ubuntu 18.04, centos 7 and 8, but its only with the extended buildtools.

Quoted 44 lines · Jeremy Puhlman
Quoted 43 lines

From: Jeremy Puhlman <[email protected]>

gcc abstract.o -Xlinker -L../../dist/lib -lplc4 -L../../dist/lib -lnspr4 -lpthread -o abstract
/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __libc_dlsym@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to __pthread_unwind@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__libc_dlopen_mode@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getcpuclockid@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_nanosleep@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_settime@GLIBC_PRIVATE' /build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/11.2.0/../../../../x86_64-pokysdk-linux/bin/ld: /lib64/librt.so.1: undefined reference to `__clock_getres@GLIBC_PRIVATE'

The linker is not correctly pulling in lrt as needed.

---
    meta-oe/recipes-support/nspr/nspr_4.29.bb | 2 ++
    1 file changed, 2 insertions(+)
meta-oe/recipes-support/nspr/nspr_4.29.bb +2 -1
index f224bcd34..2717f37bc 100644
@@ -160,6 +160,8 @@ PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
    # preferred path upstream.
    EXTRA_OECONF += "--includedir=${includedir}/nspr"
 
+EXTRA_OEMAKE:append:class-native = " EXTRA_LIBS='-lpthread -lrt'"
+
    do_compile:prepend() {
           oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX ${BUILD_CFLAGS}" LDFLAGS="" CC="${BUILD_CC}" -C config export
    }
--

2.31.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#95912): https://lists.openembedded.org/g/openembedded-devel/message/95912
Mute This Topic: https://lists.openembedded.org/mt/89670512/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-