Did you define a value for LIBDEF_REENTRANT_PRINTF?
E.g. Did you use:
-dLIBDEF_REENTRANT_PRINTF=1
Just defining the macro with no value does not build.
Also make sure to move printf.c in the link order before the ansi library (and ignore the warnings about the second printf implementation in the ansi library)
Daiel