<?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>9226</bug_id>
          
          <creation_ts>2016-03-08 08:08:26 +0000</creation_ts>
          <short_desc>python3: do_configure failed on meta-fsl-ppc with MACHINE = &quot;p1022ds&quot;</short_desc>
          <delta_ts>2016-05-05 12:34:36 +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>2.2</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>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.1 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Hongxu Jia">hongxu.jia</reporter>
          <assigned_to name="Hongxu Jia">hongxu.jia</assigned_to>
          <cc>bogdanx.a.voiculescu</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</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>59780</commentid>
    <comment_count>0</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-08 08:08:26 +0000</bug_when>
    <thetext>In the log, we have do_configure failed on python3:
...
| checking for the platform triplet based on compiler characteristics... powerpc-linux-gnuspe
| configure: error: internal configure error for the platform triplet, please file a bug report
| NOTE: The following config.log files may provide further information.
...


vim configure.ac in python3 source
...
 852 if test x$PLATFORM_TRIPLET != x &amp;&amp; test x$MULTIARCH != x; then
 853   if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
 854     AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
 855   fi
 856 fi
...

In this case, PLATFORM_TRIPLET is powerpc-linux-gnuspe, and MULTIARCH is
MULTIARCH=$($CC --print-multiarch 2&gt;/dev/null), and both of them are not equivalent.

On my local build with MACHINE = &quot;qemux86-64&quot;, the MULTIARCH is empty.

On my local build with MACHINE = &quot;p1022ds&quot;, $CC --print-multiarch
powerpc-linux-gnuspev1

Extra &apos;v1&apos; casued the failure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59820</commentid>
    <comment_count>1</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-09 05:09:21 +0000</bug_when>
    <thetext>For powerpc*-*-*spe*, default to with_cpu=8548 if --enable-e500-double,
and to 8540 otherwise.
vim gcc/config.gcc
...
    powerpc*-*-*spe*)
      if test x$enable_e500_double = xyes; then 
         with_cpu=8548
      else 
         with_cpu=8540
      fi     
      ;;
...

The with_cpu is used for SPE version detection
vim ./gcc/config/rs6000/t-linux
...
  7 ifneq (,$(findstring spe,$(target)))
  8 MULTIARCH_DIRNAME := powerpc-linux-gnuspe$(if $(findstring 8548,$(with_cpu)),,v1)
  9 else
 10 MULTIARCH_DIRNAME := powerpc-linux-gnu
...

The variable MULTIARCH_DIRNAME is the output of &apos;$CC --print-multiarch&apos;.
Without this patch, the output is &apos;powerpc-linux-gnuspev1&apos; which caused
python3 do_configure failed.

Since ppce500v2 -mcpu is 8548, explicitly add --enable-e500-double could fix
the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59916</commentid>
    <comment_count>2</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-14 02:38:04 +0000</bug_when>
    <thetext>Here is RP reply:

Following the links does give more context. The &quot;bad&quot; triplet is
actually coming from gcc and Hongxu&apos;s original patch did change gcc to
&quot;fix&quot; it. Unfortunately it does so at the risk of other problems to
gcc.

The gcc-cross recipes aren&apos;t working entirely correctly at the moment
and its just good luck (and sstate) which are meaning things do
actually work out.

The trouble is that changing gcc right now to fix this properly isn&apos;t
something we can easily do. So this patch might be the right short term
workaround.

Cheers,

Richard</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59917</commentid>
    <comment_count>3</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-14 02:39:06 +0000</bug_when>
    <thetext>Merged into master:

http://git.openembedded.org/openembedded-core/commit/?id=cda0ef61d37357fed1daa22f6a59ef9f906fcada</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61980</commentid>
    <comment_count>4</comment_count>
    <who name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</who>
    <bug_when>2016-05-05 12:34:36 +0000</bug_when>
    <thetext>Verified on 

Build Configuration:
BB_VERSION        = &quot;1.31.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;universal&quot;
TARGET_SYS        = &quot;powerpc-poky-linux-gnuspe&quot;
MACHINE           = &quot;p1022ds&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.1+snapshot-20160505&quot;
TUNE_FEATURES     = &quot;m32 spe ppce500v2&quot;
TARGET_FPU        = &quot;ppc-efd&quot;
meta
meta-poky
meta-yocto-bsp    = &quot;master:f7b520878babbaa7527151f22c031ae160512753&quot;
meta-fsl-ppc      = &quot;master:cd0ba65d48ec067775297f859084913dfe10a180&quot;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>