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



Helge Pfeiffer <ropf%itu.dk@localhost> writes:

(It would be nice if you could not wrap log lines; that's an exception
to the norm that email be wrapped to fit in an 80 column terminal.)

> 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.

That's good to know; I'm perhaps unreasonably suspicious of relative
paths, and at least it's an easy experiment.

> @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

That's good; we can gradually mostly eliminate the things people think
might be wrong.

> @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.  

../ probably is relative to the current working directory of nbm4 at run
time, not the source file.


> ```
> 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

Look at sqr_diag_addlsh1.asm, and line 116.

Also note that there are -I args to m4.

> *** 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)

I meant to suggest that you run it in the directory where things failed,
but indeed what you did works.  Running it separately lets you invoke
substeps without having to start at the top, and is helpful for
debugging.

> 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.

There are a bunch of requirements for host tools to run the cross build.

I would wonder if you have a super-new gcc, but this sounds like Ubuntu
LTS, not yesterday's Arch.


Home | Main Index | Thread Index | Old Index