public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* RE: 32-bit host vs 64-bit host
@ 2014-02-25 20:48 roman
  2014-02-25 21:00 ` Grant Edwards
  0 siblings, 1 reply; 7+ messages in thread
From: roman @ 2014-02-25 20:48 UTC (permalink / raw)
  To: Grant Edwards, crossgcc



Grant,

>What sort of differences did you find?

I could not compile the standard c library with the 32 bit toolchain on
a 64 bit host, when the same library would build fine on the 32 bit
host. I have ran into this issue many times during the second stage of
the toolchain build on a 64 bit host. Same gcc/glibc sources would
compile on a 32 bit host but would fail on a 64 bit. 

R




-------- Original Message --------
Subject: Re: 32-bit host vs 64-bit host
From: Grant Edwards <grant.b.edwards@gmail.com>
Date: Tue, February 25, 2014 1:31 pm
To: crossgcc@sourceware.org

On 2014-02-25, <roman@kolesnikov.mobi> <roman@kolesnikov.mobi> wrote:

> I found the difference in building the libraries and file systems.

What sort of differences did you find?

> Making 32 bit chroot on 64 bit system was an extra nuisance.

You don't need to do that to run an existing 32-bit-host toolchain,
but you might need to do that to build a 32-bit-host toolchain on a
64-bit.

-- 
Grant Edwards grant.b.edwards Yow! My haircut is totally
 at traditional!
 gmail.com 


--
For unsubscribe information see http://sourceware.org/lists.html#faq

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 32-bit host vs 64-bit host
  2014-02-25 20:48 32-bit host vs 64-bit host roman
@ 2014-02-25 21:00 ` Grant Edwards
  0 siblings, 0 replies; 7+ messages in thread
From: Grant Edwards @ 2014-02-25 21:00 UTC (permalink / raw)
  To: crossgcc

On 2014-02-25, <roman@kolesnikov.mobi> <roman@kolesnikov.mobi> wrote:

>>What sort of differences did you find?
>
> I could not compile the standard c library with the 32 bit toolchain on
> a 64 bit host, when the same library would build fine on the 32 bit
> host. I have ran into this issue many times during the second stage of
> the toolchain build on a 64 bit host. Same gcc/glibc sources would
> compile on a 32 bit host but would fail on a 64 bit. 

Ah, I see. I suspect that has something to do with missing 32-bit
compatibility libraries.  That's not really what I'm asking about.

I've got a 32-bit toolchain which has been in use for some time on
both 32-bit and 64-bit hosts -- everything works fine.

The last of the 32-bit machines in the development group was just
changed over to 64-bit.  Now everybody is running 64-bit development
machines.  I'm trying to decide how much testing and verification would
be needed if/when we rebuild the exact same toolchain as a 64-bit
hosted application.

For a naively written compiler (e.g. all of the one's I've
written/worked on), I would expect the exact same object code to be
emitted regardless of the word-size of the host.  However, gcc is far
from "naive" and I wouldn't put it past the developers to write
optimizer code that actually generates different output when the
host's native word size changes.

One of these days, I'll build a toolchain on a 64-bit host and
actually compare some target program binaries to see if anything
changes...

-- 
Grant Edwards               grant.b.edwards        Yow! Now I'm concentrating
                                  at               on a specific tank battle
                              gmail.com            toward the end of World
                                                   War II!


--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 32-bit host vs 64-bit host
  2014-02-24 21:27 Grant Edwards
  2014-02-25  2:59 ` Ralf Corsepius
@ 2014-03-02  2:00 ` Bill Pringlemeir
  1 sibling, 0 replies; 7+ messages in thread
From: Bill Pringlemeir @ 2014-03-02  2:00 UTC (permalink / raw)
  To: Grant Edwards; +Cc: crossgcc

On 24 Feb 2014, grant.b.edwards@gmail.com wrote:

> Would you expect the two toolchains to produce identical code when
> given identical sources?

The 64bit host tools can deal with larger files (objects and binaries).
This can lead to differences, like it won't link at all with the 32bit
version.  Even two machines, or the same machine at different times of
the year may make different binaries.

We had one machine that the build person insisted on re-compiling and
the binary was suppose to have a known hash.  One day, the compiler
changed the register allocation.  The generated code was identical, it
just moved things to a different set of registers to accomplish the same
thing.  It was effectively equivalent in all respects, but the known
hash was wrong.  This was with an older gcc released by some
organization (not crosstool-ng)

Also, I believe that some of this depends on the options used
(-frandom-seed, etc).  Ie, there maybe some sets of options where the
binary may remain the same and others where it won't.

I build both sets of compilers.  An i686 and x86_64 host with ARM926
target using crosstool-ng.  No one has ever noted a difference, except
some very large links only work on the 64bit version.

https://wiki.debian.org/ReproducibleBuilds

I would expect the binaries to be different.  I would also expect that
the binary differences won't matter in 99% to 100% of the cases.

Fwiw,
Bill Pringlemeir.

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 32-bit host vs 64-bit host
  2014-02-25 19:59 roman
