[PATCH] D78896: [Support] Add file lock/unlock functions

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 3 01:36:09 PDT 2020


ro added a comment.

This patch broke the Solaris buildbots (Builder clang-solaris11-sparcv9 Build #5494 <http://lab.llvm.org:8014/builders/clang-solaris11-sparcv9/builds/5494>, Builder clang-solaris11-amd64 Build #4477 <http://lab.llvm.org:8014/builders/clang-solaris11-amd64/builds/4477>):

  [24/2656] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Path.cpp.o
  FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/Path.cpp.o 
  /usr/gcc/7/bin/c++  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Support -I/opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/lib/Support -Iinclude -I/opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/include -I/opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/include/llvm/Support/Solaris -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -O3    -UNDEBUG -std=c++14  -fno-exceptions -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/Path.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/Path.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/Path.cpp.o -c /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/lib/Support/Path.cpp
  In file included from /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/lib/Support/Path.cpp:1151:0:
  /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/lib/Support/Unix/Path.inc: In function ‘std::error_code llvm::sys::fs::tryLockFile(int, std::chrono::milliseconds)’:
  /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/lib/Support/Unix/Path.inc:1055:21: error: ‘LOCK_EX’ was not declared in this scope
       if (::flock(FD, LOCK_EX | LOCK_NB) == 0)
                       ^~~~~~~
  /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/lib/Support/Unix/Path.inc:1055:21: note: suggested alternative: ‘LOCK_HELD’
       if (::flock(FD, LOCK_EX | LOCK_NB) == 0)
                       ^~~~~~~
                       LOCK_HELD
  /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/lib/Support/Unix/Path.inc:1055:31: error: ‘LOCK_NB’ was not declared in this scope
       if (::flock(FD, LOCK_EX | LOCK_NB) == 0)
                                 ^~~~~~~
  /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/lib/Support/Unix/Path.inc:1055:31: note: suggested alternative: ‘_CLOCK_T’
       if (::flock(FD, LOCK_EX | LOCK_NB) == 0)
                                 ^~~~~~~
                                 _CLOCK_T
  /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/lib/Support/Unix/Path.inc: In function ‘std::error_code llvm::sys::fs::lockFile(int)’:
  /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/lib/Support/Unix/Path.inc:1068:19: error: ‘LOCK_EX’ was not declared in this scope
     if (::flock(FD, LOCK_EX) == 0)
                     ^~~~~~~
  /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/lib/Support/Unix/Path.inc:1068:19: note: suggested alternative: ‘LOCK_HELD’
     if (::flock(FD, LOCK_EX) == 0)
                     ^~~~~~~
                     LOCK_HELD
  /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/lib/Support/Unix/Path.inc: In function ‘std::error_code llvm::sys::fs::unlockFile(int)’:
  /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/lib/Support/Unix/Path.inc:1074:19: error: ‘LOCK_UN’ was not declared in this scope
     if (::flock(FD, LOCK_UN) == -1)
                     ^~~~~~~
  /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/llvm/lib/Support/Unix/Path.inc:1074:19: note: suggested alternative: ‘LONG_MIN’
     if (::flock(FD, LOCK_UN) == -1)
                     ^~~~~~~
                     LONG_MIN

As detailed e.g. in x/sys/unix: Solaris lacks Flock (plus related constants) #11113 <https://github.com/golang/go/issues/11113>, Solaris
doesn't support the non-standard `flock`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78896





More information about the llvm-commits mailing list