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

Mark Millard markmi at dsl-only.net
Sun Jun 29 23:44:06 UTC 2014


The same small Makefile change for libc++ and 3 small compiled.mk changes for boost-all (well, boost-libs's use of boost-all materials) get the same result for powerpc64 10.0-STABLE's clang 3.4.1 compiling/linking devel/libcxxrt , devel/libc++, and boost-all (well boost-libs) that powerpc 10.0-STABLE's clang 3.4.1 got (again based on the older /usr/ports/Mk/Uses/compiler.mk so that clang would be used): the lack of a binary compatible icu/iconv is the first thing to stop it and 10849 boost-targets build before that happens. No libboost_locale.*'s builds are attempted but the install stage fails from not finding them.

(Of course, without powerpc64 packages being available, the list of prerequisites was built based on using portmaster for all of them (but itself). print/textinfo also showed up in the list. The history below is from the prior powerpc material.)



Side note:

I had to sidestep the problem with FreeBSD-10.0-STABLE-powerpc-powerpc64-20140622-r267746-disk1.iso based CDs on the PowerMac G5's I have hanging on boot --the hang being between

Loading /build/defaults/loader.conf

that was displayed and the never displayed

/build/kernel/kernel data=... src=[...]

line (not even the /b shows up). My pure hack was to use two SSD's, boot one for powerpc (not 64), use bsdinstall to quickly get a partial powerpc64 environment on the other SSD, boot starting from this other SSD but when it reported not being able to use/mount the root file system form the SSD, answer its prompt by telling it to boot the root file system from the CD instead. After that things went fine even though it involved deleting and re-creating the partition(s) on the involved SSD.

Every 10.0-stable .iso that I've tried had the same hang at the same point. But before the last several there are many that I'd not tried: I skipped many between attempts back then. 10.0-RELEASE did not have the problem and installed fine when I tried it. 9.3-RC2 and other 9.3's and 9.2-STABLE's that I've tried also did not have the problem: Only 10.0-STABLE so far. (I've not tried 11.0-CURRENT at all.) Two different vintages of PowerMac G5's, multiple CD's, and fully uniform results. Mac OS X 10.5 and its installation media had no problems. Nor did lubuntu 14.04 when I tried it as a cross check. Only 10.0-STABLE.


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

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

I had noted the icu (and iconv) vs. the "no" status boost lists and...

Looking around: boost tries to compile/link/run examples bound to icu and iconv to determine if they are usable. The gcc based ones for powerpc are apparently not binary compatible with clang so libboost_locale.* can not use them and so as stands no attempt is made to build the  various libboost_locale.* when boost is built. But the port's install action is not conditional and notices the incompleteness.

From a particular point of view it is too bad that libboost_locale.* not matching icu and/or iconv blocks other parts of boost from being installed that would not be dependent on that binary compatibility status: more could be tested up front. (Not that splitting it out on its own would necessarily be easy or even reasonable.)

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

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

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