@ 2014-02-25 20:32 ` Grant Edwards
  0 siblings, 0 replies; 7+ messages in thread
From: Grant Edwards @ 2014-02-25 20:32 UTC (permalink / raw)
  To: crossgcc

On 2014-02-25, <roman@kolesnikov.mobi> <roman@kolesnikov.mobi> wrote:

> I found the difference in building the libraries and file systems.

What sort of differences did you find?

> Making 32 bit chroot on 64 bit system was an extra nuisance.

You don't need to do that to run an existing 32-bit-host toolchain,
but you might need to do that to build a 32-bit-host toolchain on a
64-bit.

-- 
Grant Edwards               grant.b.edwards        Yow! My haircut is totally
                                  at               traditional!
                              gmail.com            


--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: 32-bit host vs 64-bit host
@ 2014-02-25 19:59 roman
  2014-02-25 20:32 ` Grant Edwards
  0 siblings, 1 reply; 7+ messages in thread
From: roman @ 2014-02-25 19:59 UTC (permalink / raw)
  To: Grant Edwards, crossgcc


Hi Grant,

I found the difference in building the libraries and file systems.
Making 32 bit chroot on 64 bit system was an extra nuisance.

Roman



-------- Original Message --------
Subject: 32-bit host vs 64-bit host
From: Grant Edwards <grant.b.edwards@gmail.com>
Date: Mon, February 24, 2014 2:26 pm
To: crossgcc@sourceware.org

Let's say I build two copies of the "same" toolchain: one on a 32-bit
(i686) host and the other on a 64-bit (amd64) host: both are using the
same configuration, same sources files, for the same target (e.g. ARM).

Would you expect the two toolchains to produce identical code when
given identical sources?

Or are there certain optimizations or transformations that differ
depend on the _host_ machine word-size or architecture?

For example: for the past few years you've been building an embedded
linux linux system for an ARM9 target using a 32-bit hosted toolchain.
How much of a risk is there if you move development to a 64-bit host
and rebuild your toolchains as 64-bit apps?

[Yes, I know that if you have 32-bit compatibility libraries you can
continue to use the existing 32-bit toolchain binaries.]

-- 
Grant Edwards grant.b.edwards Yow! Make me look like
 at LINDA RONSTADT again!!
 gmail.com 


--
For unsubscribe information see http://sourceware.org/lists.html#faq

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 32-bit host vs 64-bit host
  2014-02-24 21:27 Grant Edwards
@ 2014-02-25  2:59 ` Ralf Corsepius
  2014-03-02  2:00 ` Bill Pringlemeir
  1 sibling, 0 replies; 7+ messages in thread
From: Ralf Corsepius @ 2014-02-25  2:59 UTC (permalink / raw)
  To: crossgcc

On 02/24/2014 10:26 PM, Grant Edwards wrote:
> Let's say I build two copies of the "same" toolchain: one on a 32-bit
> (i686) host and the other on a 64-bit (amd64) host: both are using the
> same configuration, same sources files, for the same target (e.g. ARM).
>
> Would you expect the two toolchains to produce identical code when
> given identical sources?
Theoretically, yes.

> Or are there certain optimizations or transformations that differ
> depend on the _host_ machine word-size or architecture?
Theoretically, this should not happen, but it's thinkable.

What I've occasionally seen in the past, is bugs (not design 
limitations) related to using 32bit/64bit hosts (in GCC or binutils) 
showing effect on target binaries. However, these occasion were rare.

> For example: for the past few years you've been building an embedded
> linux linux system for an ARM9 target using a 32-bit hosted toolchain.
> How much of a risk is there if you move development to a 64-bit host
> and rebuild your toolchains as 64-bit apps?
There is a risk, but it's fairly small. Negligible, IMHO, in comparison 
to other factors contributing to potential differences (Host-libraries, 
host-OS-toolchain bugs/incompatiblities, target-toolchain bugs, etc.).

 > [Yes, I know that if you have 32-bit compatibility libraries you can
 > continue to use the existing 32-bit toolchain binaries.]
It you're really scared, this feature would enable you to check 
yourself. Build a 32bit and a 64bit-hosted toolchain, install them in 
parallel and compare the resulting target files.

Ralf



--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 7+ messages in thread

* 32-bit host vs 64-bit host
@ 2014-02-24 21:27 Grant Edwards
  2014-02-25  2:59 ` Ralf Corsepius
  2014-03-02  2:00 ` Bill Pringlemeir
  0 siblings, 2 replies; 7+ messages in thread
From: Grant Edwards @ 2014-02-24 21:27 UTC (permalink / raw)
  To: crossgcc

Let's say I build two copies of the "same" toolchain: one on a 32-bit
(i686) host and the other on a 64-bit (amd64) host: both are using the
same configuration, same sources files, for the same target (e.g. ARM).

Would you expect the two toolchains to produce identical code when
given identical sources?

Or are there certain optimizations or transformations that differ
depend on the _host_ machine word-size or architecture?

For example: for the past few years you've been building an embedded
linux linux system for an ARM9 target using a 32-bit hosted toolchain.
How much of a risk is there if you move development to a 64-bit host
and rebuild your toolchains as 64-bit apps?

[Yes, I know that if you have 32-bit compatibility libraries you can
continue to use the existing 32-bit toolchain binaries.]

-- 
Grant Edwards               grant.b.edwards        Yow! Make me look like
                                  at               LINDA RONSTADT again!!
                              gmail.com            


--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-03-02  2:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-25 20:48 32-bit host vs 64-bit host roman
2014-02-25 21:00 ` Grant Edwards
  -- strict thread matches above, loose matches on Subject: below --
2014-02-25 19:59 roman
2014-02-25 20:32 ` Grant Edwards
2014-02-24 21:27 Grant Edwards
2014-02-25  2:59 ` Ralf Corsepius
2014-03-02  2:00 ` Bill Pringlemeir

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).