tech-toolchain archive

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

build.sh on OpenBSD 6.9



I will file a PR (obviously this is very low priority) but here are my findings on attempting to build NetBSD current on OpenBSD 6.9 with their default compiler. I’ve tried gcc (4* is supplied) and gcc from their ports collection - neither is more successful but for other reasons.

TL;DR is:

- nbmakeinfo seg faults building gccint.texi during toolchain build
- liblto_plugin is installed in the toolchain with so.0.0 major & minor number (standing OpenBSD approach to libraries) but so is expected.
- the sysinst shell script tickles some unexpected behaviour in the OpenBSD shell.

The long details:

There are three distinct problems building NetBSD sources on OpenBSD.
I've tested this on two different OpenBSD 6.9 machines.

1. nbmakeinfo seg faults on building gccint.texi

(Output stops around here:
12.2 Class hierarchy of GIMPLE statements
=========================================
)

/home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo --no-split -I . -I /home/cjep/NetBSD-current/src/tools/gcc/../../external/gpl3/gcc/dist/gcc/doc -I /home/cjep/NetBSD-current/src/tools/gcc/../../external/gpl3/gcc/dist/gcc/doc/include -o doc/gccint.info /home/cjep/NetBSD-current/src/tools/gcc/../../external/gpl3/gcc/dist/gcc/doc/gccint.texi

cjep@blowfish% gdb --core=nbmakeinfo.core "/home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo"
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-unknown-openbsd6.9"...
(no debugging symbols found)

Core was generated by `nbmakeinfo'.
Program terminated with signal 11, Segmentation fault.
(no debugging symbols found)
Loaded symbols for /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
Reading symbols from /usr/lib/libc.so.96.0...done.
Loaded symbols for /usr/lib/libc.so.96.0
Reading symbols from /usr/libexec/ld.so...Error while reading shared library symbols:
Dwarf Error: wrong version in compilation unit header (is 4, should be 2) [in module /usr/libexec/ld.so]
#0  0x0000016615fed6c6 in output_multitable_row ()
   from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
.gdbinit:12: Error in sourced command file:
/home/cjep/NetBSD-current/src/tools/gcc/../../external/gpl3/gcc/dist/gcc/gdbinit.in:311: Error in sourced command file:
Undefined command: "alias".  Try "help".
(gdb) bt
#0  0x0000016615fed6c6 in output_multitable_row ()
   from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
#1  0x0000016615fed436 in multitable_item ()
   from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
#2  0x0000016615fe0833 in cm_item ()
   from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
#3  0x0000016615fe8142 in reader_loop ()
   from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
#4  0x0000016615fd5e47 in handle_include ()
   from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
#5  0x0000016615fe8142 in reader_loop ()
   from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
#6  0x0000016615fec3b2 in convert_from_loaded_file ()
   from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
#7  0x0000016615fe576f in main ()
   from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo



As a workaround to see if I could get further, I reran ./build.sh -U -u 
tools.  Because a fragment of texinfo target exists for the broken 
target, it was possibly to "finish" the tools build, albeit with broken 
info pages. I also set MKINFO=no to avoid tickling nbmakeinfo further.

Then:

2. liblto_plugin is installed in the tools with a major & minor number 0.
The toolchain expects it without a major and minor number. I believe this
is simply the way that OpenBSD handles shared objects. It's not clear
to me here what the best approach is: a) flags to linker; b) flags to
installer; c) symbolic link hack. It looks like this is the only
shared object in our build toolchain.

As a workaround I copied the file and was able to progress:

cjep@blowfish% pwd
/home/cjep/src/NetBSD/obj/amd64-x86_64/home/cjep/usr/src/tooldir.OpenBSD-6.9-amd64/libexec/gcc/x86_64--netbsd/10.3.0
cjep@blowfish% ls -la liblto_plugin.so
-rwxr-xr-x  1 cjep  cjep  113112 May 13 22:05 liblto_plugin.so.0.0

-rwxr-xr-x  1 cjep  cjep  113112 May 13 22:05 liblto_plugin.so


Then:

3. sysinst will not build due to the check for formatting in one of the 
German messages files. This looks like a bug/feature/characteristic of the 
OpenBSD sh running msg_xlat.sh in the count logic.  I was able to get 
past this by using bash as HOST_SH (which of course is not native 
to the build, but on Open sh == ksh leaving little other options).

msg_xlat.sh: ERROR Wrong number of format specifiers in "openfail", got 5, expected 4
*** Failed target:  sysinstmsgs.de
*** Failed command: /home/cjep/usr/src/obj/tooldir.OpenBSD-6.9-amd64/bin/nbsed "s/@@VERSION@@/9.99.82/" /home/cjep/usr/src/usr.sbin/sysinst/arch/amd64/.    ./../msg.mi.de /home/cjep/usr/src/usr.sbin/sysinst/arch/amd64/../i386/msg.md    .de /home/cjep/usr/src/usr.sbin/sysinst/arch/amd64/../../msg.mbr.de /home/cj    ep/usr/src/usr.sbin/sysinst/arch/amd64/../../msg.pm.de | /home/cjep/usr/src/    obj/tooldir.OpenBSD-6.9-amd64/bin/nbsed "s/@@MACHINE@@/amd64/" | /home/cjep/    usr/src/obj/tooldir.OpenBSD-6.9-amd64/bin/nbawk -f /home/cjep/usr/src/usr.sb    in/sysinst/arch/amd64/../../unif.awk -v defines="BOOTSEL AOUT2ELF HAVE_INSTA    LL_IMAGE" | /bin/sh /home/cjep/usr/src/usr.sbin/sysinst/arch/amd64/../../msg    _xlat.sh -f sysinstmsgs.fmtcnt > sysinstmsgs.de


KRgds
Chris




Home | Main Index | Thread Index | Old Index