Re: I can't cross build 10 on 10??

2023-04-28 Thread Lloyd Parkes

And now it works fine.

The only change I made was to update my build host to the latest 
10_BETA. I had already updated the base and comp sets on that host 
before I sent my first email because it smelled like tool(chain) confusion.


Thanks for the advice even though I didn't end up needing it.

Cheers,
Lloyd


Re: I can't cross build 10 on 10??

2023-04-28 Thread RVP

On Fri, 28 Apr 2023, Lloyd Parkes wrote:

It looks like something is going wrong with the host tools and they are 
trying to use host includes when they should be using in-tree includes. One 
concise example is



#   compile  csu/gcrt0.o
/home/lloyd/NetBSD/tooldir/bin/sparc--netbsdelf-gcc 
--sysroot=/home/lloyd/NetBSD/destdir -DELFSIZE=32

[...]
machine/elf_support.h: No such file or directory
  150 | #include 
  |  ^~~
compilation terminated.
*** Failed target: gcrt0.o
...
┌──(lloyd@ceph4)-[~/NetBSD/src]
└─$ find . -name elf_support.h 
./sys/arch/sparc/include/elf_support.h

./sys/arch/sparc64/include/elf_support.h




That header file seems sparc-specific (no other arch. has it.) and it
should've been copied into the `--sysroot=' dir. under usr/include.

Does `/home/lloyd/NetBSD/destdir/usr/include/machine' point to either
sparc or sparc64, or to some other arch?

For some reason, the include path isn't set correctly. I can see that the 
missing files are in the tree.




That sysroot dir. looks a bit odd: build.sh would've added an `.arch'
suffix--like: destdir.amd64--to it. This looks like a local build issue--
ie. the compiler command-line you posted looks very like the standard
invocation on amd64.

-RVP


Re: I can't cross build 10 on 10??

2023-04-28 Thread Valery Ushakov
On Fri, Apr 28, 2023 at 13:22:02 +1200, Lloyd Parkes wrote:

> It looks like something is going wrong with the host tools and they are
> trying to use host includes when they should be using in-tree includes. One
> concise example is
[...]
> For some reason, the include path isn't set correctly. I can see that the
> missing files are in the tree.

You can go to $OBJDIR/lib/csu and re-run that command with --verbose
and gcc will tell you the include directories it uses.

You should some something like:

ignoring nonexistent directory 
"/home/uwe/work/netbsd/build/distrib/sparc/usr/local/include"
ignoring nonexistent directory 
"/home/uwe/work/netbsd/build/tools/lib/gcc/sparc--netbsdelf/10.4.0/../../../../sparc--netbsdelf/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/uwe/work/netbsd/ro/src/lib/csu/arch/sparc
 /home/uwe/work/netbsd/ro/src/lib/csu/common
 .
 /home/uwe/work/netbsd/build/distrib/sparc/usr/include/gcc-10
 /home/uwe/work/netbsd/build/tools/lib/gcc/sparc--netbsdelf/10.4.0/include-fixed
 /home/uwe/work/netbsd/build/distrib/sparc/usr/include
End of search list.

-uwe


I can't cross build 10 on 10??

2023-04-27 Thread Lloyd Parkes

Hi all,
I recently started trying to build 10_BETA for some of my non-amd64 
platforms using my 10_BETA amd64 build hosts and it just won't work.


It looks like something is going wrong with the host tools and they are 
trying to use host includes when they should be using in-tree includes. 
One concise example is



#   compile  csu/gcrt0.o
/home/lloyd/NetBSD/tooldir/bin/sparc--netbsdelf-gcc 
--sysroot=/home/lloyd/NetBSD/destdir -DELFSIZE=32 
-I/home/lloyd/NetBSD/src/lib/csu/arch/sparc 
-I/home/lloyd/NetBSD/src/lib/csu/common -I.  -x assembler-with-cpp -c 
/home/lloyd/NetBSD/src/lib/csu/arch/sparc/crt0.S -o gcrt0.o.S.o
/home/lloyd/NetBSD/tooldir/bin/sparc--netbsdelf-gcc -O2  -std=gnu99
-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wno-sign-compare  -Wsystem-headers   -Wno-traditional   -Wa,--fatal-warnings  
-Wreturn-type -Wswitch-Wshadow -Wcast-qual -Wwrite-strings -Wextra 
-Wno-unused-parameter -Wno-sign-compare -Wold-style-definition -Wsign-compare 
-Wformat=2  -Wno-format-zero-length -Werror 
--sysroot=/home/lloyd/NetBSD/destdir -DELFSIZE=32 
-I/home/lloyd/NetBSD/src/lib/csu/arch/sparc 
-I/home/lloyd/NetBSD/src/lib/csu/common -I.  -c -fPIC -DMCRT0 
/home/lloyd/NetBSD/src/lib/csu/common/crt0-common.c -o gcrt0.o.c.o
/home/lloyd/NetBSD/src/lib/csu/common/crt0-common.c:150:10: fatal error: 
machine/elf_support.h: No such file or directory
  150 | #include 
  |  ^~~
compilation terminated.
*** Failed target: gcrt0.o
...
┌──(lloyd@ceph4)-[~/NetBSD/src]
└─$ find . -name elf_support.h  
./sys/arch/sparc/include/elf_support.h

./sys/arch/sparc64/include/elf_support.h


For some reason, the include path isn't set correctly. I can see that 
the missing files are in the tree.


I'm using sources from Mercurial and I can see that my local changes are 
utterly trivial and I do _seem_ to have reasonably up to date sources 
judging by the most recent commit message that says "Tickets #145 - #150".



┌──(lloyd@ceph4)-[~/NetBSD/src]
└─$ hg status
M etc/rc.d/entropy
M share/man/man7/entropy.7
M sys/arch/amd64/conf/GENERIC
┌──(lloyd@ceph4)-[~/NetBSD/src]
└─$ hg sum   
parent: 1023970:7893cdb2b634 
 Tickets #145 - #150

branch: netbsd-10
commit: 3 modified
update: (current)


I've tried deleting destdir, objdir, releasedir and tooldir with no 
change in behaviour.


Do I remember this being discussed before? Am I going mad? Probably. Any 
help will be appreciated.


Cheers,
Lloyd