This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Cygwin and clang


Dear List:


I am attempting to build llvm/clang using Cygwin and gcc. Below are
the results. I am able to build clang, but clang does not build clang.

I noticed that Cygwin has version 3.1 available.

Was there any modifications to llvm/clang necessary to get 3.1 to
build properly?
--------------------------------
Building llvm/clang 3.3 under Cygwin

Step 1)

CC=gcc CXX=g++ ../llvm3.3/configure
make -j4

works just fine.
This builds the debug with asserts. Not the sharpest knife in the
drawer, but it builds.

There is a warning during configure, 'mmap() of a fixed address
required but not supported.'
 It appears to be a bug in the configure file. Performing a Google
search one finds reports
that mmap() is supported under Cygwin, but is not properly discovered.

Step 2)

Start again

rm -r *
CC=gcc CXX=g++ ../llvm3.3/configure --enable-optimized
make -j4

works just fine.

Step 3)

make install

 No errors.

Step 4)
Build clang with clang

rm -r *
CC=clang CXX=clang ../llvm3.3/configure --enable-optimized
make -j4

Now we get the following error. A lot more errors of similar nature.

llvm[2]: Linking Release+Asserts executable FileUpdate (without symbols)
/cygdrive/c/OpenSource/llvmbuild3-3/utils/FileUpdate/Release+Asserts/FileUpdate.o:fake:(.text+0x2e):
undefined reference to `std::basic_string<char,
std::char_traits<char>, std::allocator<char>
>::_Rep::_S_empty_rep_storage'
 /cygdrive/c/OpenSource/llvmbuild3-3/utils/FileUpdate/Release+Asserts/FileUpdate.o:fake:(.text+0x63):
undefined reference to `std::basic_string<char,
std::char_traits<char>, std::allocator<char>
>::_Rep::_M_destroy(std::allocator<char> const&)'

Step 4a)
Repeat without optimization.

rm -r *
CC=clang CXX=clang ../llvm3.3/configure
make -j4

Similar errors.

-------------------------------------------------------

Building llvm/clang 3.3 under Cygwin using cmake

Now try all of the above, but this time use cmake.
Unfortunately Cygwin no longer exports _WIN32, so it is defined
below. It is required to get _YUGA_LITTLE_ENDIAN and _YUGA_BIG_ENDIAN
 defined in /compiler-rt/lib/int_endianness.h

Step C1)

CC=gcc CXX=g++  CMAKE_LEGACY_CYGWIN_WIN32=1
CMAKE_C_FLAGS="-D_WIN32=1" CMAKE_CXX_FLAGS="-D_WIN32=1"
 cmake ../llvm-3-3

Get the error

/cygdrive/c/OpenSource/llvm-3-3/projects/compiler-rt/lib/int_endianness.h:106:2:
error: #error Unable to determine endian

Step C2)

rm -r *
CC=gcc CXX=g++  CMAKE_LEGACY_CYGWIN_WIN32=1
CMAKE_C_FLAGS="-D_YUGA_LITTLE_ENDIAN=1 -D_YUGA_BIG_ENDIAN=0"
CMAKE_CXX_FLAGS="-D_YUGA_LITTLE_ENDIAN=1 -D_YUGA_BIG_ENDIAN=0"
cmake ../llvm-3-3

Get same error.

What am I doing wrong?

Keith Smith

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]