Sebastien Marie:

> I am also surprised that lang/rust succeed (and devel/cargo didn't).

lang/rust builds with gcc 4.9, so it sidesteps clang.

> Is it possible to have more information on the build configuration ?
> Stuart already mentioned libestdc++ vs libc++ for example.

I have the base clang installed in addition to gcc:
/usr/bin/clang, /usr/bin/clang++

(I'm reluctant to publicly post instructions how to set this up,
since I know people who don't understand what they are doing will
mess with it and shoot themselves in the foot.)

Beyond that, I have the following ports infrastructure patches:
* Link clang,clang++ as cc,c++ into the leading PATH directory.
* Move amd64 from GCC4_ARCHS to CLANG_ARCHS.
* In the clang module, also link /usr/local/bin/clang and clang++ 
  into the leading PATH directory.

Ports that use MODCLANG still use the ports clang with this.

If I didn't miss something, base clang++ uses libc++ and ports
clang++ still uses libestdc++.


Index: lang/clang/clang.port.mk
===================================================================
RCS file: /cvs/ports/lang/clang/clang.port.mk,v
retrieving revision 1.21
diff -u -p -r1.21 clang.port.mk
--- lang/clang/clang.port.mk    14 Mar 2017 17:30:30 -0000      1.21
+++ lang/clang/clang.port.mk    12 Apr 2017 22:13:01 -0000
@@ -31,10 +31,10 @@ _MODCLANG_LINKS =
 .if ${_MODCLANG_ARCH_USES:L} == "yes"
 
 BUILD_DEPENDS += devel/llvm>=${MODCLANG_VERSION}
-_MODCLANG_LINKS = clang gcc clang cc
+_MODCLANG_LINKS = clang gcc clang cc clang clang
 
 .  if ${MODCLANG_LANGS:L:Mc++}
-_MODCLANG_LINKS += clang++ g++ clang++ c++
+_MODCLANG_LINKS += clang++ g++ clang++ c++ clang++ clang++
 # uses libestdc++
 MODULES += gcc4
 MODCLANG_CPPLIBDEP = ${MODGCC4_CPPLIBDEP}
Index: infrastructure/mk/arch-defines.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/arch-defines.mk,v
retrieving revision 1.33
diff -u -p -r1.33 arch-defines.mk
--- infrastructure/mk/arch-defines.mk   10 Apr 2017 11:18:28 -0000      1.33
+++ infrastructure/mk/arch-defines.mk   12 Apr 2017 23:06:01 -0000
@@ -19,8 +19,8 @@ APM_ARCHS = amd64 i386 loongson macppc s
 BE_ARCHS = hppa m88k mips64 powerpc sparc64
 LE_ARCHS = aarch64 alpha amd64 arm i386 mips64el sh
 LP64_ARCHS = aarch64 alpha amd64 sparc64 mips64 mips64el
-CLANG_ARCHS = aarch64
-GCC4_ARCHS = alpha amd64 arm armv7 i386 hppa landisk loongson \
+CLANG_ARCHS = aarch64 amd64
+GCC4_ARCHS = alpha arm armv7 i386 hppa landisk loongson \
        macppc mips64 mips64el octeon powerpc sgi sh socppc sparc64
 GCC3_ARCHS = aviion luna88k m88k
 # XXX easier for ports that depend on mono
Index: infrastructure/mk/bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1340
diff -u -p -r1.1340 bsd.port.mk
--- infrastructure/mk/bsd.port.mk       11 Apr 2017 15:36:56 -0000      1.1340
+++ infrastructure/mk/bsd.port.mk       12 Apr 2017 22:10:32 -0000
@@ -2437,6 +2437,11 @@ ${_WRKDIR_COOKIE}:
        @ln -sf msgfmt ${WRKDIR}/bin/${name}
 .  endfor
 .endif
+# force clang as default compiler
+       @ln -sf /usr/bin/clang ${WRKDIR}/bin/cc
+       @ln -sf /usr/bin/clang ${WRKDIR}/bin/gcc
+       @ln -sf /usr/bin/clang++ ${WRKDIR}/bin/c++
+       @ln -sf /usr/bin/clang++ ${WRKDIR}/bin/g++
        @${_MAKE_COOKIE} $@
 
 ${_EXTRACT_COOKIE}: ${_WRKDIR_COOKIE}
-- 
Christian "naddy" Weisgerber                          [email protected]

Reply via email to