henrik.strand at axis
Apr 25, 2012, 5:16 AM
Post #9 of 10
Re: [PATCH Attachment 28632, Bug 51257] Build failed when cross-compiling: ./gen_test_char: cannot execute binary file
[In reply to]
On Mon, 2012-04-23 at 16:58 +0200, Guenter Knauf wrote:
> Hi Henrik,
> Am 23.04.2012 16:33, schrieb Henrik Strand:
> > Some initial thoughts on your patch:
> > - Why not init CC_FOR_BUILD to $(CC) instead of cc?
> because $(CC) holds the cross compiler (host) and not the build
> compiler; 'cc' should work on almost all systems, and if it doesnt one
> can still overwrite it with the env var, see below.
> > - Good thing with CFLAGS_FOR_BUILD but default init is missing. Default
> > to CFLAGS?
> no - for same reason as above: CFLAGS holds flags for host, and not for
> > - Documentation?
> yes, are you up to adapt your docu patch to the new behaviour?
> This is:
> when cross compilation is detected then CC_FOR_BUILD will be set to 'cc'
> so that the build helper gen_test_char will be build with the build
> compiler and can then be run on the build system. You can overwrite 'cc'
> with setting the environment var CC_FOR_BUILD, f.e.:
> CC_FOR_BUILD=gcc ./configure --host=...