NetBSD-Bugs archive

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

toolchain/57014: Cross-build of NetBSD fails on OpenBSD 7.1 due to gcc generators



>Number:         57014
>Category:       toolchain
>Synopsis:       Cross-build of NetBSD fails on OpenBSD 7.1 due to gcc generators
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 17 11:40:00 +0000 2022
>Originator:     Chris Pinnock
>Release:        NetBSD-current as of today
>Organization:
Very little
>Environment:
OpenBSD blowfish.home 7.1 GENERIC.MP#3 amd64
OpenBSD clang version 13.0.0
Target: amd64-unknown-openbsd7.1
Thread model: posix

>Description:
The cross-build fails during the compilation of the target gcc compiler
due to problems linking the GCC generator backend. The generator is build
with the host compiler because it needs to run on the host to output.

--- gencondmd ---
#      link  backend/gencondmd
c++ -std=gnu++98 -I/home/cjep/src/NetBSD/current/src/../objects/amd64/external/gpl3/gcc/usr.bin/backend -I/home/cjep/src/NetBSD/current/src/../objects/amd64/external/gpl3/gcc/usr.bin/host-libiberty/libiberty -I. -I/home/cjep/src/NetBSD/current/src/external/gpl3/gcc/usr.bin/backend/../gcc/arch/x86_64 -DIN_GCC -DHAVE_CONFIG_H -I/home/cjep/src/NetBSD/current/src/external/gpl3/gcc/dist/gcc -I/home/cjep/src/NetBSD/current/src/external/gpl3/gcc/dist/gcc/. -I/home/cjep/src/NetBSD/current/src/external/gpl3/gcc/dist/gcc/../include -I/home/cjep/src/NetBSD/current/src/external/gpl3/gcc/dist/gcc/../libcpp/include -I/home/cjep/src/NetBSD/current/src/external/gpl3/gcc/dist/gcc/../libdecnumber -I/home/cjep/src/NetBSD/current/src/external/gpl3/gcc/dist/gcc/../libdecnumber/dpd -I/home/cjep/src/NetBSD/current/src/external/gpl3/gcc/dist/gcc/../libbacktrace -DGENERATOR_FILE -I/home/cjep/src/NetBSD/current/src/external/gpl3/gcc/usr.bin/backend/..  -o gencondmd gencondmd.lo build-rtl.lo read-rtl.lo build-
 ggc-none.lo vec.lo min-insn-modes.lo gensupport.lo build-print-rtl.lo hash-table.lo sort.lo read-md.lo build-errors.lo -L/home/cjep/src/NetBSD/current/src/../objects/amd64/tooldir.OpenBSD-7.1-amd64/lib -lnbcompat /home/cjep/src/NetBSD/current/src/../objects/amd64/external/gpl3/gcc/usr.bin/host-libiberty/libiberty/libiberty.a  build-sort.lo
ld: error: undefined symbol: ix86_isa_flags
 referenced by gencondmd.c
               gencondmd.lo:(__cxx_global_var_init.101)
 referenced by gencondmd.c
               gencondmd.lo:(__cxx_global_var_init.101)
 referenced by gencondmd.c
               gencondmd.lo:(__cxx_global_var_init.101)
 referenced 2268 more times
(etc)

The tools target builds fine (i.e. clang is able to build nbgcc and friends 
ok). It is when the target compiler is being built by the tools that there is a 
problem (although note that the host compiler is at work here because the
generator needs to run on the host)..

This also affects macOS Monterey builds using the Xcode clang compiler 
(at least for me). Does not seem to be a problem with FreeBSD's clang (yet).

>How-To-Repeat:
On an OpenBSD 7.1 box (or a macOS Monterey box with Xcode tools):
./build.sh -U -u build

>Fix:
Commenting out line 29 of external/gpl3/gcc/usr.bin/backend/Makefile
#HOST_CXXFLAGS+=        -std=gnu++98
results in a successful build. Perhaps we should not include this flag when
a. building the target compiler (i.e. when we are not building tools)
b. the host compiler is clang.
or somehow not use it for the GCC generators that need to compile on the host

(This change also allows me to build again on macOS Monterey, although
there CTF tools are not working properly during the build for me. On the
relevant platforms i386, amd64, arm the nbctfmerge tool seg faults - will
look at this separately and file a different PR when I have time)



Home | Main Index | Thread Index | Old Index