cross-compiling current trunk fails

Hi,

cross-compiling LLVM on the ppc64 architecture fails with:

make[1]: *** No rule to make target `../build/llvm-r204075/BuildTools/Debug+Asserts/bin/llvm-tblgen', needed by `../build/llvm-r204075/lib/IR/Debug+Asserts/Intrinsics.gen.tmp'. Stop.
make[1]: *** Waiting for unfinished jobs....

this fails for me for
r204075 (today) and
r203443.

Configuration details:

$LLVMPATH/configure \
     --prefix=$INSTALL/llvm-$TYPE \
     --host=powerpc64-bgq-linux \
     --build=powerpc64-unknown-linux-gnu \
     --enable-shared \
     --disable-terminfo \
     --disable-zlib \
     --enable-targets=powerpc \
     CXX=${CXX} \
     CXXFLAGS="${CXXFLAGS}" \
     CC=${CC} \
     CFLAGS="${CFLAGS}" \
     LDFLAGS="${LDFLAGS}"

with

CXXFLAGS="-O3 -fPIC"
LDFLAGS="-shared -ldl"
CC=bgclang
CXX=bgclang++11

Anyone any idea how to track this down?

Thanks,
Frank

The weird thing is that I get different behavior depending on whether executing

make

or

make -j 10 install

after configuring. The former results in

checking whether GCC is new enough... no
configure: error:
The selected GCC C++ compiler is not new enough to build LLVM. Please upgrade
to GCC 4.7. You may pass --disable-compiler-version-checks to configure to
bypass these sanity checks.

the latter in the result described in the first email.

That's odd. I never had problems with a parallel build.

Ideas?

Frank

That's odd. I never had problems with a parallel build.

Ideas?

I've seen similar failures, though oddly with CMake. What I decided
was happening is that the Makefile knows it has to build llvm-tblgen,
but not quite what depends on it for some reason.

In the -j10 case, it's encounters something that needs llvm-tblgen
before it's actually built it. In the -j1 case it tries to configure &
build llvm-tblgen, but (presumably) needs a different, native,
compiler and discovers your host's one is too old.

So to solve the -j1 build, you probably do want to upgrade your native
compiler, unless it's being misdetected.

For the parallel issue, my build-script knowledge was too small to fix
it back then. I ended up running at -j1 mostly, though I've since had
success with the CMake variables LLVM_TABLEGEN and CLANG_TABLEGEN, by
pointing them at a (recent!) native TableGen I've had lying around.
Not foolproof, but often enough for a quick build/test.

Cheers.

Tim.