<?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>3090</bug_id>
          
          <creation_ts>2012-09-11 11:30:32 +0000</creation_ts>
          <short_desc>Toolchain Assembler is not loaded properly on some hosts</short_desc>
          <delta_ts>2012-10-15 07:20:37 +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>devtools / tool chain</component>
          <version>1.3</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>merged</status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>1.3 M5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexandru Georgescu">alexandru.c.georgescu</reporter>
          <assigned_to name="Laurentiu Palcu">laurentiu.palcu</assigned_to>
          <cc>alexandru.damian</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>laurentiu.palcu</cc>
    
    <cc>laurentiu.serban</cc>
    
    <cc>liang.li2</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>poky.adt.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>25036</commentid>
    <comment_count>0</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2012-09-11 11:30:32 +0000</bug_when>
    <thetext>The assembler installed by the toolchain is not loaded when the environment is sourced and the host assembler is used instead causing some erorrs.

************************************
HAPPENS ON:
Fedora 17 (and CentOS) for: 
poky-eglibc-x86_64-arm, poky-eglibc-x86_64-mips, poky-eglibc-x86_64-powerpc

Ubuntu 12.04 for: 
poky-eglibc-x86_64-mips, poky-eglibc-x86_64-powerpc

Please note that poky-eglibc-x86_64-arm on Ubuntu doesn&apos;t reproduce.


************************************
STEPS TO REPRODUCE (for ARM in Fedora):
1. Download and install the arm toolchain: http://autobuilder.yoctoproject.org/pub/nightly/20120910-5/toolchain/x86_64/poky-eglibc-x86_64-arm-toolchain-gmae-1.2+snapshot-20120911.sh

*************************************
2. source the environment

*************************************
3. Create the following C file:

alex@alex-pc:~/_current$ cat test.c 
#include &lt;stdio.h&gt;
#include &lt;math.h&gt;

double
convert(long long l)
{
   return (double)l;    // or double(l)
}

int
main(int argc, char * argv[])
{
   long long l = 10;
   double f;

   f = convert(l);
   printf(&quot;convert: %lld =&gt; %f\n&quot;, l, f);

   f = 1234.67;
   printf(&quot;floorf(%f) = %f\n&quot;, f, floorf(f));
   return 0;
}
alex@alex-pc:~/_current$ 


