Modify

Opened 7 years ago

Closed 6 years ago

#8773 closed defect (fixed)

luci\ntpclient doesn't have dependency on pthread

Reported by: exxon Owned by: developers
Priority: normal Milestone: Backfire 10.03.1
Component: packages Version: Trunk
Keywords: Cc:

Description

luci\ntpclient doesn't have dependency on pthread. but according to syslog definitely needs it

--- log start ---
Mar 26 19:44:03 wl500gp user.info sysinit: adjtimex: can't load library 'libpthread.so.0'
Mar 26 19:44:03 wl500gp user.info sysinit: /usr/sbin/ntpclient: can't load library 'libpthread.so.0'
Mar 26 19:44:03 wl500gp user.info sysinit: /usr/sbin/ntpclient: can't load library 'libpthread.so.0'
Mar 26 19:44:03 wl500gp user.info sysinit: /usr/sbin/ntpclient: can't load library 'libpthread.so.0'
Mar 26 19:44:03 wl500gp user.info sysinit: /usr/sbin/ntpclient: can't load library 'libpthread.so.0'
--- log end ---

adding it to build manually resolves the problem

Attachments (0)

Change History (7)

comment:1 Changed 7 years ago by Mark Mentovai <mark@…>

root@OpenWrt:~# ldd /usr/sbin/ntpclient
        librt.so.0 => /lib/librt.so.0 (0x2aac0000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x2aad4000)
        libc.so.0 => /lib/libc.so.0 (0x2aaf4000)
        libdl.so.0 => /lib/libdl.so.0 (0x2ab6f000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x2ab82000)
        ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x2aaa8000)
root@OpenWrt:~# ldd /lib/librt.so.0
        libc.so.0 => /lib/libc.so.0 (0x2aac0000)
        libdl.so.0 => /lib/libdl.so.0 (0x2ab3b000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x2ab4e000)
        ld-uClibc.so.0 => /lib//ld-uClibc.so.0 (0x2aaa8000)
root@OpenWrt:~# ldd /lib/libpthread.so.0
        libdl.so.0 => /lib/libdl.so.0 (0x2aac0000)
        libc.so.0 => /lib/libc.so.0 (0x2aad3000)
        ld-uClibc.so.0 => /lib//ld-uClibc.so.0 (0x2aaa8000)

ntpclient itself doesn’t have a dependency on libpthread, but it does depend on librt. librt depends on libpthread, but the base-files Makefile has it backwards: it lists libpthread depending on librt.

This patch should get things going:

Index: package/base-files/Makefile
===================================================================
--- package/base-files/Makefile	(revision 25306)
+++ package/base-files/Makefile	(working copy)
@@ -197,7 +197,6 @@
 define Package/libpthread
 $(call Package/libc/Default)
   TITLE:=POSIX thread library
-  DEPENDS:= +librt
 endef
 
 define Package/libpthread/config
@@ -224,6 +223,7 @@
 define Package/librt
 $(call Package/libc/Default)
   TITLE:=POSIX.1b RealTime extension library
+  DEPENDS:=+libpthread
 endef
 
 define Package/librt/config

This is correct at least for uClibc 0.9.32 (actually 0.9.32-rc2-git). I don’t know if the dependency needs to be flipped the other way for other versions.

comment:2 Changed 7 years ago by Mark Mentovai <mark@…>

I just checked uClibc 0.9.31 and 0.9.30.1, the two other uClibc versions that OpenWrt can be configured to use. In both of those versions, librt does not depend on libpthread, and libpthread does not depend on librt.

This bug is new (for default version selections) with r25187, which changed the default uClibc version to 0.9.32-rc2-git. In that version, librt depends on libpthread.

The correct fix is to remove libpthread’s dependency on librt, and to make librt depend on libpthread only for uClibc 0.9.32 and up. However, I’m not sure how much energy is being invested in maintaining the older uClibc versions. The patch above would be correct for uClibc 0.9.32 and would create a harmless (albeit unnecessary) dependency for earlier versions.

comment:3 Changed 7 years ago by Nilfred <nilfred@…>

Simple workaround: opkg install libpthread

comment:4 Changed 7 years ago by Nilfred <nilfred@…>

Forget about the workaround, installing libpthread get a non-working ntpclient. Workaround for the workaround:

opkg --force-removal-of-essential-packages remove libpthread

comment:5 Changed 7 years ago by Mark Mentovai <mark@…>

comment:6 Changed 7 years ago by Mark Mentovai <mark@…>

Fixed in trunk r25548.

comment:7 Changed 6 years ago by nico

  • Resolution set to fixed
  • Status changed from new to closed

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.