libcxx compilation using clang

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

libcxx compilation using clang

Gaurav Mittal-2
Hi,
I'm trying to build libc++ (libcxx) on a Windows machine with clang (built
with VC++ 10.0) using the buildit script. I'm getting the errors shown at
the end of the email. Could someone tell me if the compilation should be
including the MSVC version of the string.h file? Ideally I would like to
compile the library to LLVM bitcode or LLVM IR and not the native binary. I
compiled clang using MSVC. Has anybody succeeded in using this combination
to compile libcxx?

I appreciate any help you can provide.

Gaurav

clang++: warning: argument unused during compilation: '-arch x86_64'
In file included from ../src/algorithm.cpp:10:
In file included from ../include/algorithm:592:
In file included from ../include/cstring:61:
/Program Files (x86)/Microsoft Visual Studio 10.0/VC/include/string.h(290) :
error: expected expression
    return (_Src == NULL) ? 0 : wcsnlen(_Src, _MaxCount);
                        ^
In file included from ../src/algorithm.cpp:10:
In file included from ../include/algorithm:592:
../include/cstring(94) :  error: declaration conflicts with target of using
declaration already in scope
inline _LIBCPP_INLINE_VISIBILITY       char* strchr(      char* __s, int
__c) {return ::strchr(__s, __c);}

...


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: libcxx compilation using clang

Francois Pichet
On Thu, Apr 7, 2011 at 6:33 PM, Gaurav Mittal <[hidden email]> wrote:

> Hi,
> I'm trying to build libc++ (libcxx) on a Windows machine with clang (built
> with VC++ 10.0) using the buildit script. I'm getting the errors shown at
> the end of the email. Could someone tell me if the compilation should be
> including the MSVC version of the string.h file? Ideally I would like to
> compile the library to LLVM bitcode or LLVM IR and not the native binary. I
> compiled clang using MSVC. Has anybody succeeded in using this combination
> to compile libcxx?
>
> I appreciate any help you can provide.
>
> Gaurav
>
> clang++: warning: argument unused during compilation: '-arch x86_64'
> In file included from ../src/algorithm.cpp:10:
> In file included from ../include/algorithm:592:
> In file included from ../include/cstring:61:
> /Program Files (x86)/Microsoft Visual Studio 10.0/VC/include/string.h(290) :
> error: expected expression
>    return (_Src == NULL) ? 0 : wcsnlen(_Src, _MaxCount);
>                        ^
> In file included from ../src/algorithm.cpp:10:
> In file included from ../include/algorithm:592:
> ../include/cstring(94) :  error: declaration conflicts with target of using
> declaration already in scope
> inline _LIBCPP_INLINE_VISIBILITY       char* strchr(      char* __s, int
> __c) {return ::strchr(__s, __c);}
>
> ...

clang cannot parse all the MSVC header files.
But you shouldn't see this particular error (string.h, line 290)
I am not familiar with the buildit script but is -fms-extensions used?

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: libcxx compilation using clang

Gaurav Mittal-2
The buildit script can be found inside libcxx/lib. It doesn't use
-fms-extensions.

Gaurav

-----Original Message-----
From: Francois Pichet [mailto:[hidden email]]
Sent: Friday, April 08, 2011 5:22 AM
To: Gaurav Mittal
Cc: [hidden email]
Subject: Re: [cfe-dev] libcxx compilation using clang

On Thu, Apr 7, 2011 at 6:33 PM, Gaurav Mittal <[hidden email]>
wrote:
> Hi,
> I'm trying to build libc++ (libcxx) on a Windows machine with clang (built
> with VC++ 10.0) using the buildit script. I'm getting the errors shown at
> the end of the email. Could someone tell me if the compilation should be
> including the MSVC version of the string.h file? Ideally I would like to
> compile the library to LLVM bitcode or LLVM IR and not the native binary.
I

> compiled clang using MSVC. Has anybody succeeded in using this combination
> to compile libcxx?
>
> I appreciate any help you can provide.
>
> Gaurav
>
> clang++: warning: argument unused during compilation: '-arch x86_64'
> In file included from ../src/algorithm.cpp:10:
> In file included from ../include/algorithm:592:
> In file included from ../include/cstring:61:
> /Program Files (x86)/Microsoft Visual Studio 10.0/VC/include/string.h(290)
:
> error: expected expression
>    return (_Src == NULL) ? 0 : wcsnlen(_Src, _MaxCount);
>                        ^
> In file included from ../src/algorithm.cpp:10:
> In file included from ../include/algorithm:592:
> ../include/cstring(94) :  error: declaration conflicts with target of
using
> declaration already in scope
> inline _LIBCPP_INLINE_VISIBILITY       char* strchr(      char* __s, int
> __c) {return ::strchr(__s, __c);}
>
> ...

clang cannot parse all the MSVC header files.
But you shouldn't see this particular error (string.h, line 290)
I am not familiar with the buildit script but is -fms-extensions used?


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev