[LLVMbugs] [Bug 14301] New: Add __CYGWIN__ in llvm/projects/compiler-rt/lib/int_endianness.h

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Nov 9 06:09:44 PST 2012


http://llvm.org/bugs/show_bug.cgi?id=14301

             Bug #: 14301
           Summary: Add __CYGWIN__ in
                    llvm/projects/compiler-rt/lib/int_endianness.h
           Product: compiler-rt
           Version: unspecified
          Platform: PC
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: compiler-rt
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: llvm-acone at gmx.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


CMake did not set the _WIN32 macro in the used version by default. That is why
I suggest to include the __CYGWIN__ definition in int_endianness.h. I know that
I could switch in the legacy mode with CMAKE_LEGACY_CYGWIN_WIN32 to add the
_WIN32 preprocessor statement. But it was my intention to use a pure POSIX
system without direct dependencies from WIN32.

###################
--- system info ---
###################

OS: Windows 7 64 Bit

$ cmake --version
cmake version 2.8.9

$ uname -a
CYGWIN_NT-6.1-WOW64 Gamer 1.7.17(0.262/5/3) 2012-10-19 14:39 i686 Cygwin

$ gcc --version
gcc (GCC) 4.5.3

SVN Revision: 167612

####################
--- build script ---
####################

MYSELF=`readlink -f $0`
MYPATH=`dirname $MYSELF`

export WORK_PATH=/c/temp
export SOURCE_DIR=llvm_sources
export BUILD_DIR=llvm_build

export SOURCE_PATH=$WORK_PATH/$SOURCE_DIR
export BUILD_PATH=$WORK_PATH/$BUILD_DIR
export INSTALL_PATH=$MYPATH/cygwin

if [ -d $SOURCE_PATH ]; then
  rm -r $SOURCE_PATH
fi

if [ ! -d $SOURCE_PATH ]; then
  mkdir -p $SOURCE_PATH
fi

# Checkout LLVM
cd $SOURCE_PATH
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm

# Checkout Clang
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd ../..

# Checkout extra Clang Tools (optional)
cd llvm/tools/clang/tools
svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
cd ../../../..

# Checkout Compiler-RT
cd llvm/projects
svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
cd ../..

# Get the Test Suite Source Code (optional)
cd llvm/projects
svn co http://llvm.org/svn/llvm-project/test-suite/trunk test-suite
cd ../..

if [ -d $BUILD_PATH ]; then
  rm -r $BUILD_PATH
fi

if [ ! -d $BUILD_PATH ]; then
  mkdir -p $BUILD_PATH
fi

cd $BUILD_PATH

cmake -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH
$SOURCE_PATH/llvm

cd $BUILD_PATH

make

#####################
--- compile error ---
#####################

[ 49%] Built target llvm-symbolizer
[ 49%] Building C object
projects/compiler-rt/lib/CMakeFiles/clang_rt.i386.dir/a
bsvdi2.c.o
In file included from
/c/temp/llvm_sources/llvm/projects/compiler-rt/lib/int_typ
es.h:21:0,
                 from
/c/temp/llvm_sources/llvm/projects/compiler-rt/lib/int_lib
.h:41,
                 from
/c/temp/llvm_sources/llvm/projects/compiler-rt/lib/absvdi2
.c:15:
/c/temp/llvm_sources/llvm/projects/compiler-rt/lib/int_endianness.h:106:2:
error
: #error Unable to determine endian
projects/compiler-rt/lib/CMakeFiles/clang_rt.i386.dir/build.make:57: recipe for
target `projects/compiler-rt/lib/CMakeFiles/clang_rt.i386.dir/absvdi2.c.o'
faile
d
make[2]: ***
[projects/compiler-rt/lib/CMakeFiles/clang_rt.i386.dir/absvdi2.c.o]
 Error 1
CMakeFiles/Makefile2:2916: recipe for target
`projects/compiler-rt/lib/CMakeFile
s/clang_rt.i386.dir/all' failed
make[1]: *** [projects/compiler-rt/lib/CMakeFiles/clang_rt.i386.dir/all] Error
2

Makefile:136: recipe for target `all' failed
make: *** [all] Error 2

###################
--- workaround ---
###################

<llvm/projects/compiler-rt/lib/int_endianness.h
96c96
< #if defined(_WIN32)
---
> #if defined(_WIN32) || defined(__CYGWIN__)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list