Skip to contentSkip to conversation

Fix recipes to build with uclibc

PATCH In review Khem Raj 4 participants 7 messages May 20, 2011

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

v2 cover Fix recipes to build with uclibc

This series addresses review from RP

The following changes since commit bcf6445c5e77ab3563dc2dfa56d17ae811eb813d:

  opkg_svn.bb: Install rcS.d into ${D} instead of ${IMAGE_ROOTFS} (2011-05-19 16:56:45 -0700)

are available in the git repository at:
[email protected]:openembedded-core-contrib.git kraj/uclibc
http://cgit.openembedded.org/cgit.cgi//log/?h=kraj/uclibc

Khem Raj (3):
uclibc/site_config/funcs: getloadavg is unimplemented distcc_2.18.3.bb: Fix compilation on uclibc nfs-utils_1.2.3.bb: Fix compile failure on uclibc

 .../nfs-utils/nfs-utils-1.0.6-uclibc.patch         |   16 +++++++-----
 .../nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch |   26 ++++++++++++++++++++
 .../nfs-utils/nfs-utils_1.2.3.bb                   |    1 +
 meta/recipes-core/uclibc/site_config/funcs         |    1 -
 meta/recipes-devtools/distcc/distcc_2.18.3.bb      |   15 +++++++----
 5 files changed, 46 insertions(+), 13 deletions(-)
 create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch
Signature · 1 line
1.7.4.1
author
#1 lore raw

PATCH v2 1/3 uclibc/site_config/funcs: getloadavg is unimplemented

---
 meta/recipes-core/uclibc/site_config/funcs |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
meta/recipes-core/uclibc/site_config/funcs +0 -1
index ccc8539..79a3c19 100644
@@ -121,7 +121,6 @@ gethostid
 gethostname
 getifaddrs
 getline
-getloadavg
 getmntent
 getmsg
 getnameinfo
Signature · 1 line
1.7.4.1
author
#2 lore raw

PATCH v2 2/3 distcc_2.18.3.bb: Fix compilation on uclibc

We enable gtk/gnome in distcc that code uses loadavg() a function unimplemented in uclibc. Therefore for uclibc we disable gnome and gtk+ features in distcc

---
 meta/recipes-devtools/distcc/distcc_2.18.3.bb |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
meta/recipes-devtools/distcc/distcc_2.18.3.bb +10 -5
index 1f5c2af..e73ce16 100644
@@ -6,7 +6,8 @@ LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 PR = "r6"
 
-DEPENDS = "avahi gtk+"
+DEPENDS = "avahi"
+DEPENDS_append-libc-glibc = " gtk+ "
 RRECOMMENDS_${PN} = "avahi-daemon"
 
 # Upstream change this patch periodically so store locally
@@ -24,17 +25,21 @@ inherit autotools pkgconfig update-rc.d
 
 INITSCRIPT_NAME = "distcc"
 
-EXTRA_OECONF = " --with-gtk "
-
+EXTRA_OECONF_libc-glibc = " --with-gtk "
+EXTRA_OECONF_libc-uclibc = " --without-gtk --without-gnome "
 do_install_append() {
     install -d ${D}${sysconfdir}/init.d/
     install -d ${D}${sysconfdir}/default
     install -m 0755 ${WORKDIR}/distcc ${D}${sysconfdir}/init.d/
     install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/distcc
+    ${DESKTOPINSTALL}
+}
+DESKTOPINSTALL = ""
+DESKTOPINSTALL_libc-glibc () {
+    install -d ${D}${datadir}/distcc/
     install -m 0644 ${WORKDIR}/distccmon-gnome.desktop ${D}${datadir}/distcc/
 }
-
-PACKAGES += "distcc-distmon-gnome"
+PACKAGES_append_libc-glibc = " distcc-distmon-gnome"
 
 FILES_${PN} = " ${sysconfdir} \
 		${bindir}/distcc \
Signature · 1 line
1.7.4.1
#3 lore raw

Re: [PATCHv2 2/3] distcc_2.18.3.bb: Fix compilation on uclibc

meta/recipes-devtools/distcc/distcc_2.18.3.bb LICENSE = "GPLv2" · line 10

Quoted 3 lines · Khem Raj
meta/recipes-devtools/distcc/distcc_2.18.3.bb +2 -1
-DEPENDS = "avahi gtk+"
+DEPENDS = "avahi"
+DEPENDS_append-libc-glibc = " gtk+ "

If uclibc is alone in not having this function then it would be better as:

gtkdepends = "gtk+"
gtkdepends_libc-uclibc = ""
DEPENDS = "avahi ${gtkdepends}"

or some such.

p.

#4 lore raw

Re: [PATCHv2 2/3] distcc_2.18.3.bb: Fix compilation on uclibc

In reply to Khem Raj
Quoted 8 lines · Khem Raj

We enable gtk/gnome in distcc that code uses loadavg() a function unimplemented in uclibc. Therefore for uclibc we disable gnome and gtk+ features in distcc

---
 meta/recipes-devtools/distcc/distcc_2.18.3.bb |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

As Phil mentions, uclibc should probably be the exception here, not glibc. I've therefore not taken it yet to see if we can come up with anything better...

Cheers,

Richard

Quoted 40 lines
meta/recipes-devtools/distcc/distcc_2.18.3.bb +10 -5
index 1f5c2af..e73ce16 100644
@@ -6,7 +6,8 @@ LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 PR = "r6"
 
-DEPENDS = "avahi gtk+"
+DEPENDS = "avahi"
+DEPENDS_append-libc-glibc = " gtk+ "
 RRECOMMENDS_${PN} = "avahi-daemon"
 
 # Upstream change this patch periodically so store locally
@@ -24,17 +25,21 @@ inherit autotools pkgconfig update-rc.d
 
 INITSCRIPT_NAME = "distcc"
 
-EXTRA_OECONF = " --with-gtk "
-
+EXTRA_OECONF_libc-glibc = " --with-gtk "
+EXTRA_OECONF_libc-uclibc = " --without-gtk --without-gnome "
 do_install_append() {
     install -d ${D}${sysconfdir}/init.d/
     install -d ${D}${sysconfdir}/default
     install -m 0755 ${WORKDIR}/distcc ${D}${sysconfdir}/init.d/
     install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/distcc
+    ${DESKTOPINSTALL}
+}
+DESKTOPINSTALL = ""
+DESKTOPINSTALL_libc-glibc () {
+    install -d ${D}${datadir}/distcc/
     install -m 0644 ${WORKDIR}/distccmon-gnome.desktop ${D}${datadir}/distcc/
 }
-
-PACKAGES += "distcc-distmon-gnome"
+PACKAGES_append_libc-glibc = " distcc-distmon-gnome"
 
 FILES_${PN} = " ${sysconfdir} \
 		${bindir}/distcc \
author
#5 lore raw

PATCH v3 3/3 nfs-utils_1.2.3.bb: Fix compile failure on uclibc

In reply to Khem Raj

libio.h is not needed even in case of eglibc but
still the patch is uclibc specific

Refreshed nfs-utils-1.0.6-uclibc.patch against
nfs-utils_1.2.3 no code change

---
 .../nfs-utils/nfs-utils-1.0.6-uclibc.patch         |   16 +++++++-----
 .../nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch |   26 ++++++++++++++++++++
 .../nfs-utils/nfs-utils_1.2.3.bb                   |    1 +
 3 files changed, 36 insertions(+), 7 deletions(-)
 create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch
meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch +9 -7
index e82480a..6d46d3a 100644
@@ -1,20 +1,22 @@
 Upstream-Status: Inappropriate [embedded specific]
 
