Package: dietlibc
Version: 0.31-1.2
Severity: normal
Tags: patch

Hello,

this is a forward of the Ubuntu bug
https://bugs.launchpad.net/ubuntu/+source/dietlibc/+bug/381215

While trying to build mksh in Ubuntu karmic (with gcc 4.4) it failed at
the linking stage with "undefined reference to
`__builtin_stdarg_start'".

Here is a test-case (copied from the bug):

tgl...@tglase:~$ gcc test.c
tgl...@tglase:~$ ./a.out
'./a.out' called with 1 args
tgl...@tglase:~$ rm a.out
tgl...@tglase:~$ diet gcc test.c
/usr/lib/diet/lib-i386/libc.a(vprintf.o): In function `vprintf':
vprintf.c:(.text+0x20): warning: warning: the printf functions add
several kilobytes of bloat.
/tmp/cccpAo38.o: In function `printfoo':
test.c:(.text+0x14): undefined reference to `__builtin_stdarg_start'
collect2: ld returned 1 exit status
tgl...@tglase:~$ cat test.c
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>

void printfoo(const char *, ...);

void
printfoo(const char *fmt, ...)
{
        va_list va;

        va_start(va, fmt);
        if (vprintf(fmt, va) < 0)
                abort();
        va_end(va);
}

int
main(int argc, char *argv[])
{
        printfoo("'%s' called with %d args\n", argv[0], argc);
}

And here the proposed patch for it:

--- dietlibc-0.31.orig/debian/diff/0901-fix-stdarg-gcc44.diff
+++ dietlibc-0.31/debian/diff/0901-fix-stdarg-gcc44.diff
@@ -0,0 +1,15 @@
+diff -pruN dietlibc-0.31.orig/include/stdarg.h
dietlibc-0.31/include/stdarg.h
+--- dietlibc-0.31.orig/include/stdarg.h        2009-05-28
10:53:06.000000000 +0200
++++ dietlibc-0.31/include/stdarg.h     2009-05-28 10:55:12.000000000
+0200
+@@ -9,7 +9,11 @@ __BEGIN_DECLS
+ #if (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 96))
+ 
+ typedef __builtin_va_list va_list;
++#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4))
++#define va_start(v,l) __builtin_va_start((v),l)
++#else
+ #define va_start(v,l) __builtin_stdarg_start((v),l)
++#endif
+ #define va_end                __builtin_va_end
+ #define va_arg                __builtin_va_arg
+ #define __va_copy(d,s)        __builtin_va_copy((d),(s))

(skipped the changelog entry from
http://launchpadlibrarian.net/27233139/dietlibc_0.31-1.2ubuntu2.debdiff)

After applying this patch to dietlibc mksh built fine in my Ubuntu
karmic pbuilder.

Regards,
Michael



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to