public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kaz Kylheku" <kaz@zeugmasystems.com>
To: "Rick Mann" <rmann@latencyzero.com>,
		"NightStrike" <nightstrike@gmail.com>
Cc: <gcc-help@gcc.gnu.org>
Subject: Re: More info: Binary built on different platforms with exact same tools different?
Date: Tue, 18 Dec 2007 06:25:00 -0000	[thread overview]
Message-ID: <A9F5FD5196284B278470EC67F5EA807B@rocktron> (raw)
In-Reply-To: <DC26D3F3-A493-4D67-8667-F0AE522D9F86@latencyzero.com>

From: "Rick Mann" <rmann@latencyzero.com>
> On Dec 17, 2007, at 4:59 PM, NightStrike wrote:
>
>> Why would binaries on different platforms be identical?
>
> The toolchain on each host platform is built with identical steps,  from 
> the same source distro, targetting an embedded Xscale processor.
>
> The source code does not use any OS APIs, just some things in newlib 
> (built as part of the toolchain).

So you might think.

However, it's easy for code to become polluted by stuff from the build 
machine.

I knows this from experience, having developed a cross-compiled Linux 
distribution from scratch.

In one case I had a failure because some /usr/include header got included, 
and as a result, inline asm's routines for x86 were being mixed into MIPS 
code.

Make sure your GCC is properly sysrooted so it's not picking up local header 
files, etc.

> The resulting binary should, in theory, be identical, regardless of  the 
> host platform.

And of course the input to the compiler after all header file inclusion and 
preprocessing should also be the same.

Here is something to try: compile your code with -E in both environments to 
capture the raw preprocessor output. You don't want any differences there, 
that's for sure.

      parent reply	other threads:[~2007-12-18  6:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-18  0:43 Rick Mann
2007-12-18  0:54 ` More info: " Rick Mann
2007-12-18  0:59   ` NightStrike
2007-12-18  1:05     ` Rick Mann
2007-12-18  1:11       ` NightStrike
2007-12-18  1:15         ` Rick Mann
2007-12-18  6:25       ` Kaz Kylheku [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A9F5FD5196284B278470EC67F5EA807B@rocktron \
    --to=kaz@zeugmasystems.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=nightstrike@gmail.com \
    --cc=rmann@latencyzero.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).