Cross compiling when in fact we aren't

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Dear All, I have a question which is almost 'theological'.

Consider a case, where your --host system (on which the code will run)
and the --build system (where you compile) have the same canonical
name, but yet you still don't want AC_PROG_CC to produce a test
executable and run it. How do you stop AC_PROC_CC from
attempting to run the test executable?

"Why would you want to do this?" you may ask. "It is after all a native
build."

In my case the answer is that I am trying to compile a parallel
program, which needs a special compiler (mpcc). However in order
to run the output of mpcc, I need to be in a batch queue. Outwith
the batch queue I cannot run executables compiled with the parallel environment.

so
CC=mpcc ./configure
breaks.

If I configure with:

CC=mpcc ./configure --host=powerpc-ibm-aix5.1.0.0

the configuration enters cross compilation mode. However this
is flagged as an obsolete feature in the autoconf documentation:

In section 15.6.3:

"To ease the transition between 2.13 and its successors, a more complicated scheme is implemented. Do not rely on the following, as it will be removed in the near future.

If you specify `--host', but not `--build', when configure performs the first compiler test it will try to run an executable produced by the compiler. If the execution fails, it will enter cross-compilation mode. This is fragile. Moreover, by the time the compiler test is performed, it may be too late to modify the build-system type: other tests may have already been performed. Therefore, whenever you specify --host, be sure to specify --build too."

Hence I am not supposed to rely on this.
However when I do specify build as in:

CC=mpcc ./configure --host=powerpc-ibm-aix5.1.0.0 --build=powerpc-ibm-aix5.1.0.0

the configuration breaks (because host and build are the same):

bash-2.05a$ CC=mpcc ./configure --host=powerpc-ibm-aix5.1.0.0 --build=powerpc-ib
m-aix5.1.0.0
checking build system type... powerpc-ibm-aix5.1.0.0
checking host system type... powerpc-ibm-aix5.1.0.0
checking for a BSD-compatible install... ./config/install-sh -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking for powerpc-ibm-aix5.1.0.0-gcc... mpcc
checking for C compiler default output... a.out
checking whether the C compiler works... configure: error: cannot run C compiled
 programs.


While the now obsoleted method of specifying --host but no --build works now, it is likely to go away in the future. How else can I stop the test from trying to execute the executable but not use an obsolete constructs?

Your thoughts would be much appreciated,

Balint

PS: The solution is not to claim that mpcc is just a wrapper and I should give
its -I and -L flags in the CXXFLAGS, LDFLAGS etc. This doesn't work because
the executable still won't run in interactive mode.		Ciao,	B
--
-------------------------------------------------------------------
Dr Balint Joo                         Post Doctoral Research Fellow
School of Physics
University of Edinburgh
Mayfield Road, Edinburgh EH9 3JZ
Scotland UK
Tel: 0131 650 6469 (from UK) +44-131-650-6469 (from outwith UK)
Fax: 0131 650 5902 (from UK) +44-131-650-5902 (from outwith UK)
email: bj@xxxxxxxxxxx           bj@xxxxxxxxxxxxxxxxx
WWW  : http://www.ph.ed.ac.uk/~bj
-------------------------------------------------------------------




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux