[LLVMdev] [lld] Casts in lld COFF driver

Martell Malone martellmalone at gmail.com
Mon Jun 15 14:17:33 PDT 2015


Hi Rui,

When building lld with a gcc compiler I get cast errors on |= for
characteristics

What kinds of casts are acceptable to use in lld to be accepted to fix this

[ 82%] [ 82%]
C:/msys64/home/Martell/MINGW-packages/mingw-w64-clang-git/src/llvm/tools/lld/COFF/Writer.cpp:
In member function 'void
lld::coff::OutputSection::addPermissions(uint32_t)':
C:/msys64/home/Martell/MINGW-packages/mingw-w64-clang-git/src/llvm/tools/lld/COFF/Writer.cpp:87:26:
error: no match for 'operator|=' (operand types are
'llvm::support::ulittle32_t {aka
llvm::support::detail::packed_endian_specific_integral<unsigned int,
(llvm::support::endianness)1u, 1u>}' and 'uint32_t {aka unsigned int}')
   Header.Characteristics |= C & PermMask;
                          ^
Built target X86CommonTableGen
Built target LLVMPasses
C:/msys64/home/Martell/MINGW-packages/mingw-w64-clang-git/src/llvm/tools/lld/COFF/Writer.cpp:
In member function 'void lld::coff::Writer::writeHeader()':
C:/msys64/home/Martell/MINGW-packages/mingw-w64-clang-git/src/llvm/tools/lld/COFF/Writer.cpp:245:25:
error: no match for 'operator|=' (operand types are
'llvm::support::ulittle16_t {aka
llvm::support::detail::packed_endian_specific_integral<short unsigned int,
(llvm::support::endianness)1u, 1u>}' and 'llvm::COFF::Characteristics')
   COFF->Characteristics |= IMAGE_FILE_LARGE_ADDRESS_AWARE;
                         ^
C:/msys64/home/Martell/MINGW-packages/mingw-w64-clang-git/src/llvm/tools/lld/COFF/Writer.cpp:247:27:
error: no match for 'operator|=' (operand types are
'llvm::support::ulittle16_t {aka
llvm::support::detail::packed_endian_specific_integral<short unsigned int,
(llvm::support::endianness)1u, 1u>}' and 'llvm::COFF::Characteristics')
     COFF->Characteristics |= IMAGE_FILE_RELOCS_STRIPPED;
                           ^

Many Thanks
Martell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150615/e524ce4f/attachment.html>


More information about the llvm-dev mailing list