<?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>8291</bug_id>
          
          <creation_ts>2015-09-12 09:42:18 +0000</creation_ts>
          <short_desc>systemd fails to start when compiled with GCC 5.2</short_desc>
          <delta_ts>2015-10-13 11:20:09 +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.9</version>
          <rep_platform>All</rep_platform>
          <op_sys>arm</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>1.9</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jonathan Liu">net147</reporter>
          <assigned_to name="Jonathan Liu">net147</assigned_to>
          <cc>andrei</cc>
    
    <cc>bogdanx.a.voiculescu</cc>
    
    <cc>kergoth</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>ntl</cc>
    
    <cc>raj.khem</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
          
          <qa_contact name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</qa_contact>
          <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>53991</commentid>
    <comment_count>0</comment_count>
    <who name="Jonathan Liu">net147</who>
    <bug_when>2015-09-12 09:42:18 +0000</bug_when>
    <thetext>systemd image fails to start on Raspberry Pi 2 if using GCC 5.2.

Repository revisions
bitbake: 135dff67216759286f584e501583584a9cb09f27
openembedded-core: 56c5fa106eeccda2ca92dbeb73ff01ba40992e7d

It will try to start the following services, timeout after 90 seconds and keep trying to again to start the services:
* Journal Service
* udev Kernel Device Manager

Workarounds:
 * Change -O2 to -O1 in optimization flags for systemd recipe:
FULL_OPTIMIZATION_remove = &quot;-O2&quot;
FULL_OPTIMIZATION =+ &quot;-O1&quot;
 * Set GCCVERSION = &quot;4.9%&quot; to use GCC 4.9 in local.conf or distro conf</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53992</commentid>
    <comment_count>1</comment_count>
    <who name="Jonathan Liu">net147</who>
    <bug_when>2015-09-12 09:45:03 +0000</bug_when>
    <thetext>Same issue with both systemd 219 in master and systemd 225 from master-next.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53993</commentid>
    <comment_count>2</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2015-09-12 15:40:40 +0000</bug_when>
    <thetext>Can you try disabling lto with -fno-lto</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53996</commentid>
    <comment_count>3</comment_count>
    <who name="Jonathan Liu">net147</who>
    <bug_when>2015-09-12 21:54:40 +0000</bug_when>
    <thetext>The issue still persists with the following added to the recipe:
FULL_OPTIMIZATION += &quot;-fno-lto&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54009</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-09-14 11:09:17 +0000</bug_when>
    <thetext>Reassigning to Khem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54167</commentid>
    <comment_count>5</comment_count>
    <who name="Nathan Lynch">ntl</who>
    <bug_when>2015-09-16 15:55:48 +0000</bug_when>
    <thetext>Check whether adding -fno-ipa-sra to the compiler flags works around it?

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54177</commentid>
    <comment_count>6</comment_count>
    <who name="Jonathan Liu">net147</who>
    <bug_when>2015-09-16 22:46:55 +0000</bug_when>
    <thetext>The issue still persists with the following added to the recipe:
FULL_OPTIMIZATION += &quot;-fno-ipa-sra&quot;(In reply to comment #5)
&gt; Check whether adding -fno-ipa-sra to the compiler flags works around it?
&gt; 
&gt; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932

The issue still persists with the following added to the recipe:
FULL_OPTIMIZATION += &quot;-fno-ipa-sra&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54178</commentid>
    <comment_count>7</comment_count>
    <who name="Jonathan Liu">net147</who>
    <bug_when>2015-09-16 22:52:19 +0000</bug_when>
    <thetext>Adding both -fno-lto and -fno-ipa-sra doesn&apos;t work either:
FULL_OPTIMIZATION += &quot;-fno-lto -fno-ipa-sra&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54355</commentid>
    <comment_count>8</comment_count>
    <who name="Jonathan Liu">net147</who>
    <bug_when>2015-09-21 08:51:32 +0000</bug_when>
    <thetext>I have narrowed down the compiler optimizations.

Disabling 2 compiler optimizations as follows resolves the issues when compiling systemd with GCC 5.2:
FULL_OPTIMIZATION += &quot;-fno-schedule-insns -fno-schedule-insns2&quot;

Both optimizations need to be disabled. Disabling only one of them does not resolve the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54514</commentid>
    <comment_count>9</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-09-23 11:01:58 +0000</bug_when>
    <thetext>Merged in 338f18e5808ea0472350d0c26edd0938ffbdcd23.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54583</commentid>
    <comment_count>10</comment_count>
    <who name="Jonathan Liu">net147</who>
    <bug_when>2015-09-23 23:55:53 +0000</bug_when>
    <thetext>Looks like V1 of the patch was merged instead of V2 which makes it ARM-specific. Any reason in particular?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54595</commentid>
    <comment_count>11</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-09-24 08:02:41 +0000</bug_when>
    <thetext>Human error - master-next has a revert and V2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55247</commentid>
    <comment_count>12</comment_count>
    <who name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</who>
    <bug_when>2015-10-13 11:07:35 +0000</bug_when>
    <thetext>Verified with master e35c404537db0b46047fcb2ee7d3645e3e0935c5 
on BeagleBoneBlack board - ARMv7.

......
systemd[1]: systemd 225 running in system mode. (-PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN)
systemd[1]: Detected architecture arm.

Welcome to Poky (Yocto Project Reference Distro) 2.0 (jethro)!

systemd[1]: Set hostname to &lt;beaglebone&gt;.
.....</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>