building lldb on linux

Hello everybody,

I am Marco, a student of computer engineering at Politecnico di
Milano. In the past two days I have played with the llvm source tree
and I managed to build on my laptop(with Linux) lldb. Today after an
update of the source tree I noticed that the build was broken, or at
least It was on Linux.

The first problem I got It was due to the use of O_SHLOCK and O_EXLOCK flags in
source/Host/common/File.cpp . These two flags are not available on
Linux and after a little search on the Internet I came out with the
little patch attached that should fix the problem.

The second problem I got It is due to the use of fcntl with the
F_GETPATH flag to retrieve the file name from a descriptor. AFAIK this
functionality it's not available on Linux at the moment. Any
suggestions on how to proceed?

Looking forward to getting feedback from you.

Best regards,

lldb-flock.patch (1.1 KB)

% svn commit
Sending include/lldb/Host/File.h
Sending include/lldb/Host/freebsd/Config.h
Sending include/lldb/Host/linux/Config.h
Sending include/lldb/Host/macosx/Config.h
Sending include/lldb/Host/mingw/Config.h
Sending source/Host/common/File.cpp
Transmitting file data ......
Committed revision 125152.

I pulled the support for the shared and exclusive lock and conditionalized the F_GETPATH support so linux should build again.