LLVM builds on x86-64 Solaris

Hey everyone,

Not sure if anyone had tried this but I managed to get LLVM and clang to
build on Nexenta Alpha 7. This is an OpenSolaris/GNU OS.

There wasn't much to change for LLVM, except "#undef"ing a lot of x86
register name equivalents and the like (ie. EAX,ESP,CS,FS...).

There were a couple of similar undef's needed for clang, as well. The
clang testsuite ran fine except for mandel.c again?!? Same file that
wouldn't build on Sparc/Linux, but a different error. I will look at it.

I will try to get llvm-gcc to build but there will probably be some
major issues there :wink: We'll see.

Thanks,
K.Wilson

P.S. Is there an easier way to do this. Like undef'ing everything once
in some higher level #include?? I had to manually change about 50 files
and I couldn't find where OpenSolaris was #defining these things! Or are
they #defined in gcc somewhere on Solaris?

Hello all,

Well, I managed to get llvm-gcc to build on OpenSolaris/GNU as a
cross-compiler. It was somewhat of a pain since the config files were
mixed up for i386-pc-solaris. I had to manually change some things after
configuration again (this manual changing of stuff is happening because
I don't understand the autoconf/automake toolchain well enough, I
guess).

llvm-gcc produces acceptable binaries that can be linked with the gcc ld
or the native ld. There is an old bug with gcc cross-compilers on
solaris so llvm-gcc doesn't find the native ld automatically, and
it's .o files in /usr/ccs. I had to manually link things with gcc or
native ld. I will see if I can patch things to get a full build of this.

Thanks,
K.Wilson

Very nice! How ugly are the patches, do you think we could merge them into mainline?

-Chris