Hello, Since 2.5 is near, I have been trying to build llvm and llvm-gcc for MingW, but hit several problem (using the current trunk). First issue is that unittests don't build for MingW, the attached patch should fix it. Second issue is that llvm-gcc fails for me with the following error: /c/cygwin/home/jlerouge/buildbot/llvm-test/gcc-build/./gcc/xgcc -B/c/cygwin/home/jlerouge/buildbot/llvm-test/gcc-build/./gcc/ -L/c/cygwin/home/jlerouge/buildbot/llvm-test/gcc-build/i686-pc-mingw32/winsup/mingw -L/c/cygwin/home/jlerouge/buildbot/llvm-test/gcc-build/i686-pc-mingw32/winsup/w32api/lib -isystem /c/cygwin/home/jlerouge/buildbot/llvm-gcc4.2-src/winsup/mingw/include -isystem /c/cygwin/home/jlerouge/buildbot/llvm-gcc4.2-src/winsup/w32api/include -Bc:/cygwin/home/jlerouge/buildbot/llvm-test/i686-pc-mingw32/bin/ -Bc:/cygwin/home/jlerouge/buildbot/llvm-test/i686-pc-mingw32/lib/ -isystem c:/cygwin/home/jlerouge/buildbot/llvm-test/i686-pc-mingw32/include -isystem c:/cygwin/home/jlerouge/buildbot/llvm-test/i686-pc-mingw32/sys-include -c -DHAVE_CONFIG_H -O2 -g -O2 -I. -I../../../../llvm-gcc4.2-src/libiberty/../include -W -Wall -pedantic -Wwrite-strings -Wstrict-prototypes -Wc++-compat ../../../../llvm-gcc4.2-src/libiberty/pex-win32.c -o pex-win32.o ../../../../llvm-gcc4.2-src/libiberty/pex-win32.c: In function 'argv_to_cmdline': ../../../../llvm-gcc4.2-src/libiberty/pex-win32.c:365: warning: request for implicit conversion from 'void *' to 'char *' not permitted in C++ ../../../../llvm-gcc4.2-src/libiberty/pex-win32.c: In function 'find_executable': ../../../../llvm-gcc4.2-src/libiberty/pex-win32.c:440: warning: request for implicit conversion from 'void *' to 'char *' not permitted in C++ ../../../../llvm-gcc4.2-src/libiberty/pex-win32.c: In function 'win32_spawn': ../../../../llvm-gcc4.2-src/libiberty/pex-win32.c:566: warning: request for implicit conversion from 'void *' to 'char **' not permitted in C++ ../../../../llvm-gcc4.2-src/libiberty/pex-win32.c:573: warning: request for implicit conversion from 'void *' to 'char *' not permitted in C++ ../../../../llvm-gcc4.2-src/libiberty/pex-win32.c: At top level: ../../../../llvm-gcc4.2-src/libiberty/pex-win32.c:900: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://developer.apple.com/bugreporter> for instructions. make[2]: *** [pex-win32.o] Error 1 make[2]: Leaving directory `/c/cygwin/home/jlerouge/buildbot/llvm-test/gcc-build/i686-pc-mingw32/libiberty' make[1]: *** [all-target-libiberty] Error 2 make[1]: Leaving directory `/c/cygwin/home/jlerouge/buildbot/llvm-test/gcc-build' make: *** [all] Error 2 The regression seems to have been introduced between revision 61201 (last known working) and 61242 (first known non working). I'll try to find out the smallest diff, but I thought running this by the list first couldn't hurt ;-) Thanks, Julien -- Julien Lerouge PGP Key Id: 0xB1964A62 PGP Fingerprint: 392D 4BAD DB8B CE7F 4E5F FA3C 62DB 4AA7 B196 4A62 PGP Public Key from: keyserver.pgp.com -------------- next part -------------- Index: utils/unittest/googletest/gtest.cc ==================================================================--- utils/unittest/googletest/gtest.cc (revision 63080) +++ utils/unittest/googletest/gtest.cc (working copy) @@ -1993,7 +1993,7 @@ if (!HasSameFixtureClass()) return; internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); -#ifdef GTEST_OS_WINDOWS +#if defined(GTEST_OS_WINDOWS) && !defined(__MINGW__) && !defined(__MINGW32__) // We are on Windows. impl->os_stack_trace_getter()->UponLeavingGTest(); __try { @@ -2025,7 +2025,7 @@ AddExceptionThrownFailure(GetExceptionCode(), "TearDown()"); } -#else // We are on Linux or Mac - exceptions are disabled. +#else // We are on Linux, Mac or MingW - exceptions are disabled. impl->os_stack_trace_getter()->UponLeavingGTest(); SetUp(); @@ -2227,7 +2227,7 @@ const TimeInMillis start = GetTimeInMillis(); impl->os_stack_trace_getter()->UponLeavingGTest(); -#ifdef GTEST_OS_WINDOWS +#if defined(GTEST_OS_WINDOWS) && !defined(__MINGW__) && !defined(__MINGW32__) // We are on Windows. Test* test = NULL; @@ -2240,7 +2240,7 @@ "the test fixture's constructor"); return; } -#else // We are on Linux or Mac OS - exceptions are disabled. +#else // We are on Linux, Mac OS or MingW - exceptions are disabled. // TODO(wan): If test->Run() throws, test won't be deleted. This is // not a problem now as we don't use exceptions. If we were to @@ -3271,7 +3271,7 @@ // We don't protect this under mutex_, as we only support calling it // from the main thread. int UnitTest::Run() { -#ifdef GTEST_OS_WINDOWS +#if defined(GTEST_OS_WINDOWS) && !defined(__MINGW__) && !defined(__MINGW32__) #if !defined(_WIN32_WCE) // SetErrorMode doesn't exist on CE. @@ -3294,7 +3294,7 @@ } #else - // We are on Linux or Mac OS. There is no exception of any kind. + // We are on Linux, Mac OS or MingW. There is no exception of any kind. return impl_->RunAllTests(); #endif // GTEST_OS_WINDOWS Index: utils/unittest/googletest/Makefile ==================================================================--- utils/unittest/googletest/Makefile (revision 63080) +++ utils/unittest/googletest/Makefile (working copy) @@ -13,6 +13,12 @@ LIBRARYNAME = GoogleTest BUILD_ARCHIVE = 1 CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include/ -CPP.Flags += -Wno-missing-field-initializers -Wno-variadic-macros +ifeq ($(OS),MingW) + # Min requirement for MingW is GCC 3.4.X, the warnings below don't exist. + CPP.Flags += -DGTEST_OS_WINDOWS=1 +else + CPP.Flags += -Wno-missing-field-initializers -Wno-variadic-macros +endif + include $(LEVEL)/Makefile.common
Anton Korobeynikov
2009-Jan-27 08:54 UTC
[LLVMdev] [PATCH] llvm/llvm-gcc broken on mingw32
Hello, Julien> First issue is that unittests don't build for MingW, the attached > patch > should fix it.Looks ok for me, however, use __MINGW32__ - this is how it's in all LLVM tree nowadays.> working) and 61242 (first known non working).Are you running bootstrap build? --- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
On Tue, Jan 27, 2009 at 11:54:01AM +0300, Anton Korobeynikov wrote:> Hello, Julien > > > First issue is that unittests don't build for MingW, the attached > > patch > > should fix it. > Looks ok for me, however, use __MINGW32__ - this is how it's in all > LLVM tree nowadays.Ok, there was already a __MINGW__ in the original code, so I thought it would be better to keep it around. I'll remove it.> > working) and 61242 (first known non working). > Are you running bootstrap build?No, this is not a bootstrap build. Thanks, Julien -- Julien Lerouge PGP Key Id: 0xB1964A62 PGP Fingerprint: 392D 4BAD DB8B CE7F 4E5F FA3C 62DB 4AA7 B196 4A62 PGP Public Key from: keyserver.pgp.com
On Mon, Jan 26, 2009 at 09:32:58PM -0800, Julien Lerouge wrote:> > Second issue is that llvm-gcc fails for me with the following error: >I filed http://llvm.org/bugs/show_bug.cgi?id=3552 to track this. I found two issues that prevent non bootstrap build of llvm-gcc, the first one was introduced in 61207 and the second one in 61215. I think it affects the 2.5 branch as well. Thanks, Julien -- Julien Lerouge PGP Key Id: 0xB1964A62 PGP Fingerprint: 392D 4BAD DB8B CE7F 4E5F FA3C 62DB 4AA7 B196 4A62 PGP Public Key from: keyserver.pgp.com
Maybe Matching Threads
- [LLVMdev] [PATCH] llvm/llvm-gcc broken on mingw32
- [LLVMdev] AnalysisUsage & Call Graph SCC Pass Manager
- [LLVMdev] Problem in External/SPEC/CFP2000/177.mesa/Makefile ?
- [LLVMdev] LLVM-GCC & GV zeroinitializers, 2.5 vs 2.6.
- [LLVMdev] Pre pr4572 lvm-gcc building/working revision needed