[LLVMbugs] Compile error on 64-bit x86 Solaris

Zeljko Vrba zvrba at ifi.uio.no
Thu Oct 25 00:52:41 PDT 2007


On Thu, Oct 25, 2007 at 08:38:30AM +0200, Zeljko Vrba wrote:
> 
> The following in Makefile.rules seems to work on x86 Solaris 10:
> CPP.BaseFlags += -D_XPG6 -D_STDC_C99 -U__EXTENSIONS__ -D__STDC_LIMIT_MACROS
> 
Doesn't work.  It worked only on partially compiled code; it tries
to use the restrict keyword (because of _STDC_C99) and the compilation
breaks.  There doesn't seem to exist a combination of feature macros
that at the same time:

1) enables all the features that LLVM wants
2) does not pull in constants that LLVM regularly uses as variable names.

Finally I did the following:

find . -name '*.h' -o -name '*.cpp' | xargs perl -pi -e 's/\b([SGEFCD]S)\b/\1s/g;'

To replace the offending names with the same name followed by 's'.

Similar find/replace should be done for the following names:
EAX ECX EDX EBX ESP EBP ESI EDI EIP EFLAGS

Further errors:

/home/zvrba/llvm-build/mklib: line 6305: ../llvm-2.1/autoconf/install-sh: No such file or directory
make[3]: *** [/home/zvrba/llvm-build/Release/lib/LLVMHello.la] Error 127
make[3]: Leaving directory `/home/zvrba/llvm-build/lib/Transforms/Hello'
make[2]: *** [Hello/.makeall] Error 2
make[2]: Leaving directory `/home/zvrba/llvm-build/lib/Transforms'
make[1]: *** [Transforms/.makeall] Error 2
make[1]: *** Waiting for unfinished jobs....

+ I had to #undef some register names in other files (also the auto-generated
ones) as they clash with registers defined in the system headers.  I can send
you a full diff if you want.

== CONCLUSION:

With a bunch of manual fiddling, #undefing and renaming of variables,
I finally got it to link and build.  Now I have to figure out how to
install it, because make install gives a bunch of:

/bin/sh: ../llvm-2.1/autoconf/install-sh: not found

even though the file is there.

Anyway, I'm sorry to report, but LLVM is a _mess_ to build on
x86 Solaris 10.  (And no, I don't blame it on the platform).

If I get some cleanly compileable source tree (i.e. once after I've
figured out how to make a compilation run unattended), I will send
you the diff and you're free to do whatever you want to with it.




More information about the llvm-bugs mailing list