---- ./support/nfs/svc_socket.c.orig	2004-12-12 06:43:52.000000000 +0000
-+++ ./support/nfs/svc_socket.c	2004-12-12 06:50:04.000000000 +0000
-@@ -66,6 +66,7 @@
-   memset ((char *) &addr, sizeof (addr));
+Index: nfs-utils-1.2.3/support/nfs/svc_socket.c
+===================================================================
+--- nfs-utils-1.2.3.orig/support/nfs/svc_socket.c
++++ nfs-utils-1.2.3/support/nfs/svc_socket.c
+@@ -67,6 +67,7 @@ svc_socket (u_long number, int type, int
+   memset (&addr, 0, sizeof (addr));
    addr.sin_family = AF_INET;
  
 +#ifndef __UCLIBC__	/* neither getrpcbynumber() nor getrpcbynumber_r() is SuSv3 */
    ret = getrpcbynumber_r (number, &rpcbuf, rpcdata, sizeof rpcdata,
  			  &rpcp);
    if (ret == 0 && rpcp != NULL)
-@@ -99,6 +100,7 @@
+@@ -100,6 +101,7 @@ svc_socket (u_long number, int type, int
  	}
      }
    else
 +#endif
      {
-       if (bindresvport (sock, &addr))
- 	{
+ 	  addr.sin_port = 0;
+ 	  if (bind (sock, (struct sockaddr *) &addr, len) < 0)
meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch new file +26 -0
new file mode 100644
index 0000000..465144a
@@ -0,0 +1,26 @@
+[PATCH] fix build with uClibc
+
+uClibc doesn't have/need libio.h, so don't include it from sockaddr.h
+
+Signed-off-by: Peter Korsgaard <[email protected]>
+---
+ support/include/sockaddr.h |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+Upstream-Status: Pending
+
+Index: nfs-utils-1.2.3/support/include/sockaddr.h
+===================================================================
+--- nfs-utils-1.2.3.orig/support/include/sockaddr.h
++++ nfs-utils-1.2.3/support/include/sockaddr.h
+@@ -20,7 +20,10 @@
+ #ifndef NFS_UTILS_SOCKADDR_H
+ #define NFS_UTILS_SOCKADDR_H
+ 
++/* uClibc doesn't have/need libio.h */
++#ifndef __UCLIBC__
+ #include <libio.h>
++#endif
+ #include <stdbool.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.3.bb +1 -0
index b456474..d344f3d 100644
@@ -17,6 +17,7 @@ PR = "r2"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/nfs/nfs-utils-${PV}.tar.bz2 \
            file://nfs-utils-1.0.6-uclibc.patch \
+           file://nfs-utils-1.2.3-uclibc-libio.h.patch \
            file://nfsserver"
 
 SRC_URI[md5sum] = "1131dc5f27c4f3905a6e7ee0d594fd4d"
Signature · 1 line
1.7.4.1
#6 lore raw
In reply to Khem Raj
Quoted 4 lines · Khem Raj

This series addresses review from RP

The following changes since commit bcf6445c5e77ab3563dc2dfa56d17ae811eb813d:

Quoted 8 lines
   opkg_svn.bb: Install rcS.d into ${D} instead of ${IMAGE_ROOTFS} (2011-05-19 16:56:45 -0700)

are available in the git repository at:
[email protected]:openembedded-core-contrib.git kraj/uclibc
http://cgit.openembedded.org/cgit.cgi//log/?h=kraj/uclibc

Khem Raj (3):
uclibc/site_config/funcs: getloadavg is unimplemented

Pulled

Quoted 1 line

distcc_2.18.3.bb: Fix compilation on uclibc

Not pulled - See Phil's comments

Quoted 2 lines

nfs-utils_1.2.3.bb: Fix compile failure on uclibc

Pulled

Thanks
Sau!

Quoted 8 lines
  .../nfs-utils/nfs-utils-1.0.6-uclibc.patch         |   16 +++++++-----
  .../nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch |   26 ++++++++++++++++++++
  .../nfs-utils/nfs-utils_1.2.3.bb                   |    1 +
  meta/recipes-core/uclibc/site_config/funcs         |    1 -
  meta/recipes-devtools/distcc/distcc_2.18.3.bb      |   15 +++++++----
  5 files changed, 46 insertions(+), 13 deletions(-)

create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch