[Buildroot] Strange: MIPS, librt, malloc

ANDY KENNEDY ANDY.KENNEDY at adtran.com
Fri Feb 25 20:47:48 UTC 2011


Given the following code:

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
        void *mem;

        mem = malloc(1);
        printf("Hello world\n");
        return 0;
}

and the build command:

../../../buildroot/output/host/usr/bin/mips-unknown-linux-uclibc-gcc -o
test -g -Wall test.c

Everything works as you would expect.  However, if I use the following
build command:

../../../buildroot/output/host/usr/bin/mips-unknown-linux-uclibc-gcc -o
test -g -Wall test.c -lrt


malloc never returns and I sit in the _pthread_cleanup_push_defer()
while (1) loop.


If I remove the malloc(), I get Hello World but never return.


Where do I start tracking this problem down?  Anyone else have this
issue?

Thanks,
Andy


More information about the buildroot mailing list