[LLVMdev] Compiling llvm and Clang in solaris 10

Norm Jacobs norm.jacobs at oracle.com
Fri Jun 21 23:10:16 PDT 2013


I ran into this earlier in the week on the current Solaris development 
builds and I think that one of my co-workers was going to file a bug on 
it.  Basically, Solaris doesn't have an endian.h, so you have to patch 
include/llvm/Support/Host.h to define BYTE_ORDER as it would on linux 
and some other platforms.

--- llvm-3.3.src/include/llvm/Support/Host.h.orig    Mon Apr 15 15:13:59 
2013
+++ llvm-3.3.src/include/llvm/Support/Host.h    Wed Jun 19 11:03:01 2013
@@ -18,6 +18,21 @@

  #if defined(__linux__)
  #include <endian.h>
+#elif defined(__sun) && defined(__SVR4)
+#  ifndef BYTE_ORDER
+#   define LITTLE_ENDIAN 1234
+#   define BIG_ENDIAN    4321
+
+#   if defined(__sun) && defined(__SVR4)
+#    include <sys/isa_defs.h>
+#    ifdef _LITTLE_ENDIAN
+#     define BYTE_ORDER LITTLE_ENDIAN
+#    endif
+#    ifdef _BIG_ENDIAN
+#     define BYTE_ORDER BIG_ENDIAN
+#    endif
+#   endif /* sun */
+#  endif /* BYTE_ORDER */
  #else
  #ifndef LLVM_ON_WIN32
  #include <machine/endian.h>

     -Norm



On 06/21/13 06:00 PM, Jorge Rodrigues wrote:
> I run configure in a build folder using
> CC=gcc CXX=g++  ../configure --prefix=/project/scratch/packages2/clang  \
>   --enable-targets=host --enable-shared
> The configure runs fine but when I type make I get the error:
> make[1]: Entering directory 
> `/project/scratch/tmp/llvm-3.3/build/lib/Support'
> llvm[1]: Compiling APFloat.cpp for Release+Asserts build
> In file included from 
> /project/scratch/tmp/llvm-3.3/include/llvm/ADT/Hashing.h:50:0,
>                  from 
> /project/scratch/tmp/llvm-3.3/lib/Support/APFloat.cpp:18:
> /project/scratch/tmp/llvm-3.3/include/llvm/Support/Host.h:23:28: fatal 
> error: machine/endian.h: No such file or directory
>  #include <machine/endian.h>
>                             ^
> compilation terminated.
> /project/packages/sun/5.10/x86/gnu/bin/rm: cannot remove 
> `/project/scratch/tmp/llvm-3.3/build/lib/Support/Release+Asserts/APFloat.d.tmp': 
> No such file or directory
> make[1]: *** 
> [/project/scratch/tmp/llvm-3.3/build/lib/Support/Release+Asserts/APFloat.o] 
> Error 1
> make[1]: Leaving directory 
> `/project/scratch/tmp/llvm-3.3/build/lib/Support'
> make: *** [all] Error 1
> Any idea how I can solve this? Thanks.
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130622/6c8b41c0/attachment.html>


More information about the llvm-dev mailing list