On Tuesday, 05.05.2015 at 11:24, Antti Kantee wrote:
> I think I suggested not introducing defines unless they are
> absolutely necessary, or any other similar identifiers for that
> matter.  Which are, in fact, the rumprun<platform> falls under.  I
> have a vague memory that Martin justified <platform> in the
> toolchain name, but I'm not 100% if my memory serves me right.

The <platform> needs to be in the toolchain name so that the *user* can
distinguish the different toolchains, and also so that they can be
installed side by side in the same directory in $PATH.

The autoconf tuple and toolchain name SHOULD match up, as this makes the
canonical modern-autoconf-way-to-crosscompile "just work":

  $ ./configure --build=x86_64-linux-gnu --host=x86_64-rumprunxen-netbsd

will go and look for <host>-gcc, <host>-g++, etc. and use those for
building the rumprun unikernel. For software that has explicit support for
cross-compiling and requires running code on the <build> system during the
build it will also do the right thing and use the build system's compilers
where appropriate.

(Yeah, the autoconf cross terminology sucks. When they say 'host', they
mean what everyone naively understands as the 'target platform', and when
they say 'build', they mean 'host system you are building on'. They also
use 'target' to mean something else entirely.)

If the toolchain names *do not* match the autoconf tuple then the user
would need to set CC, CXX, etc manually which is explicitly marked as
"obsolete, don't do that" in the autoconf documentation.

> >eg there is no such thing as an arm baremetal platform,
> >there is one for pretty much every SoC thats ported to.
> 
> Good point.

I'm not sure what to do about that :-(

An idea: we invent some explicit flag that would be passed to our -gcc,
-g++ or -ld wrapper and mean "build for this particular board".

So, for eg. Raspberry Pi:

  $ CFLAGS=-Xboard=rpi ./configure --build=x86_64-linux-gnu 
--host=arm-rumprunbaremetal-netbsd

However, the above will use these CFLAGS for both the (autoconf
terminology) 'host' and 'build' compiler (if used). The latter will
obviously not like our custom flag...


Reply via email to