[PATCH] D139752: cmake: Enable 64bit off_t on 32bit glibc systems

Steven Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 11:46:41 PST 2023


srj added a comment.

In D139752#4059869 <https://reviews.llvm.org/D139752#4059869>, @srj wrote:

> From experimentation, it seems that its `add_compile_definitions(_FILE_OFFSET_BITS=64)` that is the culprit; commenting it out allows us to build and run correctly. (Why it's failing in this way is not at all clear to me, but then, CMake has a few quirks here and there...)

This is even stranger, actually... the full cmake commandline I'm getting is

`/usr/bin/cmake -E env CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines /usr/bin/ccache /usr/bin/g++  -m32 -DHALIDE_ENABLE_RTTI -DHALIDE_WITH_EXCEPTIONS -DHalide_EXPORTS -DLLVM_VERSION=160 -DWITH_AARCH64 -DWITH_ARM -DWITH_D3D12 -DWITH_HEXAGON -DWITH_INTROSPECTION -DWITH_METAL -DWITH_MIPS -DWITH_NVPTX -DWITH_OPENCL -DWITH_OPENGLCOMPUTE -DWITH_POWERPC -DWITH_WABT -DWITH_WEBASSEMBLY -DWITH_X86 -D_GNU_SOURCE -D_FILE_OFFSET_BITS="64 -D_DEBUG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" -I/usr/local/google/home/srj/llvm-16-install-32/include -isystem /usr/local/google/home/srj/GitHub/Halide/build-32/_deps/wabt-src/include -isystem /usr/local/google/home/srj/GitHub/Halide/build-32/_deps/wabt-build/include -O3 -DNDEBUG -fPIC -Wall -Wcast-qual -Wignored-qualifiers -Woverloaded-virtual -Wsuggest-override -Wdeprecated-declarations -Wno-double-promotion -Wno-float-conversion -Wno-float-equal -Wno-missing-field-initializers -Wno-old-style-cast -Wno-shadow -Wno-sign-conversion -Wno-switch-enum -Wno-undef -Wno-unused-function -Wno-unused-macros -Wno-unused-parameter -std=c++17 -MD -MT src/CMakeFiles/Halide.dir/BoundsInference.cpp.o -MF src/CMakeFiles/Halide.dir/BoundsInference.cpp.o.d -o src/CMakeFiles/Halide.dir/BoundsInference.cpp.o -c /usr/local/google/home/srj/GitHub/Halide/src/BoundsInference.cpp`

Note this section: `-D_FILE_OFFSET_BITS="64 -D_DEBUG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"`

... that is, for some reason, the quoted part is expanding to contain other definitions as well. Never seen this before in CMake.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139752



More information about the llvm-commits mailing list