powerpc 10.0-STABLE's clang 3.4.1: successfully built devel/libcxxrt , devel/libc++ , and nearly devel/boost-all

Mark Millard markmi at dsl-only.net
Fri Jun 27 15:19:34 UTC 2014


I see there were dumb editing errors in the last part of my updated compiled.mk : I messed up the quoting for my addition. So a new diff is needed to supply missing \'s for nested quotes and a missing quote ("). But I was more trying to suggest background information that would contribute to an official fix --instead of providing "the patches" directly: there may be better alternatives to my specifics.

--- compiled.mk.original	2014-06-27 01:03:06.000000000 -0700
+++ compiled.mk	2014-06-27 08:03:47.000000000 -0700
@@ -20,7 +20,9 @@
 # Our compiler-flags will be added AFTER those set by bjam. We remove
 # the optimization level, because Boost sets it itself (to -O3 in case
 # of gcc/g++):
-BJAM_ARGS+=    cxxflags="${CXXFLAGS:N-O*}" cflags="${CFLAGS:N-O*}"
+BJAM_ARGS+=    cxxflags="${CXXFLAGS:N-O*} -I${LOCALBASE}/include/c++/v1" cflags="${CFLAGS:N-O*}"
+
+BJAM_ARGS+=	linkflags="${LINKFLAGS} -L${LOCALBASE}/lib"
 
 BOOST_TOOLSET=	${CHOSEN_COMPILER_TYPE}
 
@@ -52,7 +54,7 @@
 
 post-patch:
 .if defined(USE_BINUTILS)
-	@${ECHO} "using ${BOOST_TOOLSET} : : ${CXX} : <linkflags>-B${LOCALBASE}/bin ;" >> ${WRKSRC}/tools/build/v2/user-config.jam
+	@${ECHO} "using ${BOOST_TOOLSET} : : ${CXX} : <linkflags>\"-B${LOCALBASE}/bin -L${LOCALBASE}/lib\" ;" >> ${WRKSRC}/tools/build/v2/user-config.jam
 .else
 	@${ECHO} "using ${BOOST_TOOLSET} : : ${CXX} ;" >> ${WRKSRC}/tools/build/v2/user-config.jam
 .endif

===
Mark Millard
markmi at dsl-only.net

On Jun 27, 2014, at 7:24 AM, Mark Millard <markmi at dsl-only.net> wrote:

[The following does not deal with libboost_locale.* issues: boost warns up front that

    - iconv (libc)             : no
    - iconv (separate)         : no
    - icu                      : no
    - icu (lib64)              : no
- Boost.Locale needs either iconv or ICU library to be built.

But the 10849 attempted boost targets all built and it got to
Installing for boost-libs-1.55.0_3 before the first error: various
.../stage/usr/local/lib/libboost_locale.* not being found. I did
not select to build Boost-Python.]


The  /usr/ports/Mk/Uses/compiler.mk is from before the recent changes (so that clang
would still be used like it was before).

This test build got all the way to installing boost-libs-1.55.0_3 before libboost_locale
finally stopped it. devel/libcxxrt and devel/libc++ were installed. See below.

root at FBSDG41466M0:~ # portmaster -t devel/libcxxrt devel/libc++ devel/boost-all


===>>> Working on:
	devel/libcxxrt
	devel/libc++
	devel/boost-all

... (Much omitted) ...
===>>> Installation of devel/libcxxrt (libcxxrt-20131225_1) succeeded
... (Much omitted) ...
===>>> Installation of devel/libc++ (libc++-208080) succeeded
... (Much omitted) ...

common.copy /usr/ports/devel/boost-libs/work/stage/usr/local/lib/libboost_wave.a
...updated 10849 targets...
====> Compressing man pages (compress-man)
===>  Installing for boost-libs-1.55.0_3
===>  Checking if devel/boost-libs already installed
===>   Registering installation for boost-libs-1.55.0_3 as automatic
pkg-static: lstat(/usr/ports/devel/boost-libs/work/stage/usr/local/lib/libboost_locale.a): No such file or directory
pkg-static: lstat(/usr/ports/devel/boost-libs/work/stage/usr/local/lib/libboost_locale.so): No such file or directory
pkg-static: lstat(/usr/ports/devel/boost-libs/work/stage/usr/local/lib/libboost_locale.so.1.55.0): No such file or directory
pkg-static: lstat(/usr/ports/devel/boost-libs/work/stage/usr/local/lib/libboost_locale.so.5): No such file or directory
*** Error code 74

Stop.
make[1]: stopped in /usr/ports/devel/boost-libs
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/boost-libs

===>>> Installation of boost-libs-1.55.0_3 (devel/boost-libs) failed
===>>> Aborting update

===>>> Update for devel/boost-libs failed
===>>> Aborting update

===>>> Update for devel/boost-all failed
===>>> Aborting update

===>>> The following actions were performed:
	Installation of devel/libcxxrt (libcxxrt-20131225_1)
	Installation of devel/libc++ (libc++-208080)


It appears that I did not have the usual compiler/linker problems for
built devel/libcxxrt , devel/libc++ , and devel/boost-all on  powerpc
using 10.0-STABLE's clang 3.4.1 --up to the boost-locale.* issues.

