most xxx_defconfig stop linking when console support set to CONSOLE_NONE
Sascha Hauer
s.hauer at pengutronix.de
Tue Oct 7 23:08:29 PDT 2014
Hi Kevin,
On Wed, Oct 08, 2014 at 01:42:36PM +0800, Kevin Du Huanpeng wrote:
>
> I am confusing with CONSOLE_NONE, what is it mean?
> 1. the board don't have a console?
> is the board still can have a serial port, but not accepts input?
> 2. where should the debug messages go?
> the serial port is not a console but
> when CONSOLE_NONE defined, printf just a nothing but return a 0,
> but the pr_print() declared but not defined.
CONSOLE_NONE is for boards which a) Don't have anything usable for
console or b) have a console but you want to build a quiet,
non-interactive barebox. The idea is to drop all the strings from the
binary to make it smaller.It seems noone ever used CONSOLE_NONE, so it
bitrotted. The following patch fixes this.
Sascha
----------------------------8<---------------------------
>From fbb191fd416de27148bc977c320e07c95b4ca36c Mon Sep 17 00:00:00 2001
From: Sascha Hauer <s.hauer at pengutronix.de>
Date: Wed, 8 Oct 2014 08:05:44 +0200
Subject: [PATCH] console: Fix CONSOLE_NONE support
Without console support we need a static inline version of
pr_print and dev_printf, otherwise we get link errors.
Reported-by: Kevin Du Huanpeng <u74147 at gmail.com>
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
include/printk.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/printk.h b/include/printk.h
index fb63586..22c6c73 100644
--- a/include/printk.h
+++ b/include/printk.h
@@ -21,11 +21,23 @@
/* debugging and troubleshooting/diagnostic helpers. */
+#ifndef CONFIG_CONSOLE_NONE
int pr_print(int level, const char *format, ...)
__attribute__ ((format(__printf__, 2, 3)));
int dev_printf(int level, const struct device_d *dev, const char *format, ...)
__attribute__ ((format(__printf__, 3, 4)));
+#else
+static inline int pr_print(int level, const char *format, ...)
+{
+ return 0;
+}
+
+static inline int dev_printf(int level, const struct device_d *dev, const char *format, ...)
+{
+ return 0;
+}
+#endif
#define __dev_printf(level, dev, format, args...) \
({ \
--
2.1.0
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list