<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>7870</bug_id>
          
          <creation_ts>2015-06-10 07:29:17 +0000</creation_ts>
          <short_desc>GCC 5.0 or later causes ncurses build to fail</short_desc>
          <delta_ts>2015-10-15 10:24:39 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>1.8</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.8.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Martin Stolpe">martin.stolpe</reporter>
          <assigned_to name="Martin Stolpe">martin.stolpe</assigned_to>
          <cc>jku</cc>
    
    <cc>martin.stolpe</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>51596</commentid>
    <comment_count>0</comment_count>
      <attachid>2542</attachid>
    <who name="Martin Stolpe">martin.stolpe</who>
    <bug_when>2015-06-10 07:29:17 +0000</bug_when>
    <thetext>Created attachment 2542
add -P to BUILD_CPPFLAGS

When gcc 5.0 or greater is installed on the development PC the build of ncurses will fail because gcc&apos;s preprocessor will add line markers which are not expected by the ncurses sed/awk scripts.

Adding &quot;-P&quot; to the CFLAGS will prohibit the insertion of line markers: https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51597</commentid>
    <comment_count>1</comment_count>
    <who name="Martin Stolpe">martin.stolpe</who>
    <bug_when>2015-06-10 07:47:23 +0000</bug_when>
    <thetext>This is the error message without the patch:
| In file included from /home/martin/projects/beaglebone/yocto/poky-fido/build-raspi/tmp/work/x86_64-linux/ncurses-native/5.9-r15.1/ncurses-5.9/ncurses/curses.priv.h:283:0,
|                  from ../ncurses/lib_gen.c:19:
| _22724.c:835:15: error: expected &apos;)&apos; before &apos;int&apos;
| ../include/curses.h:1594:56: note: in definition of macro &apos;mouse_trafo&apos;
|  #define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)
|                                                         ^
| gcc  -DHAVE_CONFIG_H -I../ncurses -I/home/martin/projects/beaglebone/yocto/poky-fido/build-raspi/tmp/work/x86_64-linux/ncurses-native/5.9-r15.1/ncurses-5.9/ncurses -isystem/home/martin/projects/beaglebone/yocto/poky-fido/build-raspi/tmp/sysroots/x86_64-linux/usr/include -D_GNU_SOURCE -DNDEBUG -I. -I../include -I/home/martin/projects/beaglebone/yocto/poky-fido/build-raspi/tmp/work/x86_64-linux/ncurses-native/5.9-r15.1/ncurses-5.9/ncurses/../include -I/home/martin/projects/beaglebone/yocto/poky-fido/build-raspi/tmp/sysroots/x86_64-linux/usr/include -isystem/home/martin/projects/beaglebone/yocto/poky-fido/build-raspi/tmp/sysroots/x86_64-linux/usr/include -D_GNU_SOURCE -O2 -pipe  --param max-inline-insns-single=1200 -fPIC -c /home/martin/projects/beaglebone/yocto/poky-fido/build-raspi/tmp/work/x86_64-linux/ncurses-native/5.9-r15.1/ncurses-5.9/ncurses/base/lib_hline.c -o ../obj_s/lib_hline.o
| Makefile:1682: recipe for target &apos;../obj_s/lib_gen.o&apos; failed
| make[1]: *** [../obj_s/lib_gen.o] Error 1
| make[1]: *** Waiting for unfinished jobs....
| make[1]: Leaving directory &apos;/home/martin/projects/beaglebone/yocto/poky-fido/build-raspi/tmp/work/x86_64-linux/ncurses-native/5.9-r15.1/build/narrowc/ncurses&apos;
| Makefile:134: recipe for target &apos;libs&apos; failed
| make: *** [libs] Error 2
| make: Leaving directory &apos;/home/martin/projects/beaglebone/yocto/poky-fido/build-raspi/tmp/work/x86_64-linux/ncurses-native/5.9-r15.1/build/narrowc&apos;
| ERROR: oe_runmake failed
| WARNING: /home/martin/projects/beaglebone/yocto/poky-fido/build-raspi/tmp/work/x86_64-linux/ncurses-native/5.9-r15.1/temp/run.do_compile.22631:1 exit 1 from
|   exit 1
| ERROR: Function failed: do_compile (log file is located at /home/martin/projects/beaglebone/yocto/poky-fido/build-raspi/tmp/work/x86_64-linux/ncurses-native/5.9-r15.1/temp/log.do_compile.22631)
ERROR: Task 6 (virtual:native:/home/martin/projects/beaglebone/yocto/poky-fido/meta/recipes-core/ncurses/ncurses_5.9.bb, do_compile) failed with exit code &apos;1&apos;

This is the part of the generated lib_gen.c which causes the error:
# 835 &quot;_22724.c&quot; 3 4
NCURSES_BOOL 
# 835 &quot;_22724.c&quot;
 mouse_trafo (int * a1, int * a2, 
# 835 &quot;_22724.c&quot; 3 4
 NCURSES_BOOL 
# 835 &quot;_22724.c&quot;
 z)
{
	T((T_CALLED(&quot;mouse_trafo(%p,%p,%#lx)&quot;), (const void *)a1, (const void *)a2, (long)z)); returnBool(wmouse_trafo(stdscr,a1,a2,z));
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51600</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-06-10 09:12:48 +0000</bug_when>
    <thetext>We don&apos;t normally take patches via bugzilla.  Can you send it to openembedded-core@lists.openembedded.org with your signed-off-by and a commit message that follows the guidelines (&quot;ncurses: fix native builds when host has gcc5&quot;).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51601</commentid>
    <comment_count>3</comment_count>
    <who name="Martin Stolpe">martin.stolpe</who>
    <bug_when>2015-06-10 09:17:33 +0000</bug_when>
    <thetext>I&apos;m not sure if this is the correct way to fix this problem like I did in the patch. Should I send the patch to the list anyway and wait for the responses?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51602</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-06-10 09:36:10 +0000</bug_when>
    <thetext>The patch is right afaik.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51615</commentid>
    <comment_count>5</comment_count>
    <who name="Martin Stolpe">martin.stolpe</who>
    <bug_when>2015-06-10 13:54:17 +0000</bug_when>
    <thetext>Ok, I have send the patch to the mailing list but it seems this was fixed in master by updating ncurses to the newest version.

Is there any chance this patch can be applied to the fido branch so that ncurses will compile with gcc &gt;= 5.0? I guess it is not very likely that ncurses will be updated in fido.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51616</commentid>
    <comment_count>6</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-06-10 13:55:49 +0000</bug_when>
    <thetext>Right, I just asked that exact question.  Rebase the patch against fido and resend it with a [fido] tag in the subject.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55346</commentid>
    <comment_count>7</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2015-10-15 10:24:39 +0000</bug_when>
    <thetext>$ git log -1 origin/fido ../meta/recipes-core/ncurses/ncurses.inc
commit e118d980dab4a0872fe232c17a2305e899b48b87
Author: Martin Stolpe &lt;martinstolpe@gmail.com&gt;
Date:   Wed Jun 10 16:28:26 2015 +0200

    ncurses: fix native builds when host has gcc5
    
    GCC&quot;s preprocessor starts to add newlines which are not
    handled properly by ncurses build system startin from
    version 5.0.
    
    See also: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7870
    
    (From OE-Core rev: 3a5435b371c84ec28b6936b8c8fa6541a592d061)
    
    Signed-off-by: Martin Stolpe &lt;martin.stolpe@gmail.com&gt;
    Signed-off-by: Joshua Lock &lt;joshua.lock@collabora.co.uk&gt;
    Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>2542</attachid>
            <date>2015-06-10 07:29:17 +0000</date>
            <delta_ts>2015-06-10 09:10:38 +0000</delta_ts>
            <desc>add -P to BUILD_CPPFLAGS</desc>
            <filename>0001-Prevent-GCC-preprocessor-from-adding-line-markers-to.patch</filename>
            <type>text/plain</type>
            <size>923</size>
            <attacher name="Martin Stolpe">martin.stolpe</attacher>
            
              <data encoding="base64">RnJvbSA5MDlkY2U0ZmJlNjk4ZGYxOGZiNzkzMmU1OWJjZjc1NGM5YTRjNzFiIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXJ0aW4gU3RvbHBlIDxtYXJ0aW4uc3RvbHBlQGdtYWlsLmNv
bT4KRGF0ZTogV2VkLCAxMCBKdW4gMjAxNSAwOToxNzoyMSArMDIwMApTdWJqZWN0OiBbUEFUQ0hd
IFByZXZlbnQgR0NDIHByZXByb2Nlc3NvciBmcm9tIGFkZGluZyBsaW5lIG1hcmtlcnMgdG8gdGhl
CiBnZW5lcmF0ZWQgZmlsZXMKCi0tLQogbWV0YS9yZWNpcGVzLWNvcmUvbmN1cnNlcy9uY3Vyc2Vz
LmluYyB8IDIgKy0KIDEgZmlsZSBjaGFuZ2VkLCAxIGluc2VydGlvbigrKSwgMSBkZWxldGlvbigt
KQoKZGlmZiAtLWdpdCBhL21ldGEvcmVjaXBlcy1jb3JlL25jdXJzZXMvbmN1cnNlcy5pbmMgYi9t
ZXRhL3JlY2lwZXMtY29yZS9uY3Vyc2VzL25jdXJzZXMuaW5jCmluZGV4IDEwZjdkZDEuLmE3YTI2
NWQgMTAwNjQ0Ci0tLSBhL21ldGEvcmV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