+2016-10-05 Martin Sebor <msebor@redhat.com>
+
+ PR bootstrap/77819
+ * config/linux.h (TARGET_PRINTF_POINTER_FORMAT): Define macro.
+ * config/linux.c (gnu_libc_printf_pointer_format): Remove.
+ * targhooks.c [DEFAULT_LIBC == LIBC_UCLIBC) && SINGLE_LIBC]
+ (default_printf_pointer_format): Define function.
+ * targhooks.c (linux_printf_pointer_format): Define new function.
+ * targhooks.h (linux_printf_pointer_format): Declare.
+ (gnu_libc_printf_pointer_format): Remove declaration.
+
2016-10-05 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* fold-const.c (native_encode_real): Fix logic for selecting offset
#include "tree.h"
#include "linux-protos.h"
-#undef TARGET_PRINTF_POINTER_FORMAT
-#define TARGET_PRINTF_POINTER_FORMAT gnu_libc_printf_pointer_format
-
bool
linux_libc_has_function (enum function_class fn_class)
{
return false;
}
-
-/* Glibc formats pointers as if by "%zx" except for the null pointer
- which outputs "(nil)". It ignores the pound ('#') format flag but
- interprets the space and plus flags the same as in the integer
- directive. */
-
-const char*
-gnu_libc_printf_pointer_format (tree arg, const char **flags)
-{
- *flags = " +";
-
- return arg && integer_zerop (arg) ? "(nil)" : "%#zx";
-}
#endif
-/* The format string to which "%p" corresponds. */
+/* The format string to which "%p" corresponds (same in Glibc and
+ uClibc. */
#undef TARGET_PRINTF_POINTER_FORMAT
-#define TARGET_PRINTF_POINTER_FORMAT gnu_libc_printf_pointer_format
+#define TARGET_PRINTF_POINTER_FORMAT linux_printf_pointer_format
return "%zx";
}
+/* For Glibc and uClibc targets also define the hook here because
+ otherwise it would have to be duplicated in each target's .c file
+ (such as in bfin/bfin.c and c6x/c6x.c, etc.)
+ Glibc and uClibc format pointers as if by "%zx" except for the null
+ pointer which outputs "(nil)". It ignores the pound ('#') format
+ flag but interprets the space and plus flags the same as in the integer
+ directive. */
+
+const char*
+linux_printf_pointer_format (tree arg, const char **flags)
+{
+ *flags = " +";
+
+ return arg && integer_zerop (arg) ? "(nil)" : "%#zx";
+}
+
tree
default_builtin_tm_load_store (tree ARG_UNUSED (type))
{
extern bool gnu_libc_has_function (enum function_class);
extern const char* default_printf_pointer_format (tree, const char **);
-extern const char* gnu_libc_printf_pointer_format (tree, const char **);
+extern const char* linux_printf_pointer_format (tree, const char **);
extern const char* solaris_printf_pointer_format (tree, const char **);
extern tree default_builtin_tm_load_store (tree);