[LLVMdev] llvm windows re-port

Žiga Osolin ziga.osolin at gimb.org
Sat Nov 4 05:20:44 PST 2006


>> I decided to make llvm port on windows, to support at least Visual 
>> Studio 7.1 and Visual Studio 8. I guess I will make only Visual
>> Studio 7.1 version, since it can be easily converted to version 8.
>>     
> Good. Please note, that they're something about 1.5 years old. There
> already were some attempts to do visual studio port, search llvm-dev
> archives for more information.
>
>   
I found some posts regarding some porting issues, but all those are 
probably already resolved and
the patches have been comitted.
>> - e:\llvm\llvm\include\llvm\Support\Compressor.h(53) : error C2039: 
>> 'string' : is not a member of 'std'
>> - e:\llvm\llvm\include\llvm\ADT\FoldingSet.h(150) : error C2061:
>> syntax error : identifier 'uint64_t'
>>     
> This really means, that some of includes are missing for your build.
> For example: uint64_t is typedefed to __int64 for VCPP in
> include/llvm/Support/DataTypes.h. Please check everything twice.
>
>   
Yes, I have foudn the file. However, some sources do not include 
DataTypes, even if they use
uint64_t (one is FoldingSet.cpp). I will include DataTypes on such 
files, as well as <string> when
necessary.
>> The windows seems not to know the string type, so you must include it 
>> directly through #include <string>. I did it for some files in
>> support missing that and it
>> works fine (it should also not brake UNIX compatibility).
>>     
> The same as prev. The STL includes are already in place. 
>
>   
DataTypes does not include any STL files. Should I include <string> 
where so, or should I include string in DataTypes?
I made this correction (including string and DataTypes) and now, the 
file compiles ok.
>> (I don't seem to find it ...). There is also a small fix needed in 
>> System library itself, some things are outdated.
>>     
> Could you please be more concrete? win32 flavour of System library
> builds and runs fine with mingw32 target, so it seems (at least to me)
> to be in good condition.
>
>   
Everything else build but ltdl.c doesn't.

e:\llvm\llvm\lib\System\ltdl.c(3625) : error C2037: left of 'd_name' 
specifies undefined struct/union 'direct'
e:\llvm\llvm\lib\System\ltdl.c(3625) : error C2037: left of 'd_namlen' 
specifies undefined struct/union 'direct'
e:\llvm\llvm\lib\System\ltdl.c(3630) : error C2037: left of 'd_name' 
specifies undefined struct/union 'direct'
e:\llvm\llvm\lib\System\ltdl.c(3641) : error C2037: left of 'd_name' 
specifies undefined struct/union 'direct'
e:\llvm\llvm\lib\System\ltdl.c(3650) : error C2037: left of 'd_name' 
specifies undefined struct/union 'direct'
e:\llvm\llvm\lib\System\ltdl.c(3660) : error C2037: left of 'd_name' 
specifies undefined struct/union 'direct'
e:\llvm\llvm\lib\System\ltdl.c(3660) : error C2198: 'strncat' : too few 
arguments for call through pointer-to-function
e:\llvm\llvm\lib\System\ltdl.c(3678) : error C2065: 'DIR' : undeclared 
identifier
e:\llvm\llvm\lib\System\ltdl.c(3678) : error C2065: 'dirp' : undeclared 
identifier
e:\llvm\llvm\lib\System\ltdl.c(3678) : error C2106: '=' : left operand 
must be l-value
e:\llvm\llvm\lib\System\ltdl.c(3679) : error C2143: syntax error : 
missing ';' before 'type'
e:\llvm\llvm\lib\System\ltdl.c(3692) : error C2037: left of 'd_name' 
specifies undefined struct/union 'direct'
e:\llvm\llvm\lib\System\ltdl.c(3695) : error C2065: 'errors' : 
undeclared identifier

+ a bunch of warnings.

The problem is that windows does not support direct.h and DIR structure. 
I know of one emulation on windows (I use it for my project),
but it doesn't work here (basically a header file defining DIR struct 
and everything else and doing the windows code under it). I found
an emulation at http://www.softagalleria.net/dirent/index.en.html and 
tried it. Maybe I can make it work with it. Or do you have a better 
solution?
>> It also seems that other project (Analyzer ...) require some sort of 
>> prebuild steps (Intrinsics.h not found) ... Could you send me a
>> commad that would generate all those prerequisites (or at least tell
>> me where to look:) ).
>>     
> Intrinsincs.h is in include/llvm.
>
>   
I am not looking for Instrinsics.h but Intrinsics.gen. Should I copy it 
from Instruction.def (prebuild event).

Otherwise, Configuration and support have been sucesfully compiled.

Regards,
Žiga



More information about the llvm-dev mailing list