<?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>5628</bug_id>
          
          <creation_ts>2013-12-05 07:46:19 +0000</creation_ts>
          <short_desc>Building libgcrypt failed if TMPDIR conatins &apos;-O2&apos; or &apos;-Ofast&apos;</short_desc>
          <delta_ts>2014-01-15 09:33:07 +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.5</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</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>normal</bug_severity>
          <target_milestone>1.6 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chen Qi">Qi.Chen</reporter>
          <assigned_to name="Chen Qi">Qi.Chen</assigned_to>
          <cc>liezhi.yang</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>sgw</cc>
    
    <cc>yi.zhao</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>39231</commentid>
    <comment_count>0</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-12-05 07:46:19 +0000</bug_when>
    <thetext>1. Error message (stripped for readability):

| i586-poky-linux-libtool: compile:  i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/chenqi/testdir/containing-O1-O1-O1-Os/sysroots/qemux86 -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I/home/chenqi/testdir/containing-O2-O1-O1-Os/sysroots/qemux86/usr/include -O2 -pipe -g -feliminate-unused-debug-types -fvisibility=hidden -Wall -c ./tiger.c  -fPIC -DPIC -o .libs/tiger.o
| ./tiger.c:24:19: fatal error: stdio.h: No such file or directory
|  #include &lt;stdio.h&gt;
|                    ^
| compilation terminated.
| make[2]: *** [tiger.lo] Error 1
| make[2]: *** Waiting for unfinished jobs....
| make[2]: Leaving directory `/home/chenqi/testdir/containing-O2-Ofast-O1-Os/work/i586-poky-linux/libgcrypt/1.5.3-r0/libgcrypt-1.5.3/cipher&apos;

2. How to reproduce
set in local.conf:
TMPDIR = &quot;/home/chenqi/testdir/containing-O2-Ofast-O1-Os&quot;

3. Root cause
In cipher/Makefile.am, we have:

if ENABLE_O_FLAG_MUNGING
o_flag_munging = sed -e &apos;s/-O\([2-9s][2-9s]*\)/-O1/&apos; -e &apos;s/-Ofast/-O1/g&apos;
else
o_flag_munging = cat
endif


# We need to lower the optimization for this module.                                                                                                                                                            
tiger.o: $(srcdir)/tiger.c
        `echo $(COMPILE) -c $(srcdir)/tiger.c | $(o_flag_munging) `

tiger.lo: $(srcdir)/tiger.c
        `echo $(LTCOMPILE) -c $(srcdir)/tiger.c | $(o_flag_munging) `

The &apos;-O2&apos; is replaced by &apos;-O1&apos;, thus this problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39466</commentid>
    <comment_count>1</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-12-18 08:19:53 +0000</bug_when>
    <thetext>Module: openembedded-core.git
Branch: master-next
Commit: 84514834417e022660e7b3a540910d2d6fb12337
URL:    http://git.openembedded.org/?p=openembedded-core.git&amp;a=commit;h=84514834417e022660e7b3a540910d2d6fb12337

//Chen Qi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39821</commentid>
    <comment_count>2</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2014-01-15 09:33:07 +0000</bug_when>
    <thetext>Verified with master/1b636173ca88e5ccca1992f9a12367a1189fa674

Steps:
1. Add the following line in conf/local.conf
    TMPDIR = &quot;${TOPDIR}/containing-O2-Ofast-O1-Os&quot;
2. bitbake libgcrypt

The package can be built out without errors.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>