Dear all, I am new to NetBSD. I am trying to build NetBSD 11 for amd64 x86_64 from source. I tried it both on a Linux (Pop!_OS 22.04 LTS, which is an Ubuntu 22.04) host and on a MacOS (Sequoia). On both hosts, I see the same issue. Building a release fails, see my detailed description below.
Specifically, I am doing the following: 1. I checkout the source code of the NetBSD 11 branch from the Git repository mirror on GitHub: `git clone --depth 1 https://github.com/NetBSD/src.git -b netbsd-11 netbsd-11-src` 2. I build the tools `./build.sh -U -u -j12 -m amd64 -a x86_64 -O ./obj tools` Building the tools works. No errors are reported. 3. I try to build a release with the following command: `./build.sh -U -u -j12 -m amd64 -a x86_64 -O ./obj release` Step 3 fails. When inspecting the logs, I can see the following error: ``` nbmake[4]: stopped making "build_install" in /home/user/workspace/netbsd-11-src/lib nbmake[3]: stopped making "do-lib" in /home/user/workspace/netbsd-11-src nbmake[2]: stopped making "build" in /home/user/workspace/netbsd-11-src nbmake[1]: stopped making "distribution" in /home/user/workspace/netbsd-11-src nbmake: stopped making "release" in /home/user/workspace/netbsd-11-src ERROR: Failed to make release *** BUILD ABORTED *** ``` When I scroll through the build logs, I can see that there are issues with the nbm4 macro processor. For example, I can see output as in the following, which I believe is the source of the problem: ``` 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-src/./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- src/./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- src/./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 ``` When inspecting the file `external/lgpl3/gmp/dist/mpn/x86_64/sqr_diag_addlsh1.asm`, I see that on line 33, a file `../config.m4` is referenced (33 include(`../config.m4'). However, there is no file `config.m4` under `external/lgpl3/gmp/dist/mpn/` (nor under `external/lgpl3/gmp/dist/mpn/x86_64/`). The only `config.m4` files that I can find are under the respective lib directory, e.g., `external/lgpl3/gmp/lib/libgmp/arch/x86_64/config.m4` (I found them via `find external/lgpl3/gmp -name config.m4 | sort`). Now, I do not know how to proceed. I am wondering: a) Is there a problem with the configuration step and the file `config.m4` is not generated in `external/lgpl3/gmp/dist/mpn/`? (Unfortunately, I cannot find a log message that suggests that, but I also do not know what to look for precisely...) 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? I searched the problem databases for "nbm4 external/lgpl3/gmp/" and "NetBSD 11 from source", but I do not find anything related to my issue there. When searching with the same search queries in the mailing list archive, I cannot find messages that address/solve my problem. I would appreciate any help so that I can build NetBSD 11 from source. Thank you very much in advance. Best, Helge
