This is similar to my fix for testsuite/test-expandargv.c last week. I'm still not sure why this does not trigger on GNU/Linux distributions, or earlier version of FreeBSD. On FreeBSD 10 one does need to #include <unistd.h> to get getpagesize which is used by the test.
With this, the test now compiles on my i386-unknown-freebsd10.0 tester; without it, it doesn't. Okay? Gerald 2013-10-26 Gerald Pfeifer <ger...@pfeifer.com> * testsuite/test-demangle.c: Include unistd.h. Index: libiberty/testsuite/test-demangle.c =================================================================== --- libiberty/testsuite/test-demangle.c (revision 204095) +++ libiberty/testsuite/test-demangle.c (working copy) @@ -32,6 +32,9 @@ #if HAVE_STDLIB_H # include <stdlib.h> #endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif struct line {