Package: dietlibc-dev
Version: 0.33~cvs20120325-4
I found that dietlibc doesn't provide sqrt() function.
The following program shows the problem.
% cat tst.c
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
int main(int argc, char *argv[])
{
double x = sqrt(atof(argv[1]));
printf("%f\n", x);
return 0;
}
% diet gcc tst.c -lm
/usr/lib/diet/lib-x86_64/libc.a(vprintf.o): In function `vprintf':
vprintf.c:(.text+0x3e): warning: warning: the printf functions add
several kilobytes of bloat.
/tmp/ccvVL6p9.o: In function `main':
tst.c:(.text+0x35): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
zsh: exit 1 diet gcc tst.c -lm
It seems libm.a doesn't have sqrt definition.
(Several references to sqrt are exists, though.)
% nm /usr/lib/diet/lib/libm.a|grep sqrt
U sqrt
U sqrt
U sqrt
% grep sqrt /usr/lib/diet/lib/*
Binary file /usr/lib/diet/lib/libm.a matches
% dpkg -l|grep dietlibc
ii dietlibc-dev 0.33~cvs20120325-4
amd64 diet libc - a libc optimized for small size
% lsb_release -idrc
Distributor ID: Debian
Description: Debian GNU/Linux 7.0 (wheezy)
Release: 7.0
Codename: wheezy