public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Partial autoconf transition thoughts
@ 2003-06-09 22:02 Daniel Jacobowitz
  2003-06-09 22:17 ` Andrew Cagney
  2003-06-09 22:34 ` Alexandre Oliva
  0 siblings, 2 replies; 32+ messages in thread
From: Daniel Jacobowitz @ 2003-06-09 22:02 UTC (permalink / raw)
  To: gcc; +Cc: gdb, binutils, aoliva

[Sorry for the cross posting; I'm waiting for Zack et al. to figure out
where the new list should be.]

I spent some time today reviewing the --host/--build issues.  Fortunately,
target isn't relevant to autoconf's choices at this stage.

Consider the options:

	Build	Host
1	-	-
2	-	A
3	A	-
4	A	A
5	A	B

With plain target ("nonopt"), configure will act as if any unspecified
options had been given on the command line with the plain target as a value.

1.  Native build
	2.13: Native-build a compiler to run on the local system; test 
	      $CC for cross mode.
	2.57: Native-build a compiler to run on the local system
2.  Specify only host
	2.13: Assume that $build is $host; test $CC for cross mode.
	2.57: Same, but considered "deprecated", according to the manual.
	      However, based on generated configure, build will be guessed,
	      and cross compilation will be tested by running a program.
3.  Specify only build
	2.13: Host will be guessed; test $CC for cross mode.
	2.57: Host will default to $build, will build natively.
4.  Specify the same thing for both
	2.13: Both will be overridden; test $CC for cross mode.
	2.57: Both will be overridden, will build natively.
5.  Specify both different.
	2.13: Both will be overridden, test $CC for cross mode.
	2.57: Both will be overridden, will enter cross mode.


So I guess I don't see what the problem is with doing one directory at a
time.  If you want to build a compiler that runs on the build machine, then
we can always pass $build and $host to subdirectories with the same value;
if you want to build a compiler that runs on another machine, require the
user to specify --build and --host differently and always pass those to
subdirectories, and as long as $CC is a cross compiler both autoconfs will
do the right thing.  There are existence proofs that this (mostly!) works -
readline has been using autoconf 2.57 since its last import.  The readline
configure has issues cross compiling though, so don't treat it as an
example.

Could someone who thinks this won't work please speak up, before I waste a
lot of time?


As a proof of concept, I took gas/, and did a trivial convertion (with a
little help from Klee's patches:
  http://sources.redhat.com/ml/sid/2003-q1/msg00003.html
but not using some of the tricky bits).  The results were fine.  I tested a
native build on i386-linux and a --build=i686-pc-linux-gnu
--host=mipsel-hardhat-linux-gnu build, because that's what I had handy. 
What other cases are tricky and meaningful?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 32+ messages in thread
* Re: Partial autoconf transition thoughts
@ 2003-06-10  0:40 Nathanael Nerode
  2003-06-10  0:59 ` Alexandre Oliva
  0 siblings, 1 reply; 32+ messages in thread
From: Nathanael Nerode @ 2003-06-10  0:40 UTC (permalink / raw)
  To: gcc, gdb, binutils, aoliva

Alexandre Oliva said:
>On Jun  9, 2003, Daniel Jacobowitz <drow@mvista.com> wrote:
>
>> 4.  Specify the same thing for both
>>       2.13: Both will be overridden; test $CC for cross mode.
>>       2.57: Both will be overridden, will build natively.
>
>Except that building natively is deprecated, and autoconf people have
>already pushed for removing this alternative.  We probably don't want
Whaaaat?  This seems like a rather dumb idea with no serious benefit.

--
Let's look at this another way.  What are the *differences* between a
build=host compilation and a build!=host compilation?

1. Certain tools used while building have different names.
I have effectively isolated this issue into macros in config/acx.m4.
They can be improved if necessary, but they're already quite clever.
More importantly, *we* have control over these and can make them decide
based on *our* choice of when it's appropriate.

2. Testing can be done on the build machine.
Not a configuration issue!

3. Certain headers are to be found in a different place.
This is a legitimate difference, which might induce a desire for 
'cross-building' when build=host, but it can be specified explicitly in 
other ways already, I believe.

4. Certain libraries are found in different places.  In the case of 
static linking, this is the same as the above.  In the case of dynamic 
linking, this should be manually overridable (and it seems to be 
moderately hit-and-miss in the cross case anyway, given 
inconsistent dynamic library naming and locating schemes).  

I can think of no other differences.

I proceed on the principle that there are no real, fundamental 
differences between a native configuration and a cross configuration, 
and this generally creates the cleanest configury code.


>What configure arguments?  Did you pass i386-linux in the command
>line?  Maybe one of --build or --host?  The worst case to handle IMO
>is that of passing --build, since then autoconf 2.13 directories will
>guess --host from config.guess, whereas autoconf 2.57 will default
>host to build.  If they're different, we get an inconsistent build
>across directories.  That's why I think we should resolve the flags in
>the top level, and decide what to pass to each sub-directory.

Absolutely.  We're already passing a complete set down to the 'target' 
directories and to the 'build' directories.  I think we should also pass 
a complete set down to the 'host' directories, and they should be bright 
enough to understand that if build=host, build=host.  (Regardless of 
what some autoconf people may be advocating.)

--Nathanael

^ permalink raw reply	[flat|nested] 32+ messages in thread
* Re: Partial autoconf transition thoughts
@ 2003-06-10  1:40 Nathanael Nerode
  2003-06-10  1:46 ` DJ Delorie
  0 siblings, 1 reply; 32+ messages in thread
