* [ptxdist] [PATCH 1/3] host-ncurses: Fix build with gcc 5.1
2015-05-02 12:42 [ptxdist] gcc 5.1 fixes Bernhard Walle
@ 2015-05-02 12:42 ` Bernhard Walle
2015-05-02 12:42 ` [ptxdist] [PATCH 2/3] host-localedef: " Bernhard Walle
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Bernhard Walle @ 2015-05-02 12:42 UTC (permalink / raw)
To: ptxdist; +Cc: Bernhard Walle
The build of host-ncurses fails with following error:
| In file included from ../ncurses/curses.priv.h:283:0,
| from ../ncurses/lib_gen.c:19:
| _16905.c:835:15: error: expected ')' before 'int'
| ../include/curses.h:1594:56: note: in definition of macro 'mouse_trafo'
| #define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)
The problem is that the preprocessor emits additional line statements which
ncurses isn't prepared for. The problem is described in the gcc 5 porting
guide at https://gcc.gnu.org/gcc-5/porting_to.html. Adding the described
-P option to gcc invocations fixes that issue.
Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
---
rules/host-ncurses.make | 3 +++
1 file changed, 3 insertions(+)
diff --git a/rules/host-ncurses.make b/rules/host-ncurses.make
index 2218b7c..67dbf5b 100644
--- a/rules/host-ncurses.make
+++ b/rules/host-ncurses.make
@@ -21,6 +21,9 @@ HOST_PACKAGES-$(PTXCONF_HOST_NCURSES) += host-ncurses
# autoconf
#
HOST_NCURSES_CONF_TOOL := autoconf
+HOST_NCURSES_CONF_ENV := \
+ $(HOST_ENV) \
+ CPPFLAGS="-P"
HOST_NCURSES_CONF_OPT = \
$(HOST_AUTOCONF) \
$(NCURSES_AUTOCONF_SHARED)
--
2.3.7
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ptxdist] [PATCH 2/3] host-localedef: Fix build with gcc 5.1
2015-05-02 12:42 [ptxdist] gcc 5.1 fixes Bernhard Walle
2015-05-02 12:42 ` [ptxdist] [PATCH 1/3] host-ncurses: Fix build with gcc 5.1 Bernhard Walle
@ 2015-05-02 12:42 ` Bernhard Walle
2015-05-02 12:42 ` [ptxdist] [PATCH 3/3] host-mtd-utils: " Bernhard Walle
2015-05-04 8:49 ` [ptxdist] gcc 5.1 fixes Michael Olbrich
3 siblings, 0 replies; 5+ messages in thread
From: Bernhard Walle @ 2015-05-02 12:42 UTC (permalink / raw)
To: ptxdist; +Cc: Bernhard Walle
The build of host-localedef fails with lots of argp-related link errors:
| argp-help.o: In function `indent_to':
| argp-help.c:(.text+0x1335): undefined reference to `argp_fmtstream_point'
| argp-help.c:(.text+0x1352): undefined reference to `argp_fmtstream_putc'
| argp-help.o: In function `space':
| argp-help.c:(.text+0x137d): undefined reference to `argp_fmtstream_point'
| argp-help.c:(.text+0x13a5): undefined reference to `argp_fmtstream_putc'
| argp-help.c:(.text+0x13b8): undefined reference to `argp_fmtstream_putc'
| argp-help.o: In function `print_header':
| argp-help.c:(.text+0x1549): undefined reference to `argp_fmtstream_putc'
| argp-help.c:(.text+0x157f): undefined reference to `argp_fmtstream_set_lmargin'
| argp-help.c:(.text+0x159b): undefined reference to `argp_fmtstream_set_wmargin'
| argp-help.c:(.text+0x15b2): undefined reference to `argp_fmtstream_puts'
| argp-help.c:(.text+0x15c7): undefined reference to `argp_fmtstream_set_lmargin'
| argp-help.c:(.text+0x15dc): undefined reference to `argp_fmtstream_putc'
| argp-help.o: In function `comma':
| argp-help.c:(.text+0x167f): undefined reference to `argp_fmtstream_putc'
| argp-help.c:(.text+0x171e): undefined reference to `argp_fmtstream_set_wmargin'
| [...]
The problem is the change of the default C standard from gnu89 to gnu11
which changes the semantics of 'inline'. The issue is described in the
Porting guide at https://gcc.gnu.org/gcc-5/porting_to.html. Adding the
'-fgnu89-inline' option fixes the issue.
Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
---
rules/host-localedef.make | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/rules/host-localedef.make b/rules/host-localedef.make
index f3ccb87..29022e8 100644
--- a/rules/host-localedef.make
+++ b/rules/host-localedef.make
@@ -30,7 +30,8 @@ HOST_LOCALEDEF_DIR := $(HOST_BUILDDIR)/$(HOST_LOCALEDEF)
# ----------------------------------------------------------------------------
HOST_LOCALEDEF_PATH := PATH=$(HOST_PATH)
-HOST_LOCALEDEF_ENV := $(HOST_ENV)
+HOST_LOCALEDEF_ENV := $(HOST_ENV) \
+ CFLAGS="-fgnu89-inline -g -O2"
#
# autoconf
--
2.3.7
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ptxdist] [PATCH 3/3] host-mtd-utils: Fix build with gcc 5.1
2015-05-02 12:42 [ptxdist] gcc 5.1 fixes Bernhard Walle
2015-05-02 12:42 ` [ptxdist] [PATCH 1/3] host-ncurses: Fix build with gcc 5.1 Bernhard Walle
2015-05-02 12:42 ` [ptxdist] [PATCH 2/3] host-localedef: " Bernhard Walle
@ 2015-05-02 12:42 ` Bernhard Walle
2015-05-04 8:49 ` [ptxdist] gcc 5.1 fixes Michael Olbrich
3 siblings, 0 replies; 5+ messages in thread
From: Bernhard Walle @ 2015-05-02 12:42 UTC (permalink / raw)
To: ptxdist; +Cc: Bernhard Walle
The build of host-mtd-utils fails with link errors:
| ..../mkfs.ubifs/hashtable/hashtable_itr.o:
| In function `hashtable_iterator_key':
| ..../mkfs.ubifs/hashtable/hashtable_itr.c:43:
| multiple definition of `hashtable_iterator_key'
| ..../mkfs.ubifs/devtable.o:.../mkfs.ubifs/hashtable/hashtable_itr.h:34:
| first defined here
| ..../mkfs.ubifs/hashtable/hashtable_itr.o:
| In function `hashtable_iterator_key':
| ..../mkfs.ubifs/hashtable/hashtable_itr.c:43:
| multiple definition of `hashtable_iterator_value'
| ..../mkfs.ubifs/devtable.o:..../mkfs.ubifs/devtable.c:64:
| first defined here
The problem is the change of the default C standard from gnu89 to gnu11
which changes the semantics of 'inline'. The issue is described in the
Porting guide at https://gcc.gnu.org/gcc-5/porting_to.html. Adding the
'-fgnu89-inline' option fixes the issue.
Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
---
rules/host-mtd-utils.make | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/rules/host-mtd-utils.make b/rules/host-mtd-utils.make
index 64a0468..e6a57c3 100644
--- a/rules/host-mtd-utils.make
+++ b/rules/host-mtd-utils.make
@@ -25,7 +25,8 @@ HOST_MTD_UTILS_DIR = $(HOST_BUILDDIR)/$(MTD_UTILS)
HOST_MTD_UTILS_COMPILE_ENV := \
$(HOST_ENV) \
- WITHOUT_XATTR=1
+ WITHOUT_XATTR=1 \
+ CFLAGS="-fgnu89-inline -g -O2"
# don't use := here
HOST_MTD_UTILS_MAKEVARS = \
--
2.3.7
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ptxdist] gcc 5.1 fixes
2015-05-02 12:42 [ptxdist] gcc 5.1 fixes Bernhard Walle
` (2 preceding siblings ...)
2015-05-02 12:42 ` [ptxdist] [PATCH 3/3] host-mtd-utils: " Bernhard Walle
@ 2015-05-04 8:49 ` Michael Olbrich
3 siblings, 0 replies; 5+ messages in thread
From: Michael Olbrich @ 2015-05-04 8:49 UTC (permalink / raw)
To: ptxdist
On Sat, May 02, 2015 at 02:42:38PM +0200, Bernhard Walle wrote:
> After updating my host toolchain to gcc 5.1 (it's in Arch Linux testing), I
> cannot compile my ptxdist BSP any more. This are the fixes required to get it
> working again.
I've modified the patches a bit. Setting CFLAGS etc. in the environment has
caused problems in the past, so I try to avoid it. It works here (Debian
unstable with gcc 5.1) so hopefully I didn't break it for you.
Michael
--
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 |
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread