On 2019/01/04 12:47, Jeremie Courreges-Anglas wrote: > On Mon, Dec 31 2018, George Koehler <kern...@gmail.com> wrote: > > On Mon, 31 Dec 2018 00:15:56 -0700 (MST) > > lan...@openbsd.org wrote: > > > >> http://build-failures.rhaalovely.net//powerpc/2018-12-14/x11/qt5/qtbase.log > > > > Fails to #include <type_traits>, a C++ standard library header. > > Is llvm missing a dependency on g++? > > Yup. On sparc64: > > -->8-- > @depend devel/gtest:gtest-*:gtest-1.8.0p3 > @depend lang/gcc/4.9,-libs:gcc-libs->=4.9,<4.10:gcc-libs-4.9.4p12 > @depend lang/python/2.7,-main:python->=2.7,<2.8:python-2.7.15p1 > --8<-- > > > At the top of the log, gcc-4.9.4p15 and gcc-libs-4.9.4p15 and > > llvm-6.0.1p19 get installed, but g++ doesn't. > > > >> ===> Compiler link: gcc -> /usr/local/bin/clang > >> ===> Compiler link: cc -> /usr/local/bin/clang > >> ===> Compiler link: clang -> /usr/local/bin/clang > >> ===> Compiler link: g++ -> /usr/local/bin/clang++ > >> ===> Compiler link: c++ -> /usr/local/bin/clang++ > >> ===> Compiler link: clang++ -> /usr/local/bin/clang++ > > > > The compiler is ports-clang from the llvm package. The compiler > > needs a C++ library. It can't use libc++ from base-clang because > > powerpc doesn't have base-clang. It can't use libstdc++ from > > base-gcc because that lib can't do C++11. > > > > It must use libestdc++ from ports-gcc. The library is in the > > gcc-libs package but its headers are in the g++ package! This is > > odd because most libraries have their headers in the same package. > > > > lang/clang/clang.port.mk uses `MODULES += gcc4` to find libestdc++ > > and add the dependency on gcc-libs. Then lang/gcc/4.9/gcc4.port.mk > > does `MODGCC4_LANGS += c` to add a dependency on the gcc package. > > There seems to be no dependency on the g++ package. This might > > allow dpb to junk g++ after it builds llvm (using g++) and before > > it builds qtbase. > > Thanks a lot for the analysis. The problem is the way the dep on g++ is > added: CHOSEN_COMPILER can only be known after including <bsd.port.mk>, > but IIUC at that time it's too late to amend RUN/TEST_DEPENDS. > > cc'ing Marc in case he has more input, and Landry since he's probably > hitting this issue since a long time. > > Build on ongoing on sparc64 with the diff below:
I think that's a reasonable fix. I've just been pondering whether to move the headers to gcc-libs, but it seems enough of a special case that it's probably better done that way. Okay with me if tests go well.