From: Nathanael Nerode @ 2003-06-10  1:40 UTC (permalink / raw)
  To: aoliva; +Cc: gcc, gdb, binutils

Alexandre said:
>I.e., assume you're always cross compiling?  That would be a
Actually, assume you're always Canadian cross compiling. :-)  Except 
when you aren't.

>reasonable approach too, but there are some tests that you can't
>possibly do in the cross case, autoconf lets you actually do them in
>the native case as long as you set a safe default or alternate test
>for the cross case.

And when I write my own tests for these circumstances, I would guard 
them by one of build=host or build=target, depending on which is correct 
under the circumstances.  

This generally tests in the correct situations, and is if anything too
conservative (assuming untestability when build=i686-pc-linux-gnu 
and host=i386-pc-linux-gnu).

I suppose the idea behind the proposal is that you can always 
force nativeness by not specifying 'host' (since it defaults to build); 
but there's no clear way to force 'crossness' when host=build.

But why would you *want* to?

Perhaps you have two machines with the same canonical name, but 
differing in the particular feature.  This is most likely due to a bug 
in config.guess or config.sub, which is Not Autoconf's Problem.  

Otherwise, the feature is probably one where I don't *want* autoconf to 
decide based on my particular build machine; it will presumably make 
the produced program quite unportable, and will likely break if I make 
some small change to my machine's configuration.  Such a feature 
probably deserves its own --with option and notes in the documentation, 
and should certainly be defaulted to the 'baseline' option, not to 
whatever's on my machine today.

So the only use case I can think of for 'forcing crossness' when 
build=host depends on either bugs in config.* or poor 'configure' 
design.

Hmm.  Now who should I say this to?

Akim, I guess, but he still hasn't done anything with the autoconf patch 
I sent him a long while ago.

--Nathanael

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

end of thread, other threads:[~2003-06-27 19:27 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-09 22:02 Partial autoconf transition thoughts Daniel Jacobowitz
2003-06-09 22:17 ` Andrew Cagney
2003-06-09 22:34 ` Alexandre Oliva
2003-06-09 23:14   ` Daniel Jacobowitz
2003-06-10  0:44     ` Alexandre Oliva
2003-06-10  0:40 Nathanael Nerode
2003-06-10  0:59 ` Alexandre Oliva
2003-06-10 10:59   ` Maciej W. Rozycki
2003-06-10 11:38     ` Andreas Schwab
2003-06-10 12:45       ` Maciej W. Rozycki
2003-06-10 22:06     ` Alexandre Oliva
2003-06-11 11:32       ` Maciej W. Rozycki
2003-06-11 18:04         ` Alexandre Oliva
2003-06-11 19:39           ` Maciej W. Rozycki
2003-06-11 20:39             ` Alexandre Oliva
2003-06-12 11:21               ` Maciej W. Rozycki
2003-06-12 12:10                 ` Bernd Jendrissek
2003-06-12 12:26                   ` Maciej W. Rozycki
2003-06-12 21:42                     ` Alexandre Oliva
2003-06-13 10:35                       ` Maciej W. Rozycki
2003-06-13 14:02                         ` Alexandre Oliva
2003-06-13 18:32                           ` Maciej W. Rozycki
2003-06-13 19:25                             ` Alexandre Oliva
2003-06-13 20:15                               ` Maciej W. Rozycki
2003-06-13 20:54                                 ` Alexandre Oliva
2003-06-14 14:33                                   ` Maciej W. Rozycki
2003-06-14 15:43                                     ` Alexandre Oliva
2003-06-14 18:27                                       ` Maciej W. Rozycki
2003-06-26  7:24                                         ` Alexandre Oliva
2003-06-28  0:35                                           ` Maciej W. Rozycki
2003-06-10  1:40 Nathanael Nerode
2003-06-10  1:46 ` DJ Delorie

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