[libc-commits] [libc] [libc] remove #include <fcntl.h> and add proxy or type (PR #113836)

LLVM Continuous Integration via libc-commits libc-commits at lists.llvm.org
Mon Oct 28 13:44:27 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `libc-riscv64-debian-fullbuild-dbg` running on `libc-riscv64-debian` while building `libc` at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/183/builds/5444

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/29] Building CXX object projects/libc/src/fcntl/linux/CMakeFiles/libc.src.fcntl.linux.creat.dir/creat.cpp.o
[2/29] Building CXX object projects/libc/src/stdio/linux/CMakeFiles/libc.src.stdio.linux.remove.dir/remove.cpp.o
[3/29] Building CXX object projects/libc/src/__support/OSUtil/linux/CMakeFiles/libc.src.__support.OSUtil.linux.linux_util.dir/fcntl.cpp.o
[4/29] Building CXX object projects/libc/src/fcntl/linux/CMakeFiles/libc.src.fcntl.linux.open.dir/open.cpp.o
[5/29] Building CXX object projects/libc/src/fcntl/linux/CMakeFiles/libc.src.fcntl.linux.openat.dir/openat.cpp.o
[6/29] Building CXX object projects/libc/src/__support/File/linux/CMakeFiles/libc.src.__support.File.linux.linux_dir.dir/dir.cpp.o
[7/29] Building CXX object projects/libc/src/__support/File/linux/CMakeFiles/libc.src.__support.File.linux.file.dir/file.cpp.o
[8/29] Building CXX object projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.chmod.dir/chmod.cpp.o
FAILED: projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.chmod.dir/chmod.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_18_0_0_git -D_DEBUG -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/src/sys/stat/linux -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/sys/stat/linux -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -idirafter/usr/include -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -std=c++17 -MD -MT projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.chmod.dir/chmod.cpp.o -MF projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.chmod.dir/chmod.cpp.o.d -o projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.chmod.dir/chmod.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/sys/stat/linux/chmod.cpp
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/sys/stat/linux/chmod.cpp:30:55: error: use of undeclared identifier 'AT_FDCWD'
      LIBC_NAMESPACE::syscall_impl<int>(SYS_fchmodat, AT_FDCWD, path, mode, 0);
                                                      ^
1 error generated.
[9/29] Building CXX object projects/libc/src/sys/auxv/linux/CMakeFiles/libc.src.sys.auxv.linux.getauxval.dir/getauxval.cpp.o
[10/29] Building CXX object projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.fchmod.dir/fchmod.cpp.o
[11/29] Building CXX object projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.mkdir.dir/mkdir.cpp.o
FAILED: projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.mkdir.dir/mkdir.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_18_0_0_git -D_DEBUG -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/src/sys/stat/linux -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/sys/stat/linux -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -idirafter/usr/include -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -std=c++17 -MD -MT projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.mkdir.dir/mkdir.cpp.o -MF projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.mkdir.dir/mkdir.cpp.o.d -o projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.mkdir.dir/mkdir.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/sys/stat/linux/mkdir.cpp
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/sys/stat/linux/mkdir.cpp:27:54: error: use of undeclared identifier 'AT_FDCWD'
      LIBC_NAMESPACE::syscall_impl<int>(SYS_mkdirat, AT_FDCWD, path, mode);
                                                     ^
