[all-commits] [llvm/llvm-project] c9783d: [libc] Add support to compile some syscalls on 32 ...

Mikhail R. Gadelha via All-commits all-commits at lists.llvm.org
Thu Aug 3 06:08:28 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c9783d2bda95ec6921b3ca2df930b17af3a6c7b1
      https://github.com/llvm/llvm-project/commit/c9783d2bda95ec6921b3ca2df930b17af3a6c7b1
  Author: Mikhail R. Gadelha <mikhail at igalia.com>
  Date:   2023-08-03 (Thu, 03 Aug 2023)

  Changed paths:
    M libc/config/linux/api.td
    M libc/config/linux/syscall_numbers.h.inc
    M libc/include/CMakeLists.txt
    M libc/include/llvm-libc-macros/linux/signal-macros.h
    M libc/include/llvm-libc-macros/linux/sys-wait-macros.h
    M libc/spec/posix.td
    M libc/src/__support/File/linux/file.cpp
    M libc/src/__support/threads/linux/callonce.cpp
    M libc/src/__support/threads/linux/futex_word.h
    M libc/src/__support/threads/linux/mutex.h
    M libc/src/__support/threads/linux/thread.cpp
    M libc/src/sched/linux/sched_rr_get_interval.cpp
    M libc/src/sys/select/linux/select.cpp
    M libc/src/sys/sendfile/linux/sendfile.cpp
    M libc/src/sys/wait/linux/wait.cpp
    M libc/src/sys/wait/linux/wait4.cpp
    M libc/src/sys/wait/linux/waitpid.cpp
    A libc/src/sys/wait/wait4Impl.h
    M libc/src/threads/linux/CndVar.h
    M libc/src/threads/linux/call_once.cpp
    M libc/src/time/clock_gettime.cpp
    M libc/src/time/gettimeofday.cpp
    M libc/src/time/linux/clock.cpp
    M libc/src/time/linux/time.cpp
    M libc/src/time/nanosleep.cpp
    M libc/src/unistd/linux/dup2.cpp
    M libc/src/unistd/linux/ftruncate.cpp
    M libc/src/unistd/linux/lseek.cpp
    M libc/src/unistd/linux/pread.cpp
    M libc/src/unistd/linux/pwrite.cpp
    M libc/src/unistd/linux/truncate.cpp
    M libc/test/src/sched/sched_rr_get_interval_test.cpp

  Log Message:
  -----------
  [libc] Add support to compile some syscalls on 32 bit platform

This patch adds a bunch of ifdefs to handle the 32 bit versions of
some syscalls, which often only append a 64 to the name of the syscall
(with exception of SYS_lseek -> SYS_llseek and SYS_futex ->
SYS_futex_time64)

This patch also tries to handle cases where wait4 is not available
(as in riscv32): to implement wait, wait4 and waitpid when wait4 is
not available, we check for alternative wait calls and ultimately rely
on waitid to implement them all.

In riscv32, only waitid is available, so we need it to support this
platform.

Reviewed By: michaelrj

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




More information about the All-commits mailing list