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:


Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/llvm/Makefile,v
retrieving revision 1.203
diff -u -p -r1.203 Makefile
--- Makefile    4 Jan 2019 00:14:57 -0000       1.203
+++ Makefile    4 Jan 2019 11:36:37 -0000
@@ -20,7 +20,7 @@ PKGSPEC-main =        llvm-=${LLVM_V}
 PKGNAME-main = llvm-${LLVM_V}
 PKGNAME-python =       py-llvm-${LLVM_V}
 PKGNAME-lldb = lldb-${LLVM_V}
-REVISION-main =        21
+REVISION-main =        22
 REVISION-python = 4
 REVISION-lldb =        1
 CATEGORIES =   devel
@@ -61,6 +61,13 @@ BUILD_DEPENDS +=     devel/swig \
                        textproc/py-sphinx
 RUN_DEPENDS +=         devel/gtest
 
+.include <bsd.port.arch.mk>
+
+.if !${PROPERTIES:Mclang}
+TEST_DEPENDS +=                lang/gcc/${MODGCC4_VERSION},-c++
+RUN_DEPENDS +=         lang/gcc/${MODGCC4_VERSION},-c++
+.endif
+
 # clang python module loads libclang.so dynamically with cdll.LoadLibrary()
 WANTLIB-python =       clang
 RUN_DEPENDS-python =   ${MODPY_RUN_DEPENDS}
@@ -108,8 +115,6 @@ GCC_CONFIG =                ${MACHINE_ARCH}-unknown-op
 CLANG_INCLUDE_PATH =   lib/clang/${LLVM_V}/include
 SUBST_VARS +=          CLANG_INCLUDE_PATH LLVM_V GCC_VER GCC_CONFIG
 
-.include <bsd.port.arch.mk>
-
 post-extract:
        mv ${WRKDIR}/cfe-${LLVM_V}.src ${WRKSRC}/tools/clang
        mv ${WRKDIR}/lld-${LLVM_V}.src ${WRKSRC}/tools/lld
@@ -146,8 +151,3 @@ post-install:
 .endif
 
 .include <bsd.port.mk>
-
-.if ${CHOSEN_COMPILER} == "ports-gcc"
-TEST_DEPENDS +=                lang/gcc/${MODGCC4_VERSION},-c++
-RUN_DEPENDS +=         lang/gcc/${MODGCC4_VERSION},-c++
-.endif


-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to