atanasyan added a comment.

I'm sorry for delay with handling this issue.

The **160** constant in the `FIRST_32_SECOND_64(144, 104)` depends on the 
following fragment from the `cmake/modules/HandleLLVMOptions.cmake` file 
introduced by the rL301171 <https://reviews.llvm.org/rL301171>. If 
`_LARGEFILE_SOURCE` and `_FILE_OFFSET_BITS=64` are defined, `sizeof(struct 
stat)` equals to **160**. This constant was configured by the rL301307 
<https://reviews.llvm.org/rL301307>. Unfortunately, in case of building on MIPS 
64-bit `CMAKE_SIZEOF_VOID_P` equals to **8** and these definitions are not 
provided to the compiler. It's a separate problem. Probably it needs to be 
handled by supporting the `LLVM_BUILD_32_BITS` option for MIPS targets. These 
option is used to build 32-bit binaries on 64-bit host. But now it's supported 
on limited set of architectures.

  if( CMAKE_SIZEOF_VOID_P EQUAL 4 AND NOT LLVM_FORCE_SMALLFILE_FOR_ANDROID)
    # FIXME: It isn't handled in LLVM_BUILD_32_BITS.
    add_definitions( -D_LARGEFILE_SOURCE )
    add_definitions( -D_FILE_OFFSET_BITS=64 )
  endif()

Meanwhile, could you try to workaround the issue by explicitly providing 
`-mabi=32` (for building MIPS 32-bit binaries) and `-mabi=64` (for building 
MIPS 64-bit binaries) options to the cmake? Something like that:

  -DCMAKE_C_FLAGS="-mabi=32"
  -DCMAKE_CXX_FLAGS="-mabi=32"


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59702/new/

https://reviews.llvm.org/D59702



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to