The point of this was to see if compiling and linking could work. The minor changes to
devel/libc++/Makefile and devel/boost-all/compiled.mk , while very small, were only
intended to enable the test in my local environment: I do not claim wide enough knowledge
of freebsd for general updates.



For devel/libc++/Makefile:

--- Makefile.original	2014-06-27 06:17:19.000000000 -0700
+++ Makefile	2014-06-27 06:28:34.000000000 -0700
@@ -21,6 +21,7 @@
 LIB_DEPENDS=	libcxxrt.so:${PORTSDIR}/devel/libcxxrt
 
 USES+=		cmake:outsource compiler:c++11-lang
+CXXFLAGS+=	-nostdlib
 USE_LDCONFIG=	yes
 LDFLAGS+=	-L${LOCALBASE}/lib
 


For devel/boost-all/compiled.mk:

--- compiled.mk.original	2014-06-27 01:03:06.000000000 -0700
+++ compiled.mk	2014-06-27 01:10:34.000000000 -0700
@@ -20,7 +20,9 @@
 # Our compiler-flags will be added AFTER those set by bjam. We remove
 # the optimization level, because Boost sets it itself (to -O3 in case
 # of gcc/g++):
-BJAM_ARGS+=    cxxflags="${CXXFLAGS:N-O*}" cflags="${CFLAGS:N-O*}"
+BJAM_ARGS+=    cxxflags="${CXXFLAGS:N-O*} -I${LOCALBASE}/include/c++/v1" cflags="${CFLAGS:N-O*}"
+
+BJAM_ARGS+=	linkflags="${LINKFLAGS} -L${LOCALBASE}/lib"
 
 BOOST_TOOLSET=	${CHOSEN_COMPILER_TYPE}
 
@@ -52,7 +54,7 @@
 
 post-patch:
 .if defined(USE_BINUTILS)
-	@${ECHO} "using ${BOOST_TOOLSET} : : ${CXX} : <linkflags>-B${LOCALBASE}/bin ;" >> ${WRKSRC}/tools/build/v2/user-config.jam
+	@${ECHO} "using ${BOOST_TOOLSET} : : ${CXX} : <linkflags>"-B${LOCALBASE}/bin -L${LOCALBASE}/lib ;" >> ${WRKSRC}/tools/build/v2/user-config.jam
 .else
 	@${ECHO} "using ${BOOST_TOOLSET} : : ${CXX} ;" >> ${WRKSRC}/tools/build/v2/user-config.jam
 .endif



Context & sequence leading to the "success":

I did a fresh install from a CD of

FreeBSD FBSDG41466M0 10.0-STABLE FreeBSD 10.0-STABLE #0 r267746:
Mon Jun 23 08:52:41 UTC 2014
root at grind.freebsd.org:/usr/obj/powerpc.powerpc/usr/src/sys/GENERIC  powerpc

This does not have libcxxrt or libc++ prebuilt but does have clang 3.4.1
providing a "freestanding implementation" of C++11. This was to a PowerMac3,6
(G4 FW800), 2 GB RAM.

/usr/ports/... without the recent changes to /usr/ports/Mk/Uses/compiler.mk .
This last is so that clang will be used like it used to be used.


Then I got the following in place so the interesting stuff could be done together
without these mixed in:

configure for pkg, /usr/sbin/pkg, pkg portmaster, portsnap fetch extract,
portmaster pkg (an update), pkg icu gettext gmake binutils bisdon m4
perl5 gmp mpfr cmake cmake-modules mpc boost-docs boost-jam,
portmaster devel/icu (an update) print/texinfo-lite devel/perl5.16 (an
update)

(I've not looked into why icu is not found and used despite being present and
even built if missing. May be icu needs to be built with clang? I've no clue.)



Then I updated devel/libc++/Makefile and devel/boost-all/compiled.mk and did

portmaster devel/libcxxrt devel/libc++ devel/boost-all

(I did not select to have Boost.Python built.)



About the Makefile and compiled.mk adjustments:

On another powermac I had tried the sequence (before the
/usr/ports/Mk/Uses/compiler.mk changes):

portmaster devel/libcxxrt
portmaster devel/libc++

cmake refused during the last because it tried to pre-test the c++11 environment for
being a valid hosted c++ implementation (i.e., standard library present and working to
some extent), including testing use of -lc++ notation for linking. Such testing failed, of
course: clang is not yet a hosted implementation at this stage.

devel/libcxxrt did not complain but it has CXXFLAGS that includes -nostdlib and that
avoids the test of the hosted implementation status: free standing implementation
only.

So I manually added -nostdlib into CXXFLAGS for devel/libc++/Makefile and then
devel/libc++ built when I tried portmaster again.

devel/boost-all did not automatically look in /usr/local/include/c++/v1/ and
/usr/local/lib/ where devel/libc++'s build put things.

So for devel/boost-all I then added -I${LOCALBASE}/include/c++/v1 to cxxflags in BJAM_ARGS and  
added linkflags=-L${LOCALBASE}/lib to BJAM_ARGS and also added -L${LOCALBASE}/lib to <linkoptions>
(just in case).


===
Mark Millard
markmi at dsl-only.net




More information about the freebsd-ppc mailing list