********************************************
4. Compile the following C file:
[alex@alex-v compile]$ ${CC} test.c -o  test -lm
Assembler messages:
Fatal error: invalid -march= option: `armv5te&apos;
[alex@alex-v compile]$


*********************************************
5. Compile in verbose mode:

[alex@alex-v compile]$ ${CC} -v test.c -o  test -lm
Using built-in specs.
COLLECT_GCC=arm-poky-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/home/alex/tmp/sdk/sysroots/x86_64-pokysdk-linux/usr/bin/armv5te-poky-linux-gnueabi/../../libexec/armv5te-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.7.2/lto-wrapper
Target: arm-poky-linux-gnueabi
Configured with: /srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-arm/build/build/tmp/work-shared/gcc-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r11/git/configure --build=x86_64-linux --host=x86_64-pokysdk-linux --target=arm-poky-linux-gnueabi --prefix=/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/usr --exec_prefix=/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/usr --bindir=/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/armv5te-poky-linux-gnueabi --sbindir=/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/armv5te-poky-linux-gnueabi --libexecdir=/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/usr/libexec/armv5te-poky-linux-gnueabi --datadir=/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/usr/share --sysconfdir=/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/etc --sharedstatedir=/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/com --localstatedir=/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/var --libdir=/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/armv5te-poky-linux-gnueabi --includedir=/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/usr/include --oldincludedir=/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/usr/include --infodir=/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/usr/share/info --mandir=/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-arm/build/build/tmp/sysroots/x86_64-nativesdk-pokysdk-linux --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --disable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=arm-poky-linux-gnueabi- --without-local-prefix --enable-target-optspace --enable-lto --enable-libssp --disable-bootstrap --disable-libgomp --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --with-float=soft --with-gxx-include-dir=/opt/poky/1.2+snapshot/sysroots/armv5te-poky-linux-gnueabi/usr/include/c++ --with-build-time-tools=/srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-arm/build/build/tmp/sysroots/x86_64-linux/usr/arm-poky-linux-gnueabi/bin --with-sysroot=/opt/poky/1.2+snapshot/sysroots/armv5te-poky-linux-gnueabi --with-build-sysroot=/srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-arm/build/build/tmp/sysroots/qemuarm --disable-libunwind-exceptions --disable-libssp --disable-libgomp --disable-libmudflap --with-mpfr=/srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-arm/build/build/tmp/sysroots/x86_64-nativesdk-pokysdk-linux --with-mpc=/srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-arm/build/build/tmp/sysroots/x86_64-nativesdk-pokysdk-linux --enable-nls
Thread model: posix
gcc version 4.7.2 20120706 (prerelease) (GCC) 
COLLECT_GCC_OPTIONS=&apos;--sysroot=/home/alex/tmp/sdk/sysroots/armv5te-poky-linux-gnueabi&apos; &apos;-march=armv5te&apos; &apos;-marm&apos; &apos;-mthumb-interwork&apos; &apos;-mtune=arm926ej-s&apos; &apos;-v&apos; &apos;-o&apos; &apos;test&apos; &apos;-mfloat-abi=soft&apos; &apos;-mtls-dialect=gnu&apos;
 /home/alex/tmp/sdk/sysroots/x86_64-pokysdk-linux/usr/bin/armv5te-poky-linux-gnueabi/../../libexec/armv5te-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.7.2/cc1 -quiet -v -iprefix /home/alex/tmp/sdk/sysroots/x86_64-pokysdk-linux/usr/bin/armv5te-poky-linux-gnueabi/../../lib/armv5te-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.7.2/ -isysroot /home/alex/tmp/sdk/sysroots/armv5te-poky-linux-gnueabi test.c -quiet -dumpbase test.c -march=armv5te -marm -mthumb-interwork -mtune=arm926ej-s -mfloat-abi=soft -mtls-dialect=gnu -auxbase test -version -o /tmp/ccku8YtF.s
GNU C (GCC) version 4.7.2 20120706 (prerelease) (arm-poky-linux-gnueabi)
	compiled by GNU C version 4.7.2 20120706 (prerelease), GMP version 5.0.5, MPFR version 3.1.0, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory &quot;/home/alex/tmp/sdk/sysroots/x86_64-pokysdk-linux/usr/bin/armv5te-poky-linux-gnueabi/../../lib/armv5te-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.7.2/../../../../../arm-poky-linux-gnueabi/include&quot;
ignoring duplicate directory &quot;/home/alex/tmp/sdk/sysroots/x86_64-pokysdk-linux/usr/bin/armv5te-poky-linux-gnueabi/../../lib/armv5te-poky-linux-gnueabi/gcc/../../../lib/armv5te-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.7.2/include&quot;
ignoring nonexistent directory &quot;/home/alex/tmp/sdk/sysroots/armv5te-poky-linux-gnueabi/usr/local/include&quot;
ignoring duplicate directory &quot;/home/alex/tmp/sdk/sysroots/x86_64-pokysdk-linux/usr/bin/armv5te-poky-linux-gnueabi/../../lib/armv5te-poky-linux-gnueabi/gcc/../../../lib/armv5te-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.7.2/include-fixed&quot;
ignoring nonexistent directory &quot;/home/alex/tmp/sdk/sysroots/x86_64-pokysdk-linux/usr/bin/armv5te-poky-linux-gnueabi/../../lib/armv5te-poky-linux-gnueabi/gcc/../../../lib/armv5te-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.7.2/../../../../../arm-poky-linux-gnueabi/include&quot;
#include &quot;...&quot; search starts here:
#include &lt;...&gt; search starts here:
 /home/alex/tmp/sdk/sysroots/x86_64-pokysdk-linux/usr/bin/armv5te-poky-linux-gnueabi/../../lib/armv5te-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.7.2/include
 /home/alex/tmp/sdk/sysroots/x86_64-pokysdk-linux/usr/bin/armv5te-poky-linux-gnueabi/../../lib/armv5te-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.7.2/include-fixed
 /home/alex/tmp/sdk/sysroots/armv5te-poky-linux-gnueabi/usr/include
End of search list.
GNU C (GCC) version 4.7.2 20120706 (prerelease) (arm-poky-linux-gnueabi)
	compiled by GNU C version 4.7.2 20120706 (prerelease), GMP version 5.0.5, MPFR version 3.1.0, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c7ae10bb5fd87aa66cb18f1432043778
COLLECT_GCC_OPTIONS=&apos;--sysroot=/home/alex/tmp/sdk/sysroots/armv5te-poky-linux-gnueabi&apos; &apos;-march=armv5te&apos; &apos;-marm&apos; &apos;-mthumb-interwork&apos; &apos;-mtune=arm926ej-s&apos; &apos;-v&apos; &apos;-o&apos; &apos;test&apos; &apos;-mfloat-abi=soft&apos; &apos;-mtls-dialect=gnu&apos;
 as -v -march=armv5te -mthumb-interwork -mfloat-abi=soft -meabi=5 -o /tmp/cc5cqxcM.o /tmp/ccku8YtF.s
GNU assembler version 2.22.52.0.1 (x86_64-redhat-linux) using BFD version version 2.22.52.0.1-10.fc17 20120131
Assembler messages:
Fatal error: invalid -march= option: `armv5te&apos;
[alex@alex-v compile]$


