(2012/04/17 23:44), Dave Anderson wrote:
 > 
 > 
 > ----- Original Message -----
 >> Hi Dave,
 >>
 >> This patch set will make configure or build flexible for host environment,
 >> in particular dealing with cross compiler.
 >> Please consider about this proposal.
 >>
 >> patch#1:
 >>   By declaring tables about target and host relationships,
 >>   cleanup corresponding code and the new build combination will be
 >>   adapted briefly.
 >>
 >> Remaining patches:
 >>   Try to relieve cross compiler burden by using explicit
 >>   host_cross option.
 >>   I'm using cross compiler environ host=x86 for target=ppc,
 >>   and might attempt target=<another arch>  in the near future.
 >>   I stocked private patches to accomplish cross compiling
 >>   but I'd like to discard them permanently with your agreement.
 >>
 >> Thanks,
 >> Toshi
 > 
 > I am presuming that you have successfully built a PPC binary on an
 > x86 or x86_64 host, and then you have copied the binary to a PPC host
 > that doesn't have a resident compiler?  But then again, looking at
 > your
 
 Hi Dave,
 
 I didn't explain about background issues.
 
 I built a PPC binary on an x86 host cross compiler. When run it,
 I have to ftp to PPC machine where dose not have self build tools.
 Here is dumping my build environment info.
  $ uname -m
  x86_64
  $ file gcc
  gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
  dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped
  $ ./gcc -dumpmachine
  powerpc-linux-gnu
 
 > patch as is, it looks like you can only allow "target=PPC" on a
 > PPC64 host,
 > which is already supported?:
 > 
 >     static struct host_table {
 > 
 >     ... [ cut ] ...
 > 
 >     }, ppc[] = {
 >             {
 >                     .host = PPC64,
 >                     .cflags = "-m32 -D_FILE_OFFSET_BITS=64 -fPIC",
 >                     .gdb_conf_flags = "--target=ppc-elf-linux
 >                     CFLAGS=-m32",
 >             }
 >     };
 
 This "target=PPC" on a PPC64 host has been already supported
 since I copied it into ppc[] table.
  [Crash-utility] [PATCH v1 1/4] Support PPC32 Core analysis on PPC64 Host
   
https://www.redhat.com/archives/crash-utility/2011-November/msg00019.html
 
 The purpose is to build ppc 32bit binary with compatible target CFLAGS "-m32"
 of ppc64 compiler. This is similar idea with x86_64.
 
 But I added new cross support(is_cross is TRUE) in patch#5 which is
 distinct from original purpose.
 
 +	{
 +		.host = X86,
 +		.cflags = "-D_FILE_OFFSET_BITS=64",
 +		.gdb_conf_flags = "--host=i686-pc-linux-gnu "
 +				  "--target=powerpc-elf-linux",
 +		.is_cross = TRUE,
 +	},
 
 > In any case, I would prefer that you specifically address your
 > particular PPC-on-X86 build issue, because I'm not sure what
 > other combinations would be particularly useful.
 
 > I'm not particularly interested in speculative changes.  The only
 > future architecture support I can see on the horizon is 64-bit ARM,
 > and that is a few a few years away.  And we are lucky that x86 and
 > ARM have the same endianness and data-type sizes, so we can continue
 > (hopefully) to build x86_64 binaries to analyze 64-bit ARM vmcores
 > on x86_64 hosts.
 
 My issues are to arrange original crash package as compilable one with cross.
 I edit package's Makefile or configure parameters --host/--target at spec file,
 finally building with environment variables CC, AR, LD, etc.
 
 By applying patches, I can build crash only with tiny spec update,
 "make target=PPC host_cross=X86" without modification of released
 archive.
 
 Then, I'll start mips architecture (seems to go toward embedded minority).
 There are probably the similar considerations about cross compile.
 I want to be done with "make target=MIPS host_cross=X86" by adding
 mips tables. 
Wait a minute -- how about putting the horse before the cart?  There
is a significant amount of work involved with supporting MIPS as an 
architecture, which would have to be accomplished first.  
 
 > Also, note that your patch fails because it collides with Rabin's queued
 > fix for building SIAL for target=ARM and target=PPC builds:
 > 
 >   [Crash-utility] [PATCH] build sial with TARGET_CFLAGS
 >   
https://www.redhat.com/archives/crash-utility/2012-March/msg00113.html
 
 I haven't caught this update. I'd send updated portion.
 
 Thanks,
 Toshi 
My hope was that you could accomplish the cross-compile automatically
without invoking the extra "host_cross=X86" option support.  If
configure sees that you're trying a "target=PPC" on an x86 or x86_64,
then it could presume it's your unique cross-compile scenario, and
then do whatever it has to do from that point on.
I also was under the impression that a MIPS binary was not all that
beneficial to the embedded folks, because it is not a typical 
situation where the crash analysis could take place *on* the embedded
MIPS platform.
Dave