diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-12-10 14:42:01 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-12-10 14:42:01 +0200 |
commit | 1f0aaece3ab7ab578de7e227ce46c45129b6b51e (patch) | |
tree | f1fa456954cda9cb3356c4fa5cd8031e59f73cfe /lib | |
parent | 645045a799bab1705cea533ba471b6ee21d08a36 (diff) | |
download | micropython-1f0aaece3ab7ab578de7e227ce46c45129b6b51e.tar.gz micropython-1f0aaece3ab7ab578de7e227ce46c45129b6b51e.zip |
lib/utils/printf: Apply workaround for static linking with uclibc.
uclibc objects call __GI_vsnprintf().
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/printf.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/utils/printf.c b/lib/utils/printf.c index 34bf3eb0fc..51dc0a86e0 100644 --- a/lib/utils/printf.c +++ b/lib/utils/printf.c @@ -102,6 +102,12 @@ STATIC void strn_print_strn(void *data, const char *str, size_t len) { strn_print_env->remain -= len; } +#ifdef __GNUC__ +// uClibc requires this alias to be defined, or there may be link errors +// when linkings against it statically. +int __GI_vsnprintf(char *str, size_t size, const char *fmt, va_list ap) __attribute__((weak, alias ("vsnprintf"))); +#endif + int vsnprintf(char *str, size_t size, const char *fmt, va_list ap) { strn_print_env_t strn_print_env = {str, size}; mp_print_t print = {&strn_print_env, strn_print_strn}; |