1 error generated.
[12/29] Building CXX object projects/libc/src/sys/mman/linux/CMakeFiles/libc.src.sys.mman.linux.shm_open.dir/shm_open.cpp.o
[13/29] Building CXX object projects/libc/src/__support/threads/linux/CMakeFiles/libc.src.__support.threads.linux.thread.dir/thread.cpp.o
ninja: build stopped: subcommand failed.
['ninja', 'libc'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
  File "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 164, in step
    yield
  File "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 121, in main
    run_command(['ninja', 'libc'])
  File "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 179, in run_command
    util.report_run_cmd(cmd, cwd=directory)
  File "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
    subprocess.check_call(cmd, shell=shell, *args, **kwargs)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja', 'libc']' returned non-zero exit status 1.
@@@STEP_FAILURE@@@
@@@BUILD_STEP build libc-startup@@@
Running: ninja libc-startup
ninja: no work to do.
@@@BUILD_STEP libc-unit-tests@@@
Running: ninja libc-unit-tests
Step 6 (build libc) failure: build libc (failure)
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/29] Building CXX object projects/libc/src/fcntl/linux/CMakeFiles/libc.src.fcntl.linux.creat.dir/creat.cpp.o
[2/29] Building CXX object projects/libc/src/stdio/linux/CMakeFiles/libc.src.stdio.linux.remove.dir/remove.cpp.o
[3/29] Building CXX object projects/libc/src/__support/OSUtil/linux/CMakeFiles/libc.src.__support.OSUtil.linux.linux_util.dir/fcntl.cpp.o
[4/29] Building CXX object projects/libc/src/fcntl/linux/CMakeFiles/libc.src.fcntl.linux.open.dir/open.cpp.o
[5/29] Building CXX object projects/libc/src/fcntl/linux/CMakeFiles/libc.src.fcntl.linux.openat.dir/openat.cpp.o
[6/29] Building CXX object projects/libc/src/__support/File/linux/CMakeFiles/libc.src.__support.File.linux.linux_dir.dir/dir.cpp.o
[7/29] Building CXX object projects/libc/src/__support/File/linux/CMakeFiles/libc.src.__support.File.linux.file.dir/file.cpp.o
[8/29] Building CXX object projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.chmod.dir/chmod.cpp.o
FAILED: projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.chmod.dir/chmod.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_18_0_0_git -D_DEBUG -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/src/sys/stat/linux -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/sys/stat/linux -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -idirafter/usr/include -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -std=c++17 -MD -MT projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.chmod.dir/chmod.cpp.o -MF projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.chmod.dir/chmod.cpp.o.d -o projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.chmod.dir/chmod.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/sys/stat/linux/chmod.cpp
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/sys/stat/linux/chmod.cpp:30:55: error: use of undeclared identifier 'AT_FDCWD'
      LIBC_NAMESPACE::syscall_impl<int>(SYS_fchmodat, AT_FDCWD, path, mode, 0);
                                                      ^
1 error generated.
[9/29] Building CXX object projects/libc/src/sys/auxv/linux/CMakeFiles/libc.src.sys.auxv.linux.getauxval.dir/getauxval.cpp.o
[10/29] Building CXX object projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.fchmod.dir/fchmod.cpp.o
[11/29] Building CXX object projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.mkdir.dir/mkdir.cpp.o
FAILED: projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.mkdir.dir/mkdir.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_18_0_0_git -D_DEBUG -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/src/sys/stat/linux -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/sys/stat/linux -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -idirafter/usr/include -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -std=c++17 -MD -MT projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.mkdir.dir/mkdir.cpp.o -MF projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.mkdir.dir/mkdir.cpp.o.d -o projects/libc/src/sys/stat/linux/CMakeFiles/libc.src.sys.stat.linux.mkdir.dir/mkdir.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/sys/stat/linux/mkdir.cpp
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/sys/stat/linux/mkdir.cpp:27:54: error: use of undeclared identifier 'AT_FDCWD'
      LIBC_NAMESPACE::syscall_impl<int>(SYS_mkdirat, AT_FDCWD, path, mode);
                                                     ^
1 error generated.
[12/29] Building CXX object projects/libc/src/sys/mman/linux/CMakeFiles/libc.src.sys.mman.linux.shm_open.dir/shm_open.cpp.o
[13/29] Building CXX object projects/libc/src/__support/threads/linux/CMakeFiles/libc.src.__support.threads.linux.thread.dir/thread.cpp.o
ninja: build stopped: subcommand failed.
['ninja', 'libc'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
  File "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 164, in step
    yield
  File "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 121, in main
    run_command(['ninja', 'libc'])
  File "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 179, in run_command
    util.report_run_cmd(cmd, cwd=directory)
  File "/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
    subprocess.check_call(cmd, shell=shell, *args, **kwargs)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja', 'libc']' returned non-zero exit status 1.

```

</details>

https://github.com/llvm/llvm-project/pull/113836


More information about the libc-commits mailing list