From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18847 invoked by alias); 18 Dec 2007 06:25:09 -0000 Received: (qmail 18835 invoked by uid 22791); 18 Dec 2007 06:25:09 -0000 X-Spam-Check-By: sourceware.org Received: from mail.zeugmasystems.com (HELO zeugmasystems.com) (192.139.122.66) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 18 Dec 2007 06:24:59 +0000 Received: from rocktron ([10.18.28.239]) by zeugmasystems.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 17 Dec 2007 22:24:56 -0800 Message-ID: From: "Kaz Kylheku" To: "Rick Mann" , "NightStrike" Cc: References: <5A2671EC-48B9-4492-A1E1-F346CE6811CC@latencyzero.com> In-Reply-To: Subject: Re: More info: Binary built on different platforms with exact same tools different? Date: Tue, 18 Dec 2007 06:25:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Windows Mail 6.0.6000.16480 X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2007-12/txt/msg00331.txt.bz2 From: "Rick Mann" > 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.