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
Thank you Martin and Greg for your comments and hints!
I tried removing the `-O` switch for the objdir completely so that defaults are used and I tried with an absolute path
for it.
In both cases, the problem persists, so I do not think the issue is related to that I was using a relative path for `-O`
previously.
@Greg, you are absolutely correct in that I should switch to less parallelism to identify the issue.
For the following description, I used `-j1` to get a better overview.
For my experiments in this message, I used the following build command:
```
./build.sh -U -u -j1 -m amd64 -a x86_64 -O /home/user/workspace/netbsd-11-obj release
```
@Greg, after building the tools, I have the same two `config.m4` files in the tools dir:
```
$ find /home/user/workspace/netbsd-11-obj/ -name config.m4
/home/user/workspace/netbsd-11-obj/external/lgpl3/gmp/lib/libgmp/config.m4
/home/user/workspace/netbsd-11-obj/tools/gmp/build/config.m4
```
Thank you Martin for pointing me to to the respective target (`${.OBJDIR}/config.m4:
${.CURDIR}/arch/${GMP_MACHINE_ARCH}/config.m4`) in the Makefile (`external/lgpl3/gmp/lib/libgmp/Makefile`).
I did a bit of "print debugging".
In target `${.OBJDIR}/config.m4: ${.CURDIR}/arch/${GMP_MACHINE_ARCH}/config.m4
(https://github.com/NetBSD/src/blob/4198f5370c187384b1de46b9b0fcd04462a420e0/external/lgpl3/gmp/lib/libgmp/Makefile#L216)
,
I now print the value of `${.OBJDIR}` and the other three paths that are used in the target.
Additionally, I do the same in target `${_build:R}.s: Makefile dummy ${.OBJDIR}/config.m4 ${DIST}/${_src}`
(https://github.com/NetBSD/src/blob/4198f5370c187384b1de46b9b0fcd04462a420e0/external/lgpl3/gmp/lib/libgmp/Makefile#L228)
, which has the former as a requirement.
This is just to make sure that the targets are invoked.
With that, I find that the targets are invoked, see the the attached log below.
@Martin, you are correct, the config.m4 is copied from cp ${.CURDIR}/arch/${GMP_MACHINE_ARCH}/config.m4
${.OBJDIR}/config.m4, see first line of the log snippet below.
However, that is not where the file `sqr_diag_addlsh1.asm` expects `config.m4` to be.
The second last line in the log shows that nbm4 preprocesses `sqr_diag_addlsh1.asm`, in directory
`/home/user/workspace/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist/mpn/x86_64/`.
Since `sqr_diag_addlsh1.asm` references config.m4 in the parent directory (line 33, include(`../config.m4')), it expects
such a config.m4 file in the source tree in `/home/user/workspace/netbsd-11-src/external/lgpl3/gmp/dist/mpn/`, where it
does not exist.
```
rm -f /home/user/workspace/netbsd-11-obj/external/lgpl3/gmp/lib/libgmp/config.m4 && cp /home/user/workspace/netbsd-11-
src/external/lgpl3/gmp/lib/libgmp/arch/x86_64/config.m4 /home/user/workspace/netbsd-11-
obj/external/lgpl3/gmp/lib/libgmp/config.m4
/home/user/workspace/netbsd-11-obj/external/lgpl3/gmp/lib/libgmp/gen-fac 64 0 > /home/user/workspace/netbsd-11-
obj/external/lgpl3/gmp/lib/libgmp/fac_table.h
/home/user/workspace/netbsd-11-obj/external/lgpl3/gmp/lib/libgmp/gen-fib header 64 0 > /home/user/workspace/netbsd-11-
obj/external/lgpl3/gmp/lib/libgmp/fib_table.h
/home/user/workspace/netbsd-11-obj/external/lgpl3/gmp/lib/libgmp/gen-fib table 64 0 > /home/user/workspace/netbsd-11-
obj/external/lgpl3/gmp/lib/libgmp/fib_table.c
/home/user/workspace/netbsd-11-obj/external/lgpl3/gmp/lib/libgmp/gen-jacobitab > /home/user/workspace/netbsd-11-
obj/external/lgpl3/gmp/lib/libgmp/jacobitab.h
/home/user/workspace/netbsd-11-obj/external/lgpl3/gmp/lib/libgmp/gen-bases header 64 0 > /home/user/workspace/netbsd-11-
obj/external/lgpl3/gmp/lib/libgmp/mp_bases.h
/home/user/workspace/netbsd-11-obj/external/lgpl3/gmp/lib/libgmp/gen-bases table 64 0 > /home/user/workspace/netbsd-11-
obj/external/lgpl3/gmp/lib/libgmp/mp_bases.c
/home/user/workspace/netbsd-11-obj/external/lgpl3/gmp/lib/libgmp/gen-trialdivtab 64 8000 > /home/user/workspace/netbsd-
11-obj/external/lgpl3/gmp/lib/libgmp/trialdivtab.h
/home/user/workspace/netbsd-11-obj/tooldir.Linux-5.19.0-76051900-generic-x86_64/bin/nbm4 -
DCONFIG_TOP_SRCDIR=/home/user/workspace/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist -
I/home/user/workspace/netbsd-11-src/external/lgpl3/gmp/lib/libgmp -I/home/user/workspace/netbsd-11-
obj/external/lgpl3/gmp/lib/libgmp/dummy -I/home/user/workspace/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist/ -
I/home/user/workspace/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist/mpn -I/home/user/workspace/netbsd-11-
obj/external/lgpl3/gmp/lib/libgmp -DPIC -DOPERATION_sqr_diag_addlsh1 /home/user/workspace/netbsd-11-
src/external/lgpl3/gmp/lib/libgmp/../../dist/mpn/x86_64/sqr_diag_addlsh1.asm > sqr_diag_addlsh1.s
nbm4: unexpected end of input, unclosed parenthesis:
/home/user/workspace/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist/mpn/x86_64/sqr_diag_addlsh1.asm at line
116
*** Failed target: sqr_diag_addlsh1.s
*** In directory: /home/user/workspace/netbsd-11-src/external/lgpl3/gmp/lib/libgmp
*** Failed commands:
${TOOL_M4} -DCONFIG_TOP_SRCDIR=${DIST} ${BUILD_S_INCS} ${M4FLAGS} ${M4FLAGS.${.TARGET:R}} -
DOPERATION_${.TARGET:R} ${DIST}/${:Umpn/x86_64/sqr_diag_addlsh1.asm} > ${.TARGET}
=> /home/user/workspace/netbsd-11-obj/tooldir.Linux-5.19.0-76051900-generic-x86_64/bin/nbm4 -
DCONFIG_TOP_SRCDIR=/home/user/workspace/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist -
I/home/user/workspace/netbsd-11-src/external/lgpl3/gmp/lib/libgmp -I/home/user/workspace/netbsd-11-
obj/external/lgpl3/gmp/lib/libgmp/dummy -I/home/user/workspace/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist/ -
I/home/user/workspace/netbsd-11-src/external/lgpl3/gmp/lib/libgmp/../../dist/mpn -I/home/user/workspace/netbsd-11-
obj/external/lgpl3/gmp/lib/libgmp -DPIC -DOPERATION_sqr_diag_addlsh1 /home/user/workspace/netbsd-11-
src/external/lgpl3/gmp/lib/libgmp/../../dist/mpn/x86_64/sqr_diag_addlsh1.asm > sqr_diag_addlsh1.s
*** [sqr_diag_addlsh1.s] Error code 1
```
@Greg, you suggest that I run nbmake-amd64 in the top of the source, tree. When I do that, the build stops with the same
error as above.
That is, when nbm4 tries to preprocess the ASM files in `external/lgpl3/gmp/lib/libgmp/../../dist/mpn/x86_64`.
(For me, nbmake-amd64 is in the respective tooldir in /home/user/workspace/netbsd-11-obj/tooldir.Linux-5.19.0-76051900-
generic-x86_64/bin/nbmake-amd64)
To figure out if this is just an issue of building NetBSD 11 from source on my Linux host, I just tried to build NetBSD
10 with the same build command.
It fails with the same error.
That suggests, that there is something else wrong on my side. Unfortunately, I do not know where to look next to identify
the issue.
Thank you for you help in advance!
On Mon, 2026-11-02 at 15:35 +0100, Martin Husemann wrote:
> [You don't often get email from martin%duskware.de@localhost. Learn why this is important at
> https://aka.ms/LearnAboutSenderIdentification ;]
>
> On Mon, Nov 02, 2026 at 01:57:19PM +0000, Helge Pfeiffer wrote:
> > b) Is the `config.m4` file that `nbm4` expects under `external/lgpl3/gmp/dist/mpn/` the one that is under
> > `external/lgpl3/gmp/lib/libgmp/arch/x86_64/config.m4`?
> > If yes, why is it there and how shall I get it to the right place without manually copying/linking it there?
>
> Yes, and the magic is slightly hidden:
>
> # XXX stuff looks for "../config.m4"
> dummy:
> mkdir dummy
> ${.OBJDIR}/config.m4: ${.CURDIR}/arch/${GMP_MACHINE_ARCH}/config.m4
> rm -f ${.OBJDIR}/config.m4 && cp ${.CURDIR}/arch/${GMP_MACHINE_ARCH}/co$
>
> CLEANFILES+= config.m4
>
> in external/lgpl3/gmp/lib/libgmp/Makefile.
>
> So the arch/.../config.m4 file is copied to ${.OBJDIR}/config.m4 and should
> be found from there.
>
> Martin
Home |
Main Index |
Thread Index |
Old Index