NetBSD-Users archive

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

Re: Building NetBSD 11 Release from Source Fails on Linux/MacOS



On Sun, 15 Nov 2026, Helge Pfeiffer wrote:

I just applied the patch from https://gnats.netbsd.org/61011
and everything builds as expected. I love it.


:)

1. How precisely did you call strace?
  I assume that you took the failing commands from the logs 
  and straced it. But which arguments and switches do you 
  use then?
2. Did you directly trace for file reads or did you just 
  trace all system calls?
3. Once you have all the output from strace logged, for what 
  do you search in case of this issue?
  Just anything where an .m4 file appears?


I couldn't reproduce this at all until I used the paths in your setup. Then
it started failing, and I strace(1)'d the whole m4 command-line. I wanted to
see if the entirety of the .m4 files were being read down to the last byte,
because if you skip the lastbyte, say, and that byte was ')', then you'll get
the error we've seen (I had a vague notion that maybe ~/Desktop/workspace/C
was special on Pop!OS for some reason...). But, what I found was that the
last m4 include file wasn't being read at all. So I played around with the
paths (more vague notions of path buffer overflows...).

Since I have the test scripts I used still lying around:

```
$ tail -n+1 ~/tmp/compile-gmp*
==> /home/rvp/tmp/compile-gmp2.sh <==
~/obj/tooldir.Linux-6.18.7-76061807-generic-x86_64/bin/nbm4 \
        -DCONFIG_TOP_SRCDIR=/home/pop-os/mysrc/C/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist \
        -I/home/pop-os/mysrc/C/netbsd-11-src/external/lgpl3/gmp/lib/libgmp \
        -I/home/pop-os/obj/external/lgpl3/gmp/lib/libgmp/dummy \
        -I/home/pop-os/mysrc/C/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist/ \
        -I/home/pop-os/mysrc/C/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist/mpn  \
        -I/home/pop-os/obj/external/lgpl3/gmp/lib/libgmp  -DPIC   -DOPERATION_sqr_diag_addlsh1 \
        ~/mysrc/C/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist/mpn/x86_64/sqr_diag_addlsh1.asm > sqr_diag_addlsh1.s

==> /home/rvp/tmp/compile-gmp3.sh <==
~/obj/tooldir.Linux-6.18.7-76061807-generic-x86_64/bin/nbm4 \
        -DCONFIG_TOP_SRCDIR=/home/pop-os/mysrc/D/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist \
        -I/home/pop-os/mysrc/D/netbsd-11-src/external/lgpl3/gmp/lib/libgmp \
        -I/home/pop-os/obj/external/lgpl3/gmp/lib/libgmp/dummy \
        -I/home/pop-os/mysrc/D/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist/ \
        -I/home/pop-os/mysrc/D/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist/mpn  \
        -I/home/pop-os/obj/external/lgpl3/gmp/lib/libgmp  -DPIC   -DOPERATION_sqr_diag_addlsh1 \
        ~/mysrc/D/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist/mpn/x86_64/sqr_diag_addlsh1.asm > sqr_diag_addlsh1.s

==> /home/rvp/tmp/compile-gmp.sh <==
~/obj/tooldir.Linux-6.18.7-76061807-generic-x86_64/bin/nbm4 \
        -DCONFIG_TOP_SRCDIR=/home/rvp/netbsd-11/src/external/lgpl3/gmp/lib/libgmp/../../dist \
        -I/home/rvp/netbsd-11/src/external/lgpl3/gmp/lib/libgmp \
        -I/home/rvp/obj/external/lgpl3/gmp/lib/libgmp/dummy \
        -I/home/rvp/netbsd-11/src/external/lgpl3/gmp/lib/libgmp/../../dist/ \
        -I/home/rvp/netbsd-11/src/external/lgpl3/gmp/lib/libgmp/../../dist/mpn  \
        -I/home/rvp/obj/external/lgpl3/gmp/lib/libgmp  -DPIC   -DOPERATION_sqr_diag_addlsh1 \
        ~/netbsd-11/src/external/lgpl3/gmp/lib/libgmp/../../dist/mpn/x86_64/sqr_diag_addlsh1.asm > sqr_diag_addlsh1.s

$
```

The change of the directory name from `C' to `D' was that aha! moment. A dir.
called `C' didn't work, while one called `D' did! Now you see it, now you don't.

I could immediately connect it with the C == dnl macro I'd read in the .m4 files.

HTH,

-RVP


Home | Main Index | Thread Index | Old Index