[Crash-utility] [PATCH 0/5] let make flexible for multiple host

Toshikazu Nakayama nakayama.ts at ncos.nec.co.jp
Wed Apr 18 08:14:35 UTC 2012


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

> 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

> Dave
> 
> 
> 
> 
>>
>> Toshikazu Nakayama (5):
>>    configure: retake the way of host compiler detection
>>    Makefile: wrap cc, gcc and ar with common make valiables
>>    make: add host_cross option
>>    build_data: handle CC valiable
>>    configure: handle cross compile with target=ppc host_cross=x86
>>
>>   Makefile            |  144 +++++++++--------
>>   configure.c         |  441
>>   ++++++++++++++++++++++-----------------------------
>>   extensions/Makefile |   10 +-
>>   extensions/sial.mk  |    6 +-
>>   extensions/snap.mk  |    6 +-
>>   5 files changed, 289 insertions(+), 318 deletions(-)
>>
>>
>>
>>
>>
>>
>>
>> --
>> Crash-utility mailing list
>> Crash-utility at redhat.com
>> https://www.redhat.com/mailman/listinfo/crash-utility
>>
> 
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Makefile-wrap-cc-gcc-and-ar-with-common-make-variabl.patch
Type: text/x-patch
Size: 16361 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20120418/70c503bd/attachment.bin>


More information about the Crash-utility mailing list