[LLVMdev] OpenBSD port in progress

Arnaud Bergeron abergeron at gmail.com
Sat Sep 20 23:24:48 PDT 2008


While building an OpenBSD port for LLVM 2.3 I encountered a few issues.

The first one is that the system compiler

$ gcc -v
Reading specs from /usr/lib/gcc-lib/amd64-unknown-openbsd4.3/3.3.5/specs
Configured with:
Thread model: single
gcc version 3.3.5 (propolice)

Fails to build TableGen correctly which then crashes while processing
the tables for ARM.  I fixed this by using gcc 4.2.0

The second one is that there are 8 tests failing, but none of them
seems to fail for reason linked to LLVM itself but rather
peculiarities like grep not working the same way.

simple.patch is for the 3 simple cases where plain grep is used but
regexp patterns are expected to be matched.  This only works on GNU
grep.  I fixed this by using grep -E.

maybe.patch is for the 2 cases where \< and \> are used.  On linux
these match the end and the start of a word.  To get equivalent
behavior on OpenBSD you have to use [[:<:]] and [[:>:]] and this
doesn't work on linux (or mac).  Seeing how they are used, they could
be either removed (which is what maybe.patch does) or replaced by
simple non-word character matching.

The other three failures are more involved.

The first one is Feature/load_module.ll.  It fails because the library
is called LLVMHello.so.0.0 rather than LLVMHello.so.  I have a local
patch that renames the lib in the test that I doubt should be applied
to the tree.

The second one is Transforms/SimplifyLibCalls/floor.ll.  nearbyint is
not replaced by nearbyintf since neither function is defined in the
OpenBSD libm.  The other two are replaced fine though.  My crude
solution was to remove checking for nearbyintf.

The third one is Assembler/2004-02-01-NegativeZero.ll.  This fails
because the constants are printed as positive zeros.  I know there is
a bug in libc on OpenBSD 4.3 that makes it print negative zeros as
positive.  It will be fixed in the next release and if this is linked
then there is no concern.

Arnaud
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple.patch
Type: application/octet-stream
Size: 1718 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080921/40916a6a/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: maybe.patch
Type: application/octet-stream
Size: 787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080921/40916a6a/attachment-0001.obj>


More information about the llvm-dev mailing list