gold plugin, large file support and the rest of llvm

Hi llvm team,

There's an inconsistency between gold plugin, which is built with
large file support, because gold requires that, and the rest of LLVM
(libLTO, libSupport) which are built w/o it.
It means that every function in libLTO, libSupport, etc which uses
off_t is inaccessible from LLVMgold. The most important problem here
is that LLVMgold actually uses such functions from libLTO and
libSupport, which causes subtle problems in some cases.

I see four possible ways to address this issue:

1. Build llvm with large file support (-D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64). This will probably cause issues in the
programs which link against LLVM and which are built w/o large file
support.
2. Change the signature of the functions in libLTO/libSupport from
off_t into int64_t, so that the signature does not depend on the
compile-time flags. This does not look sane.
3. Use conditional compilation magic in gold plugin and partially
duplicate definitions of the functions. It is technically possible,
but it would just make things worse.
4. Compile gold-plugin dependencies with large file support so that
these libraries are built twice, if all parts of LLVM are requested to
built. It's probably fine, but I am not familiar with llvm build
system enough to understand if that's possible to do.

I'm sure that I miss something here. What's your opinion on how to
address this issue?

krasin