NetBSD-Users archive

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

Re: Some questions about build.sh, machine, -u and tools



On Wed, May 05, 2021 at 12:57:21 +0200, Rocky Hotas wrote:

> On mag 03 16:42, Valery Ushakov wrote:
>
> > TL;DR: src/BUILDING explains most of these things.
> 
> It has the header of a Section 8 manpage, but it is not accessible as
> such (`man BUILDING', `man 8 BUILDING' or with lower keys). Is this
> normal?

Yes.  It's just formatted using mdoc, but is not installed as part of
system manual pages.


> > On Mon, May 03, 2021 at 12:18:54 +0200, Rocky Hotas wrote:
> 
> > Roughly speaking MACHINE determines with kernel, bootloader, etc the
> > system uses.  You can have multiple MACHINE_ARCH for the same MACHINE
> > when the machine can have different ABIs (e.g. old arm, earm) or run
> > in different endianness (big, little) or bitness (32, 64).
> 
> Ok! Even if two MACHINEs with different ABIs or endiannes have really
> few common features, maybe just the commercial brand and the
> partitioning scheme.  Sorry, this is extreme of course, but the common
> MACHINE idea still looks weird to me.

I think Martin explained it pretty well in another followup.


> > tooldir* is default TOOLDIR, a place where the cross tools are
> > installed, you can set it with -T option to build.sh.  tools is the
> > objdir for the src/tools, a place where tools are built.  The choice
> > to put tooldir inside objdir by default might be a bit confusing, IMO.
> > Personally, I just use explicit -T.
> 
> Ok! My previous guess was wrong, then. So, IIUC: src/tools are the cross
> tools. The directory tools is just an intermediate step in the building
> of the cross tools. Once they are built, their executables are finally
> placed in the TOOLDIR.

If by the "directory tools" you mean the one in the build directory
(it took me a while to realize that), then yes.  It's called an objdir
and is a standard make(1) feature.  Please check make(1).


> I was confused by the apparently different names that are present in
> tools and in tooldir.NetBSD-9.99.81-amd64. Instead, most of the names
> in tooldir.NetBSD-9.99.81-amd64 are just the names in tools, with `nb'
> prefix. Also, running from tooldir.NetBSD-9.99.81-amd64 a trivial (but
> effective, for a newbie)
> 
> diff nbsed ../../tools/sed/sed
> diff nbcat ../../tools/cat/cat
> 
> shows that the two files match. Correct me if I'm wrong.

Yes, we build our own make, sed, etc as part of the tools build and
install them in $TOOLDIR/bin.  We add nb- prefix to the installed
versions to avoid name clashes with the host programs.  E.g. GNU
programs (can) do the same, using g- prefix (and in some cases that g-
even fused into the name (gcc, gawk)).

-uwe


Home | Main Index | Thread Index | Old Index