[Clfs-support] Cross tool chain output

Jonathan Cave stuff at jocave.me.uk
Wed Sep 16 02:36:59 PDT 2009


Joe Ciccone wrote:
>Jonathan Cave wrote:
>> Hi,
>>
>> I have been following the pattern described in stable series CLFS to
>> produce a cross-compiling tool chain. I have two servers available
>> that I would like to use as hosts both of which are Intel x86 based,
>> however one runs RHEL 3 and one runs CentOS 5.x.
>>
>> I have been able to construct the toolchain on both servers, but have
>> been surprised that source code compiled for the target with the
>> toolchain on one server does not produce identical binary output to
>> that built with the toolchain on the other server. The file size of
>> object files produced always differs from one server to the other and
>> investigations with nm indicates that are differences throughout the
>> files.
>>
>> Is this what should be expected? I felt that the cross toolchain and
>> target filesystem if properly built would result in identical output.
>I would assume that they should be 100% identical if the toolchains are
>also identical. Were you following the stable book or the development
>book. The development book is in constant flux. If you used a different
>dev book I wouldn't be suprised if the output was different.
>
>Another possibility is that GCC is optimizing the code for the cpu of
>the host. It shouldn't be doing this, but if the host and target
>tripplets are similar enough it may. Take a look at $CLFS_TARGET-gcc
>-dumpspecs in the *cc1_cpu: section.

I was following the stable book and also made sure to construct the
toolchain using the same process on both servers.

The host (i686) and target (i586) are similar, however the *cc1_cpu
section of the output of $CLFS_TARGET-gcc -dumpspecs appears identical
on both servers:

*cc1_cpu:
%{!mtune*: %{m386:mtune=i386 %n`-m386' is deprecated. Use
`-march=i386' or `-mtune=i386' instead.
} %{m486:-mtune=i486 %n`-m486' is deprecated. Use `-march=i486' or
`-mtune=i486' instead.
} %{mpentium:-mtune=pentium %n`-mpentium' is deprecated. Use
`-march=pentium' or `-mtune=pentium' instead.
} %{mpentiumpro:-mtune=pentiumpro %n`-mpentiumpro' is deprecated. Use
`-march=pentiumpro' or `-mtune=pentiumpro' instead.
} %{mcpu=*:-mtune=%* %n`-mcpu=' is deprecated. Use `-mtune=' or
'-march=' instead.
}} %<mcpu=* %{mpni:-msse3 %n`-mpni' is deprecated. Use `-msse3' instead.
} %{mno-pni:-mno-sse3 %n`-mno-pni' is deprecated. Use `-mno-sse3' instead.
} %{mintel-syntax:-masm=intel %n`-mintel-syntax' is deprecated. Use
`-masm=intel' instead.
} %{mno-intel-syntax:-masm=att %n`-mno-intel-syntax' is deprecated.
Use `-masm=att' instead.
}

Any other ideas?

Thanks.



More information about the Clfs-support mailing list