[ntp:questions] Re: cross compiling ntp-4.2.0: ./ntpdc-layout: cannot execute binary file

Maciej W. Rozycki macro at ds2.pg.gda.pl
Fri Jan 23 23:44:58 UTC 2004


On Fri, 23 Jan 2004, David Wuertele wrote:

> I usually specify both --target=mipsel-linux and --host=mipsel-linux,
> because I find that some autoconf packages (NOT COMPILERS, yes, I
> understand the difference) only cross-compile properly with --target,
> while other packages only work with --host.  In this case, I specified
> both.

 I see.  Unfortunately, for whatever reason, the confusion is widely
spread and there are indeed packages that use autoconf incorrectly in this
respect (and there are ones that use `uname' and other yet more
interesting ways to query the build system and treat it as information
about the host system), sigh...  I try to submit fixes for such bugs, but
I can see you might not have enough time/patience/etc. to mess with that
if you just want to get the damn thing running.  Especially as once you
touch autoconf/automake/etc. you often discover the maintainer uses a
grossly obsolete version, sometimes a CVS snapshot or a privately modified
variation, and you either have to downgrade yours or you have to fix
another zillion of configury bugs in the package.

> Maciej>  It looks like a validator for a structure layout established
> Maciej> by the compiler.  As such it's not usable when
> Maciej> cross-compiling; perhaps an approach similar to current
> Maciej> autoconf's AC_CHECK_SIZEOF could be exploited, but that might
> Maciej> not actually be worth the hassle.
> 
> I ran the ntpdc-layout program on my target, and it output the exact
> same content as the layout.std file in the ntp-4.2.0 distribution.  So
> I know that I'm safe with the defaults, but the same can't necessarily
> be said for other platforms.

 OK, it might be feasible to build the program with host tools even if
cross-compiling and just skip running it.  But would anyone actually run
it on the host then?

 I've cc-ed the previous posting to the ntp patch submission address --
I'll see what they think of the patch and perhaps adjust it a bit.  
Autoconf/automake, if used properly, and especially the recent versions,
make such adjustments very easy.

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro at ds2.pg.gda.pl, PGP key available        +



More information about the questions mailing list