**************************************
OTHER COMMENTS:
As you can see in the verbose output in step 5, the host compiler is used instead of the toolchain compiler:

 as -v -march=armv5te -mthumb-interwork -mfloat-abi=soft -meabi=5 -o /tmp/cc5cqxcM.o /tmp/ccku8YtF.s
GNU assembler version 2.22.52.0.1 (x86_64-redhat-linux) using BFD version version 2.22.52.0.1-10.fc17 20120131
Assembler messages:
Fatal error: invalid -march= option: `armv5te&apos;
[alex@alex-v compile]$</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25131</commentid>
    <comment_count>1</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2012-09-13 02:14:00 +0000</bug_when>
    <thetext>the error not met in my test host (ubuntu 12.04 and fedora 17) with the same toolchain of nightly build 20120910-5.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25144</commentid>
    <comment_count>2</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2012-09-13 08:23:21 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; the error not met in my test host (ubuntu 12.04 and fedora 17) with the same
&gt; toolchain of nightly build 20120910-5.

That&apos;s strange. We managed to reproduce on 4 different machines: Two Fedora 17, one Ubuntu and one Cent OS.

Bogdan, can you try to reproduce in your machine?

Thanks,
Alex.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25177</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2012-09-13 14:50:02 +0000</bug_when>
    <thetext>This looks like it might be a relocation issue with the toolchain</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25444</commentid>
    <comment_count>4</comment_count>
    <who name="Radu Moisan">radu.moisan</who>
    <bug_when>2012-09-20 09:37:38 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; This looks like it might be a relocation issue with the toolchain

Confirmed to be a relocation issue. Laurentiu is preparing a patch. Assigning to Laurentiu.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25465</commentid>
    <comment_count>5</comment_count>
    <who name="Laurentiu Palcu">laurentiu.palcu</who>
    <bug_when>2012-09-20 13:55:00 +0000</bug_when>
    <thetext>The symlinks to the toolchain binaries in usr/libexec directory were not relocated. Fixed the issue, patches were sent on the mailing list for review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25471</commentid>
    <comment_count>6</comment_count>
    <who name="Laurentiu Palcu">laurentiu.palcu</who>
    <bug_when>2012-09-20 14:45:22 +0000</bug_when>
    <thetext>*** Bug 2958 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25531</commentid>
    <comment_count>7</comment_count>
    <who name="Laurentiu Palcu">laurentiu.palcu</who>
    <bug_when>2012-09-21 12:43:17 +0000</bug_when>
    <thetext>Patch merged:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=04877f768ebc7ed76fe320befe0b405c78d94b0f</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26567</commentid>
    <comment_count>8</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2012-10-15 07:20:37 +0000</bug_when>
    <thetext>Verified  on Fedora 17 64bit.
RC4: c9de24d3f4845251b01e2eab0aeeb7472badc5bb</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>