Trouble cross-compiling llvm/clang

I'm having trouble cross compiling llvm/clang with my mingw-w64-gcc compiler. I've tried both trunk, 3.1 and 3.0 of llvm without no avail.

llvm[1]: Compiling ErrorHandling.cpp for Release build
/usr/home/solskogen/mingw-w64-builder/llvm/lib/Support/Errno.cpp: In function 'std::string llvm::sys::StrError(int)':
/usr/home/solskogen/mingw-w64-builder/llvm/lib/Support/Errno.cpp:55:32: error: too few arguments to function 'errno_t strerror_s(char*, size_t, int)'
In file included from /usr/home/solskogen/cross-mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/include/string.h:176:0,
                  from /usr/home/solskogen/mingw-w64-builder/llvm/lib/Support/Errno.cpp:18:
/usr/home/solskogen/cross-mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/include/sec_api/string_s.h:19:27: note: declared here
rm: /usr/home/solskogen/obj/llvm.native.x86_64-w64-mingw32/lib/Support/Release/Errno.d.tmp: No such file or directory
gmake[1]: *** [/usr/home/solskogen/obj/llvm.native.x86_64-w64-mingw32/lib/Support/Release/Errno.o] Error 1
gmake[1]: *** Waiting for unfinished jobs....
gmake[1]: Leaving directory `/usr/home/solskogen/obj/llvm.native.x86_64-w64-mingw32/lib/Support'

llvm/clang is configured like this:
llvm/configure --prefix=/home/solskogen/mingw64 --host=x86_64-w64-mingw32 --build=x86_64-unknown-freebsd9.0 --disable-assertions

any hints?

any hints?

Sounds like a bug. Does the following fix the problem for you:

Index: Errno.cpp

I wonder why msvc builders had not warn about strerror_s...

I have checked cmake-msvc chooses HAVE_DECL_STRERROR_S.

I will look into it later.

I wonder why msvc builders had not warn about strerror_s...

I have checked cmake-msvc chooses HAVE_DECL_STRERROR_S.

I will look into it later.

maybe they use strerror_r instead? :slight_smile:

Yes, yes it did :slight_smile:

Anton, applied in r159103. :wink:

...Takumi