llvm/clang 3.0 on powerpc-darwin8

Greetings clangsters,

I've recently been porting llvm/clang 3.0 (release) to powerpc-darwin8 for fink, and have made good progress. I would really like to get this port working, including libc++, and can use some help.

I've taken Jack Howarth's fink package submission and tweaked it for darwin8. Since the original packaging uses the cmake build system, I've also kept that the same (though I prefer and am better-versed in autoconf).

Since g++-4.0.1 isn't supported, I've chosen to bootstrap llvm/clang with gcc-4.6.2.

Package file (builds from source):

Currently at rev. 1.8 at the time of writing this.

my cmake parameters:
-DLLVM_BUILD_32_BITS:BOOL=ON
-DLLVM_TARGETS_TO_BUILD=PowerPC
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_C_FLAGS=-fno-common -DCMAKE_CXX_FLAGS=-fno-common

I wanted to build with shared libraries b/c an older build of llvm-2.9 produced some massive static executables. During early builds, I found that many (but not all) objects were compiled with -fPIC but missing -fno-common (needed on darwin linker). My cmake-fu is weak, so I just passed -fno-common to the entire build.

The packaging file above contains a bunch of patch-work to get the build to cooperate. Some cmake files were missing dependencies (undefined references) among shared libraries, and I worked around a circular dependence by lumping clangSerialization into clangFrontend [bug 11512]. find-cycles.pl found some other circular deps after everything built [bug 11527], but I just ignored it for now.

The patching is in the form of sed-1-liners, but would anyone be interested in a unidiff-patch? I'm happy to share these, but I don't know whether my patches are "correct" beyond "works for me".

At installation time (InstallScript of .info), I 'fixed' the dylibs and binaries to use references to their installed locations using install_name_tool. (I've never had any luck with getting cmake to do this correctly and automatically, whereas libtool does the right thing.) The resulting installed clang/llvm binaries run properly.

Test results (llvm+clang).
http://paste.lisp.org/display/126363#3
   Expected Passes : 6508
   Expected Failures : 36
   Unsupported Tests : 2955
   Unexpected Passes : 1
   Unexpected Failures: 77

How can I prepare a summary report of the failing and passing clang/llvm tests (is there a make target)? and where is a good place to report the results for further scrutiny? I've found an llvm-testresults mailing lists but those look like benchmark results.

======= libc++abi, libc++ =======

To make clang++ more use
I haven't found much documentation for these other than:
http://libcxx.llvm.org/
http://libcxxabi.llvm.org/

Are there any official versioned releases of these libraries? I'd like to put proper library version numbers to these, besides the svn revision numbers.

libcxxabi provides no Makefile, so I just improvised my own. Which compiler should I be building this with? It references some c++ stdandard library headers, but without libc++, the only ones available are the system /usr/include/c++/4.0.0 and gcc-4.6's. One of the source files uses the __has_feature() clang feature, so it's not clear to me.

I also plan to install libcxxabi outside of /usr/include, so I'll expect to patch libc++'s "lib/buildit" script.

My first attempts to compile libc++ resulted in some assembly errors, so I'll follow up with those later, maybe after going over clang's test failures.

Fang

The patching is in the form of sed-1-liners, but would anyone be
interested in a unidiff-patch? I'm happy to share these, but I don't know
whether my patches are "correct" beyond "works for me".

Feel free to send a patch; I'm not familiar enough with the CMake
stuff to review, but I'm sure someone else will want tot take a look.
See also http://llvm.org/docs/DeveloperPolicy.html .

At installation time (InstallScript of .info), I 'fixed' the dylibs and
binaries to use references to their installed locations using
install_name_tool. (I've never had any luck with getting cmake to do this
correctly and automatically, whereas libtool does the right thing.) The
resulting installed clang/llvm binaries run properly.

Test results (llvm+clang).
http://paste.lisp.org/display/126363#3
Expected Passes : 6508
Expected Failures : 36
Unsupported Tests : 2955
Unexpected Passes : 1
Unexpected Failures: 77

How can I prepare a summary report of the failing and passing clang/llvm
tests (is there a make target)? and where is a good place to report the
results for further scrutiny? I've found an llvm-testresults mailing
lists but those look like benchmark results.

There isn't really anything more here than you have already found; I'm
not sure why that isn't sufficient, though. (Running "make check-all"
should be dumping some additional information onto the terminal,
though.)

We have a bot running PPC, and I have looked briefly at the failure
reports; a lot of the failing tests are just failing spuriously and
need to be fixed, but there are some which are crashing... if you're
interested in making clang usable, I'd suggest focusing on the ones
that crash first.

======= libc++abi, libc++ =======

To make clang++ more use
I haven't found much documentation for these other than:
http://libcxx.llvm.org/
http://libcxxabi.llvm.org/

Are there any official versioned releases of these libraries?

There was a version of libcxx tagged along with LLVM 3.0, but no,
there isn't any official release. If someone were interested,
proposing changes to http://llvm.org/docs/HowToReleaseLLVM.html would
be the first step.

libcxxabi provides no Makefile, so I just improvised my own. Which
compiler should I be building this with? It references some c++ stdandard
library headers, but without libc++, the only ones available are the
system /usr/include/c++/4.0.0 and gcc-4.6's. One of the source files uses
the __has_feature() clang feature, so it's not clear to me.

libcxxabi as a whole isn't really in a usable state; I would recommend
against using it at the moment.

-Eli