The problem here was that #defining printf catches all usages of the
word printf. We only want to #define printf when it is used as a
function.
This popped up when libgomp failed to build, complaining that
"akaros_printf" is not a format function. What's going on is that
somewhere in libgomp they are doing an __atttribute__ ((format (printf,
1, 2))), which marks a function as a printf-style function. The word
'printf' in there is getting expanded to akaros_printf, and gcc rejects
that. (For more info on that, check out
https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Function-Attributes.html).
Removing parlib/stdio.h from parlib/common.h wouldn't really fix this.
It would, in the short term, but eventually libgomp would need to
#include parlib/stdio.h, since it probably will use some 2LS / vcore
feature and want to do a printf.
Rebuild glibc.
Signed-off-by: Barret Rhoden <
br...@cs.berkeley.edu>
---
user/parlib/include/stdio.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/user/parlib/include/stdio.h b/user/parlib/include/stdio.h
index c799b43bb762..9395aa5a87df 100644
--- a/user/parlib/include/stdio.h
+++ b/user/parlib/include/stdio.h
@@ -33,7 +33,7 @@ int ros_vdebug(const char *fmt, va_list);
* otherwise. */
int akaros_printf(const char *format, ...);
#undef printf
-#define printf akaros_printf
+#define printf(args...) akaros_printf(args)
__END_DECLS
--
2.6.0.rc2.230.g3dd15c0