Skip to content

Commit 7684d05

Browse files
committedMay 15, 2019
[mips] Always use _LARGEFILE_SOURCE / _FILE_OFFSET_BITS for building MIPS 32-bit
When MIPS 32-bit compiler-rt is building on 32-bit host or using 32-bit `DLLVM_HOST_TRIPLE` the `_LARGEFILE_SOURCE` and the `_FILE_OFFSET_BITS=64` macros defined by statements from the `HandleLLVMOptions.cmake`. In case of building 32-bit libraries on 64-bit host using default host triple these macros are not defined. As a result assertions check a consistency between the `struct_kernel_stat_sz` constant and the `struct_kernel_stat_sz` start to fail. To resolve this problem and enable building both 32/64-bit versions of MIPS compiler-rt libraries on 64-bit host at once always explicitly define the `_LARGEFILE_SOURCE` and the `_FILE_OFFSET_BITS=64` macros for MIPS 32-bit. llvm-svn: 360825
1 parent a05ffdb commit 7684d05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎compiler-rt/cmake/base-config-ix.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ macro(test_targets)
191191
# clang's default CPU's. In the 64-bit case, we must also specify the ABI
192192
# since the default ABI differs between gcc and clang.
193193
# FIXME: Ideally, we would build the N32 library too.
194-
test_target_arch(mipsel "" "-mips32r2" "-mabi=32")
194+
test_target_arch(mipsel "" "-mips32r2" "-mabi=32" "-D_LARGEFILE_SOURCE" "-D_FILE_OFFSET_BITS=64")
195195
test_target_arch(mips64el "" "-mips64r2" "-mabi=64")
196196
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mips")
197-
test_target_arch(mips "" "-mips32r2" "-mabi=32")
197+
test_target_arch(mips "" "-mips32r2" "-mabi=32" "-D_LARGEFILE_SOURCE" "-D_FILE_OFFSET_BITS=64")
198198
test_target_arch(mips64 "" "-mips64r2" "-mabi=64")
199199
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "arm")
200200
if(WIN32)

0 commit comments

Comments
 (0)
Please sign in to comment.