[all-commits] [llvm/llvm-project] ae3e22: cmake: Enable 64bit off_t on 32bit glibc systems

Khem Raj via All-commits all-commits at lists.llvm.org
Sat Dec 17 16:13:42 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ae3e228af77fea9ff4c45cca88a7a0de2cad662b
      https://github.com/llvm/llvm-project/commit/ae3e228af77fea9ff4c45cca88a7a0de2cad662b
  Author: Khem Raj <raj.khem at gmail.com>
  Date:   2022-12-18 (Sun, 18 Dec 2022)

  Changed paths:
    M llvm/cmake/config-ix.cmake
    M llvm/include/llvm/Config/config.h.cmake
    M llvm/lib/Support/raw_ostream.cpp

  Log Message:
  -----------
  cmake: Enable 64bit off_t on 32bit glibc systems

Pass -D_FILE_OFFSET_BITS=64 to compiler flags on 32bit glibc based
systems. This will make sure that 64bit versions of LFS functions are
used e.g. seek will behave same as lseek64. Also revert [1] partially
because this added a cmake test to detect lseek64 but then forgot to
pass the needed macro to actual compile, this test was incomplete too
since libc implementations like musl has 64bit off_t by default on 32bit
systems and does not bundle[2] -D_LARGEFILE64_SOURCE under -D_GNU_SOURCE
like glibc, which means the compile now fails on musl because the cmake
check passes but we do not have _LARGEFILE64_SOURCE defined. Using the
*64 function was transitional anyways so use -D_FILE_OFFSET_BITS=64
instead

[1] https://github.com/llvm/llvm-project/commit/8db7e5e4eed4c4e697dc3164f2c9351d8c3e942b
[2] https://git.musl-libc.org/cgit/musl/commit/?id=25e6fee27f4a293728dd15b659170e7b9c7db9bc

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D139752




More information about the All-commits mailing list