On aarch64, the usual C++ linkage is "c++ c++abi pthread".
Does this seem a reasonable way to handle it? (and change stdc++
to ${CXXLIB} in port Makefiles).

check-lib-depends isn't perfect but at least this way it stops porters
on x86 re-adding stdc++ everywhere. People running it on a libc++ arch
will add an unnecessary pthread if they don't check on a gcc arch as
well, but I don't think there's much that can be done about that.

Index: mk/arch-defines.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/arch-defines.mk,v
retrieving revision 1.32
diff -u -p -r1.32 arch-defines.mk
--- mk/arch-defines.mk  1 Mar 2017 21:58:53 -0000       1.32
+++ mk/arch-defines.mk  7 Apr 2017 19:13:56 -0000
@@ -39,3 +39,9 @@ PROPERTIES += ${PROP:L}
 .    endif
 .  endfor
 .endfor
+
+.if ${PROPERTIES:Mclang}
+CXXLIB = c++ c++abi pthread
+.else
+CXXLIB = stdc++
+.endif
Index: mk/bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1339
diff -u -p -r1.1339 bsd.port.mk
--- mk/bsd.port.mk      28 Feb 2017 21:31:46 -0000      1.1339
+++ mk/bsd.port.mk      7 Apr 2017 19:42:09 -0000
@@ -961,7 +961,7 @@ _lt_libs += lib${_n:S/+/_/g:S/-/_/g:S/./
 # Create the generic variable substitution list, from subst vars
 SUBST_VARS += MACHINE_ARCH ARCH HOMEPAGE ^PREFIX ^SYSCONFDIR FLAVOR_EXT \
        FULLPKGNAME MAINTAINER ^BASE_PKGPATH ^LOCALBASE ^X11BASE ^TRUEPREFIX \
-       ^RCDIR ^LOCALSTATEDIR
+       ^RCDIR ^LOCALSTATEDIR CXXLIB
 _tmpvars =
 
 _PKG_ADD_AUTO ?=
Index: bin/check-lib-depends
===================================================================
RCS file: /cvs/ports/infrastructure/bin/check-lib-depends,v
retrieving revision 1.37
diff -u -p -r1.37 check-lib-depends
--- bin/check-lib-depends       11 Feb 2017 12:52:58 -0000      1.37
+++ bin/check-lib-depends       7 Apr 2017 19:13:56 -0000
@@ -459,6 +459,8 @@ sub print_list
 
        my $line = "";
        for my $k (sort keys %$h) {
+               next if $k eq 'c++abi';
+               $k =~ s/^(std)?c\+\+$/\${CXXLIB}/;
                if (length $line > 50) {
                        $state->say_with_context("#1#2", $head, $line);
                        $line = "";

Reply via email to