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

Alex Reinking via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 11:06:59 PST 2023


alexreinking added a comment.

With this patch, the following line appears in the generated LLVMConfig.cmake file:

  set(LLVM_DEFINITIONS "-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")

Notice that `-D_FILE_OFFSET_BITS=64` appears twice. Removing either copy fixes Halide's build. So does converting `LLVM_DEFINITIONS` to a typical CMake list via `separate_arguments` (which we now have an open PR to do). Somehow, there is a bad interaction between the space/semicolon mixing and CMake's argument de-duplication. I haven't minimized this yet, but at least this explains why this patch causes this problem.

This patch might cause problems for other downstreams that (reasonably, but incorrectly) assume that `LLVM_DEFINITIONS` is a typical CMake list rather than a space-separated list.


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