Package: dielibc
Version: 0.34~cvs20160606
Severity: important
Tags: sid + patch
Justification:
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,

Package tiny-initramfs FTBFS on mips64el with following error:
tiny_initramfs-nfs.o: In function `nfs4_ping':
/«PKGBUILDDIR»/build.standard/../nfs.c:398: undefined reference to `send'
/«PKGBUILDDIR»/build.standard/../nfs.c:401: undefined reference to `send'
/«PKGBUILDDIR»/build.standard/../nfs.c:421: undefined reference to `recv'
/«PKGBUILDDIR»/build.standard/../nfs.c:421: undefined reference to `recv'

build log:
https://buildd.debian.org/status/fetch.php?pkg=tiny-initramfs&arch=mips64el&ver=0.1-2&stamp=1465191375

It seems dietlibc doesn't provide send() and recv() functions for mips64el.
There are no syscalls or implementations for send() and recv() functions for 
mips64el.

I found out that for x86_64 there are no syscalls for send() and recv() 
functions, but
they are implemented as a wrapper around sendto() and recvfrom() funtions.
I did the same thing for mips64el, patch that contains needed changes is 
attached.

Using dietlibc built with mentioned patch I was able to build tiny-initramfs 
successfully for mips64el.
Could you please consider including this patch?

Regards,
Daniel
--- /dev/null
+++ dietlibc-0.34~cvs20160606/mips64/recv.c
@@ -0,0 +1,13 @@
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <linuxnet.h>
+
+int __libc_recv(int fd, void * buf, size_t n, int flags);
+  /* shut up gcc warning about missing prototype */
+
+int __libc_recv(int fd, void * buf, size_t n, int flags) {
+  return recvfrom(fd, buf, n, flags, 0, 0);
+}
+
+int recv(int a, void * b, size_t c, int flags)
+  __attribute__ ((weak, alias("__libc_recv")));
--- /dev/null
+++ dietlibc-0.34~cvs20160606/mips64/send.c
@@ -0,0 +1,13 @@
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <linuxnet.h>
+
+int __libc_send(int fd, const void * buf, size_t n, int flags);
+  /* shut up gcc warning about missing prototype */
+
+int __libc_send(int fd, const void * buf, size_t n, int flags) {
+  return sendto(fd, buf, n, flags, NULL, 0);
+}
+
+int send(int a, const void * b, size_t c, int flags)
+  __attribute__ ((weak, alias("__libc_send")));

Reply via email to