Skip to content

[libc] Add unistd overlay #118882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

RossComputerGuy
Copy link
Member

Fixes failures like this which I experienced:

FAILED: src/unistd/linux/CMakeFiles/libc.src.unistd.linux.read.dir/read.cpp.o
/nix/store/2r2xi5pbg29bsmqywsm5zgl8l7adky4i-gcc-wrapper-13.3.0/bin/g++ -DLIBC_NAMESPACE=__llvm_libc -D_DEBUG -I/build/libc-src-20.0.0-unstable-2024-12-05/libc -isystem /build/libc-src-20.0.0-unstable-2024-12-05/libc/build/include -g -std=gnu++17 -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT src/unistd/linux/CMakeFiles/libc.src.unistd.linux.read.dir/read.cpp.o -MF src/unistd/linux/CMakeFiles/libc.src.unistd.linux.read.dir/read.cpp.o.d -o src/unistd/linux/CMakeFiles/libc.src.unistd.linux.read.dir/read.cpp.o -c /build/libc-src-20.0.0-unstable-2024-12-05/libc/src/unistd/linux/read.cpp
次のファイルから読み込み:  /build/libc-src-20.0.0-unstable-2024-12-05/libc/src/__support/OSUtil/linux/syscall.h:13,
         次から読み込み:  /build/libc-src-20.0.0-unstable-2024-12-05/libc/src/__support/OSUtil/syscall.h:15,
         次から読み込み:  /build/libc-src-20.0.0-unstable-2024-12-05/libc/src/unistd/linux/read.cpp:11:
/build/libc-src-20.0.0-unstable-2024-12-05/libc/src/unistd/linux/read.cpp:20:29: エラー: ‘ssize_t __llvm_libc::read(int, void*, size_t)’ が外部シンボル ‘read’ の別名となっています
   20 | LLVM_LIBC_FUNCTION(ssize_t, read, (int fd, void *buf, size_t count)) {
      |                             ^~~~
/build/libc-src-20.0.0-unstable-2024-12-05/libc/src/__support/common.h:46:34: 備考: in definition of macro ‘LLVM_LIBC_FUNCTION_IMPL’
   46 |   decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]];                   \
      |                                  ^~~~
/build/libc-src-20.0.0-unstable-2024-12-05/libc/src/unistd/linux/read.cpp:20:1: 備考: in expansion of macro ‘LLVM_LIBC_FUNCTION’
   20 | LLVM_LIBC_FUNCTION(ssize_t, read, (int fd, void *buf, size_t count)) {
      | ^~~~~~~~~~~~~~~~~~

@llvmbot llvmbot added the libc label Dec 5, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 5, 2024

@llvm/pr-subscribers-libc

Author: Tristan Ross (RossComputerGuy)

Changes

Fixes failures like this which I experienced:

FAILED: src/unistd/linux/CMakeFiles/libc.src.unistd.linux.read.dir/read.cpp.o
/nix/store/2r2xi5pbg29bsmqywsm5zgl8l7adky4i-gcc-wrapper-13.3.0/bin/g++ -DLIBC_NAMESPACE=__llvm_libc -D_DEBUG -I/build/libc-src-20.0.0-unstable-2024-12-05/libc -isystem /build/libc-src-20.0.0-unstable-2024-12-05/libc/build/include -g -std=gnu++17 -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT src/unistd/linux/CMakeFiles/libc.src.unistd.linux.read.dir/read.cpp.o -MF src/unistd/linux/CMakeFiles/libc.src.unistd.linux.read.dir/read.cpp.o.d -o src/unistd/linux/CMakeFiles/libc.src.unistd.linux.read.dir/read.cpp.o -c /build/libc-src-20.0.0-unstable-2024-12-05/libc/src/unistd/linux/read.cpp
次のファイルから読み込み:  /build/libc-src-20.0.0-unstable-2024-12-05/libc/src/__support/OSUtil/linux/syscall.h:13,
         次から読み込み:  /build/libc-src-20.0.0-unstable-2024-12-05/libc/src/__support/OSUtil/syscall.h:15,
         次から読み込み:  /build/libc-src-20.0.0-unstable-2024-12-05/libc/src/unistd/linux/read.cpp:11:
/build/libc-src-20.0.0-unstable-2024-12-05/libc/src/unistd/linux/read.cpp:20:29: エラー: ‘ssize_t __llvm_libc::read(int, void*, size_t)’ が外部シンボル ‘read’ の別名となっています
   20 | LLVM_LIBC_FUNCTION(ssize_t, read, (int fd, void *buf, size_t count)) {
      |                             ^~~~
/build/libc-src-20.0.0-unstable-2024-12-05/libc/src/__support/common.h:46:34: 備考: in definition of macro ‘LLVM_LIBC_FUNCTION_IMPL’
   46 |   decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]];                   \
      |                                  ^~~~
/build/libc-src-20.0.0-unstable-2024-12-05/libc/src/unistd/linux/read.cpp:20:1: 備考: in expansion of macro ‘LLVM_LIBC_FUNCTION’
   20 | LLVM_LIBC_FUNCTION(ssize_t, read, (int fd, void *buf, size_t count)) {
      | ^~~~~~~~~~~~~~~~~~

Full diff: https://github.com/llvm/llvm-project/pull/118882.diff

7 Files Affected:

  • (modified) libc/hdr/unistd_macros.h (+1-1)
  • (added) libc/hdr/unistd_overlay.h (+69)
  • (modified) libc/src/unistd/getcwd.h (+1-1)
  • (modified) libc/src/unistd/pread.h (+1-1)
  • (modified) libc/src/unistd/read.h (+1-1)
  • (modified) libc/src/unistd/readlink.h (+1-1)
  • (modified) libc/src/unistd/readlinkat.h (+1-1)
diff --git a/libc/hdr/unistd_macros.h b/libc/hdr/unistd_macros.h
index 132e123280139f..5c2b24354dd3ee 100644
--- a/libc/hdr/unistd_macros.h
+++ b/libc/hdr/unistd_macros.h
@@ -15,7 +15,7 @@
 
 #else // Overlay mode
 
-#include <unistd.h>
+#include "unistd_overlay.h"
 
 #endif // LLVM_LIBC_FULL_BUILD
 
diff --git a/libc/hdr/unistd_overlay.h b/libc/hdr/unistd_overlay.h
new file mode 100644
index 00000000000000..f2c9ed8e34ff60
--- /dev/null
+++ b/libc/hdr/unistd_overlay.h
@@ -0,0 +1,69 @@
+//===-- Including unistd.h in overlay mode ---------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_HDR_UNISTD_OVERLAY_H
+#define LLVM_LIBC_HDR_UNISTD_OVERLAY_H
+
+#ifdef LIBC_FULL_BUILD
+#error "This header should only be included in overlay mode"
+#endif
+
+// Overlay mode
+
+// glibc <unistd.h> header might provide extern inline definitions for few
+// functions, causing external alias errors.  They are guarded by
+// `__USE_EXTERN_INLINES` macro.  We temporarily disable `__USE_EXTERN_INLINES`
+// macro by defining `__NO_INLINE__` before including <stdio.h>.
+// And the same with `__USE_FORTIFY_LEVEL`, which will be temporarily disabled
+// with `_FORTIFY_SOURCE`.
+
+#ifdef _FORTIFY_SOURCE
+#define LIBC_OLD_FORTIFY_SOURCE _FORTIFY_SOURCE
+#undef _FORTIFY_SOURCE
+#endif
+
+#ifdef __USE_EXTERN_INLINES
+#define LIBC_OLD_USE_EXTERN_INLINES
+#undef __USE_EXTERN_INLINES
+#endif
+
+#ifdef __USE_FORTIFY_LEVEL
+#define LIBC_OLD_USE_FORTIFY_LEVEL __USE_FORTIFY_LEVEL
+#undef __USE_FORTIFY_LEVEL
+#define __USE_FORTIFY_LEVEL 0
+#endif
+
+#ifndef __NO_INLINE__
+#define __NO_INLINE__ 1
+#define LIBC_SET_NO_INLINE
+#endif
+
+#include <unistd.h>
+
+#ifdef LIBC_OLD_FORTIFY_SOURCE
+#define _FORTIFY_SOURCE LIBC_OLD_FORTIFY_SOURCE
+#undef LIBC_OLD_FORTIFY_SOURCE
+#endif
+
+#ifdef LIBC_SET_NO_INLINE
+#undef __NO_INLINE__
+#undef LIBC_SET_NO_INLINE
+#endif
+
+#ifdef LIBC_OLD_USE_FORTIFY_LEVEL
+#undef __USE_FORTIFY_LEVEL
+#define __USE_FORTIFY_LEVEL LIBC_OLD_USE_FORTIFY_LEVEL
+#undef LIBC_OLD_USE_FORTIFY_LEVEL
+#endif
+
+#ifdef LIBC_OLD_USE_EXTERN_INLINES
+#define __USE_EXTERN_INLINES
+#undef LIBC_OLD_USE_EXTERN_INLINES
+#endif
+
+#endif // LLVM_LIBC_HDR_UNISTD_OVERLAY_H
diff --git a/libc/src/unistd/getcwd.h b/libc/src/unistd/getcwd.h
index 8b63a91c26b5c7..8331944490b721 100644
--- a/libc/src/unistd/getcwd.h
+++ b/libc/src/unistd/getcwd.h
@@ -10,7 +10,7 @@
 #define LLVM_LIBC_SRC_UNISTD_GETCWD_H
 
 #include "src/__support/macros/config.h"
-#include <unistd.h>
+#include "hdr/unistd_macros.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/unistd/pread.h b/libc/src/unistd/pread.h
index 4723675e82a20a..e0bdc471b12219 100644
--- a/libc/src/unistd/pread.h
+++ b/libc/src/unistd/pread.h
@@ -10,7 +10,7 @@
 #define LLVM_LIBC_SRC_UNISTD_PREAD_H
 
 #include "src/__support/macros/config.h"
-#include <unistd.h>
+#include "hdr/unistd_macros.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/unistd/read.h b/libc/src/unistd/read.h
index 01231cb82e35e5..3d2ecd556d111e 100644
--- a/libc/src/unistd/read.h
+++ b/libc/src/unistd/read.h
@@ -10,7 +10,7 @@
 #define LLVM_LIBC_SRC_UNISTD_READ_H
 
 #include "src/__support/macros/config.h"
-#include <unistd.h>
+#include "hdr/unistd_macros.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/unistd/readlink.h b/libc/src/unistd/readlink.h
index a73e9740c74637..562936150512a7 100644
--- a/libc/src/unistd/readlink.h
+++ b/libc/src/unistd/readlink.h
@@ -10,7 +10,7 @@
 #define LLVM_LIBC_SRC_UNISTD_READLINK_H
 
 #include "src/__support/macros/config.h"
-#include <unistd.h>
+#include "hdr/unistd_macros.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/unistd/readlinkat.h b/libc/src/unistd/readlinkat.h
index 6bdd48b537fc8c..2e0e33f77586eb 100644
--- a/libc/src/unistd/readlinkat.h
+++ b/libc/src/unistd/readlinkat.h
@@ -10,7 +10,7 @@
 #define LLVM_LIBC_SRC_UNISTD_READLINKAT_H
 
 #include "src/__support/macros/config.h"
-#include <unistd.h>
+#include "hdr/unistd_macros.h"
 
 namespace LIBC_NAMESPACE_DECL {
 

Copy link

github-actions bot commented Dec 5, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@lntue
Copy link
Contributor

lntue commented Dec 5, 2024

Can you also update libc/hdr/CMakeLists.txt to add the new header library and dependency?

@RossComputerGuy RossComputerGuy force-pushed the feat/llvm-libc-fixes-unistd branch from 8e2299c to 50ef7fb Compare December 5, 2024 22:02
@RossComputerGuy
Copy link
Member Author

Alright, I've added that in.

Comment on lines 1 to 2
//===-- Including unistd.h in overlay mode
//---------------------------------===//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: fix formatting

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, what about the CI complaining about the bad formatting then lol

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it, I think we'll just ignore the format CI fail then lol.

@@ -9,8 +9,8 @@
#ifndef LLVM_LIBC_SRC_UNISTD_PREAD_H
#define LLVM_LIBC_SRC_UNISTD_PREAD_H

#include "hdr/unistd_macros.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you apply this to the other unistd functions as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@RossComputerGuy RossComputerGuy force-pushed the feat/llvm-libc-fixes-unistd branch 2 times, most recently from d22d01c to 99cd546 Compare December 5, 2024 22:26
Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like some of these need types instead of macros

@@ -14,8 +14,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"

#include <sys/syscall.h> // For syscall numbers.
#include <unistd.h> // For off_t.
#include "hdr/unistd_macros.h" // For off_t.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is for off_t it may need the correct type header instead of unistd_macros.h

@@ -9,8 +9,8 @@
#ifndef LLVM_LIBC_SRC_UNISTD_SWAB_H
#define LLVM_LIBC_SRC_UNISTD_SWAB_H

#include "hdr/unistd_macros.h" // For ssize_t
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this also needs the correct type header

@RossComputerGuy RossComputerGuy force-pushed the feat/llvm-libc-fixes-unistd branch 2 times, most recently from 28682ec to e64ffcf Compare December 5, 2024 23:19
@@ -14,8 +14,8 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"

#include <sys/syscall.h> // For syscall numbers.
#include <unistd.h> // For off_t.
#include "include/llvm-libc-types/off_t.h" // For off_t.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should use the proxy header at hdr/types/off_t.h

Suggested change
#include "include/llvm-libc-types/off_t.h" // For off_t.
#include "hdr/types/off_t.h"

@@ -9,8 +9,8 @@
#ifndef LLVM_LIBC_SRC_UNISTD_SWAB_H
#define LLVM_LIBC_SRC_UNISTD_SWAB_H

#include "include/llvm-libc-types/ssize_t.h" // For ssize_t
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Suggested change
#include "include/llvm-libc-types/ssize_t.h" // For ssize_t
#include "hdr/types/ssize_t.h"

@RossComputerGuy RossComputerGuy force-pushed the feat/llvm-libc-fixes-unistd branch from e64ffcf to 9f4c213 Compare December 5, 2024 23:24
@RossComputerGuy RossComputerGuy force-pushed the feat/llvm-libc-fixes-unistd branch from 9f4c213 to 81b43fd Compare December 9, 2024 04:17
@RossComputerGuy
Copy link
Member Author

libc/src/unistd/linux/lseek.cpp needed to be clang-formatted so I fixed it.

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch LGTM wafter the formatting fixes are done. Do you need me to merge it for you?

@@ -0,0 +1,69 @@
//===-- Including unistd.h in overlay mode ---------------------------------===//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this line is too long

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How should we fix it since clang-format probably is complaining about other header files with header lines that are too long? Just letting clang-format do it's thing makes it look awkward.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove - until clang-format doesn't try to wrap it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it.

@RossComputerGuy
Copy link
Member Author

Do you need me to merge it for you?

Yeah, I don't have merge perms.

@RossComputerGuy RossComputerGuy force-pushed the feat/llvm-libc-fixes-unistd branch from 81b43fd to 1c8f920 Compare December 9, 2024 19:04
@michaelrj-google
Copy link
Contributor

LGTM, I will merge once presubmits are done.

@michaelrj-google michaelrj-google merged commit 7db970f into llvm:main Dec 9, 2024
7 checks passed
@RossComputerGuy RossComputerGuy deleted the feat/llvm-libc-fixes-unistd branch December 10, 2024 00:00
@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 10, 2024

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

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Performing Test HAVE_PTHREAD_AFFINITY -- failed to compile
-- Configuring done
-- Generating done
-- Build files have been written to: /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/build
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/29] Building CXX object projects/libc/src/unistd/CMakeFiles/libc.src.unistd.swab.dir/swab.cpp.o
[2/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getppid.dir/getppid.cpp.o
FAILED: projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getppid.dir/getppid.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -Iprojects/libc/src/unistd/linux -I/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/unistd/linux -I/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc -isystem 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/unistd/linux/CMakeFiles/libc.src.unistd.linux.getppid.dir/getppid.cpp.o -MF projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getppid.dir/getppid.cpp.o.d -o projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getppid.dir/getppid.cpp.o -c /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/unistd/linux/getppid.cpp
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/unistd/linux/getppid.cpp:9:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/unistd/getppid.h:17:1: error: unknown type name 'pid_t'
pid_t getppid();
^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/unistd/linux/getppid.cpp:19:1: error: definition 'getppid' cannot also be an alias
LLVM_LIBC_FUNCTION(pid_t, getppid, ()) {
^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/common.h:54:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
  LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
  ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/common.h:46:41: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
  decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]];                   \
                                        ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/unistd/linux/getppid.cpp:19:20: error: unknown type name 'pid_t'
LLVM_LIBC_FUNCTION(pid_t, getppid, ()) {
                   ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/unistd/linux/getppid.cpp:20:39: error: use of undeclared identifier 'pid_t'
  return LIBC_NAMESPACE::syscall_impl<pid_t>(SYS_getppid);
                                      ^
4 errors generated.
[3/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.geteuid.dir/geteuid.cpp.o
FAILED: projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.geteuid.dir/geteuid.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -Iprojects/libc/src/unistd/linux -I/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/unistd/linux -I/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc -isystem 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/unistd/linux/CMakeFiles/libc.src.unistd.linux.geteuid.dir/geteuid.cpp.o -MF projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.geteuid.dir/geteuid.cpp.o.d -o projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.geteuid.dir/geteuid.cpp.o -c /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/unistd/linux/geteuid.cpp
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/unistd/linux/geteuid.cpp:9:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/unistd/geteuid.h:17:1: error: unknown type name 'uid_t'
uid_t geteuid();
^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/unistd/linux/geteuid.cpp:19:1: error: definition 'geteuid' cannot also be an alias
LLVM_LIBC_FUNCTION(uid_t, geteuid, ()) {
^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/common.h:54:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
  LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
  ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/common.h:46:41: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
  decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]];                   \
                                        ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/unistd/linux/geteuid.cpp:19:20: error: unknown type name 'uid_t'

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 10, 2024

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

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Performing Test HAVE_PTHREAD_AFFINITY -- success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.sysconf.dir/sysconf.cpp.o
[2/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getuid.dir/getuid.cpp.o
FAILED: projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getuid.dir/getuid.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/projects/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/projects/libc/include -fPIC -fno-semantic-interposition -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 -fno-omit-frame-pointer -O1 -fsanitize=address -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 -mno-omit-leaf-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/unistd/linux/CMakeFiles/libc.src.unistd.linux.getuid.dir/getuid.cpp.o -MF projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getuid.dir/getuid.cpp.o.d -o projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getuid.dir/getuid.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getuid.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getuid.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/getuid.h:17:1: error: unknown type name 'uid_t'
uid_t getuid();
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getuid.cpp:19:1: error: definition 'getuid' cannot also be an alias
LLVM_LIBC_FUNCTION(uid_t, getuid, ()) {
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/__support/common.h:54:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
  LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
  ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/__support/common.h:46:41: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
  decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]];                   \
                                        ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getuid.cpp:19:20: error: unknown type name 'uid_t'
LLVM_LIBC_FUNCTION(uid_t, getuid, ()) {
                   ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getuid.cpp:20:39: error: use of undeclared identifier 'uid_t'
  return LIBC_NAMESPACE::syscall_impl<uid_t>(SYS_getuid);
                                      ^
4 errors generated.
[3/29] Building CXX object projects/libc/src/unistd/CMakeFiles/libc.src.unistd.swab.dir/swab.cpp.o
[4/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.isatty.dir/isatty.cpp.o
[5/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getpid.dir/getpid.cpp.o
FAILED: projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getpid.dir/getpid.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/projects/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/projects/libc/include -fPIC -fno-semantic-interposition -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 -fno-omit-frame-pointer -O1 -fsanitize=address -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 -mno-omit-leaf-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/unistd/linux/CMakeFiles/libc.src.unistd.linux.getpid.dir/getpid.cpp.o -MF projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getpid.dir/getpid.cpp.o.d -o projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getpid.dir/getpid.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getpid.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getpid.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/getpid.h:17:1: error: unknown type name 'pid_t'
pid_t getpid();
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getpid.cpp:19:1: error: definition 'getpid' cannot also be an alias
LLVM_LIBC_FUNCTION(pid_t, getpid, ()) {
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/__support/common.h:54:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
  LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
  ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/__support/common.h:46:41: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
  decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]];                   \
Step 6 (build libc) failure: build libc (failure)
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.sysconf.dir/sysconf.cpp.o
[2/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getuid.dir/getuid.cpp.o
FAILED: projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getuid.dir/getuid.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/projects/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/projects/libc/include -fPIC -fno-semantic-interposition -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 -fno-omit-frame-pointer -O1 -fsanitize=address -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 -mno-omit-leaf-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/unistd/linux/CMakeFiles/libc.src.unistd.linux.getuid.dir/getuid.cpp.o -MF projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getuid.dir/getuid.cpp.o.d -o projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getuid.dir/getuid.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getuid.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getuid.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/getuid.h:17:1: error: unknown type name 'uid_t'
uid_t getuid();
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getuid.cpp:19:1: error: definition 'getuid' cannot also be an alias
LLVM_LIBC_FUNCTION(uid_t, getuid, ()) {
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/__support/common.h:54:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
  LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
  ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/__support/common.h:46:41: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
  decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]];                   \
                                        ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getuid.cpp:19:20: error: unknown type name 'uid_t'
LLVM_LIBC_FUNCTION(uid_t, getuid, ()) {
                   ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getuid.cpp:20:39: error: use of undeclared identifier 'uid_t'
  return LIBC_NAMESPACE::syscall_impl<uid_t>(SYS_getuid);
                                      ^
4 errors generated.
[3/29] Building CXX object projects/libc/src/unistd/CMakeFiles/libc.src.unistd.swab.dir/swab.cpp.o
[4/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.isatty.dir/isatty.cpp.o
[5/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getpid.dir/getpid.cpp.o
FAILED: projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getpid.dir/getpid.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/projects/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/projects/libc/include -fPIC -fno-semantic-interposition -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 -fno-omit-frame-pointer -O1 -fsanitize=address -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 -mno-omit-leaf-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/unistd/linux/CMakeFiles/libc.src.unistd.linux.getpid.dir/getpid.cpp.o -MF projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getpid.dir/getpid.cpp.o.d -o projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getpid.dir/getpid.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getpid.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getpid.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/getpid.h:17:1: error: unknown type name 'pid_t'
pid_t getpid();
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getpid.cpp:19:1: error: definition 'getpid' cannot also be an alias
LLVM_LIBC_FUNCTION(pid_t, getpid, ()) {
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/__support/common.h:54:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
  LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
  ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/__support/common.h:46:41: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
  decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]];                   \
                                        ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getpid.cpp:19:20: error: unknown type name 'pid_t'
LLVM_LIBC_FUNCTION(pid_t, getpid, ()) {
                   ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/src/unistd/linux/getpid.cpp:20:39: error: use of undeclared identifier 'pid_t'
  return LIBC_NAMESPACE::syscall_impl<pid_t>(SYS_getpid);
                                      ^

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 10, 2024

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

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Performing Test HAVE_PTHREAD_AFFINITY -- success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/29] Building CXX object projects/libc/src/unistd/CMakeFiles/libc.src.unistd.swab.dir/swab.cpp.o
[2/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.sysconf.dir/sysconf.cpp.o
[3/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getppid.dir/getppid.cpp.o
FAILED: projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getppid.dir/getppid.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build/projects/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build/projects/libc/include -fPIC -fno-semantic-interposition -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 -mno-omit-leaf-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/unistd/linux/CMakeFiles/libc.src.unistd.linux.getppid.dir/getppid.cpp.o -MF projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getppid.dir/getppid.cpp.o.d -o projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getppid.dir/getppid.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/getppid.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/getppid.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/getppid.h:17:1: error: unknown type name 'pid_t'
pid_t getppid();
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/getppid.cpp:19:1: error: definition 'getppid' cannot also be an alias
LLVM_LIBC_FUNCTION(pid_t, getppid, ()) {
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/__support/common.h:54:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
  LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
  ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/__support/common.h:46:41: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
  decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]];                   \
                                        ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/getppid.cpp:19:20: error: unknown type name 'pid_t'
LLVM_LIBC_FUNCTION(pid_t, getppid, ()) {
                   ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/getppid.cpp:20:39: error: use of undeclared identifier 'pid_t'
  return LIBC_NAMESPACE::syscall_impl<pid_t>(SYS_getppid);
                                      ^
4 errors generated.
[4/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.geteuid.dir/geteuid.cpp.o
FAILED: projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.geteuid.dir/geteuid.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build/projects/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build/projects/libc/include -fPIC -fno-semantic-interposition -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 -mno-omit-leaf-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/unistd/linux/CMakeFiles/libc.src.unistd.linux.geteuid.dir/geteuid.cpp.o -MF projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.geteuid.dir/geteuid.cpp.o.d -o projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.geteuid.dir/geteuid.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/geteuid.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/geteuid.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/geteuid.h:17:1: error: unknown type name 'uid_t'
uid_t geteuid();
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/geteuid.cpp:19:1: error: definition 'geteuid' cannot also be an alias
LLVM_LIBC_FUNCTION(uid_t, geteuid, ()) {
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/__support/common.h:54:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
  LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
  ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/__support/common.h:46:41: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
  decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]];                   \
                                        ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/geteuid.cpp:19:20: error: unknown type name 'uid_t'
Step 6 (build libc) failure: build libc (failure)
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/29] Building CXX object projects/libc/src/unistd/CMakeFiles/libc.src.unistd.swab.dir/swab.cpp.o
[2/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.sysconf.dir/sysconf.cpp.o
[3/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getppid.dir/getppid.cpp.o
FAILED: projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getppid.dir/getppid.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build/projects/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build/projects/libc/include -fPIC -fno-semantic-interposition -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 -mno-omit-leaf-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/unistd/linux/CMakeFiles/libc.src.unistd.linux.getppid.dir/getppid.cpp.o -MF projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getppid.dir/getppid.cpp.o.d -o projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.getppid.dir/getppid.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/getppid.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/getppid.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/getppid.h:17:1: error: unknown type name 'pid_t'
pid_t getppid();
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/getppid.cpp:19:1: error: definition 'getppid' cannot also be an alias
LLVM_LIBC_FUNCTION(pid_t, getppid, ()) {
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/__support/common.h:54:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
  LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
  ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/__support/common.h:46:41: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
  decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]];                   \
                                        ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/getppid.cpp:19:20: error: unknown type name 'pid_t'
LLVM_LIBC_FUNCTION(pid_t, getppid, ()) {
                   ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/getppid.cpp:20:39: error: use of undeclared identifier 'pid_t'
  return LIBC_NAMESPACE::syscall_impl<pid_t>(SYS_getppid);
                                      ^
4 errors generated.
[4/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.geteuid.dir/geteuid.cpp.o
FAILED: projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.geteuid.dir/geteuid.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build/projects/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build/projects/libc/include -fPIC -fno-semantic-interposition -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 -mno-omit-leaf-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/unistd/linux/CMakeFiles/libc.src.unistd.linux.geteuid.dir/geteuid.cpp.o -MF projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.geteuid.dir/geteuid.cpp.o.d -o projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.geteuid.dir/geteuid.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/geteuid.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/geteuid.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/geteuid.h:17:1: error: unknown type name 'uid_t'
uid_t geteuid();
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/geteuid.cpp:19:1: error: definition 'geteuid' cannot also be an alias
LLVM_LIBC_FUNCTION(uid_t, geteuid, ()) {
^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/__support/common.h:54:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
  LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
  ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/__support/common.h:46:41: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
  decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]];                   \
                                        ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/geteuid.cpp:19:20: error: unknown type name 'uid_t'
LLVM_LIBC_FUNCTION(uid_t, geteuid, ()) {
                   ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/unistd/linux/geteuid.cpp:20:39: error: use of undeclared identifier 'uid_t'
  return LIBC_NAMESPACE::syscall_impl<uid_t>(SYS_geteuid);
                                      ^
4 errors generated.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 10, 2024

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

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Performing Test HAVE_PTHREAD_AFFINITY -- success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/29] Building CXX object projects/libc/src/unistd/CMakeFiles/libc.src.unistd.swab.dir/swab.cpp.o
[2/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.ftruncate.dir/ftruncate.cpp.o
FAILED: projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.ftruncate.dir/ftruncate.cpp.o 
/usr/bin/g++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/projects/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/projects/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -isystem/usr/lib/gcc/x86_64-linux-gnu/12//include -nostdinc -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 -mno-omit-leaf-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -fext-numeric-literals -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -DLIBC_COPT_PUBLIC_PACKAGING -std=c++17 -MD -MT projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.ftruncate.dir/ftruncate.cpp.o -MF projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.ftruncate.dir/ftruncate.cpp.o.d -o projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.ftruncate.dir/ftruncate.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/ftruncate.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/ftruncate.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/ftruncate.h:17:20: error: ‘off_t’ has not been declared
   17 | int ftruncate(int, off_t);
      |                    ^~~~~
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/OSUtil/linux/syscall.h:13,
                 from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/OSUtil/syscall.h:15,
                 from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/ftruncate.cpp:11:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/ftruncate.cpp:22:45: error: ‘off_t’ has not been declared
   22 | LLVM_LIBC_FUNCTION(int, ftruncate, (int fd, off_t len)) {
      |                                             ^~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/common.h:47:26: note: in definition of macro ‘LLVM_LIBC_FUNCTION_IMPL’
   47 |   type __##name##_impl__ arglist
      |                          ^~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/ftruncate.cpp:22:1: note: in expansion of macro ‘LLVM_LIBC_FUNCTION’
   22 | LLVM_LIBC_FUNCTION(int, ftruncate, (int fd, off_t len)) {
      | ^~~~~~~~~~~~~~~~~~
[3/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.sysconf.dir/sysconf.cpp.o
[4/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.lseek.dir/lseek.cpp.o
FAILED: projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.lseek.dir/lseek.cpp.o 
/usr/bin/g++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/projects/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/projects/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -isystem/usr/lib/gcc/x86_64-linux-gnu/12//include -nostdinc -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 -mno-omit-leaf-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -fext-numeric-literals -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -DLIBC_COPT_PUBLIC_PACKAGING -std=c++17 -MD -MT projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.lseek.dir/lseek.cpp.o -MF projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.lseek.dir/lseek.cpp.o.d -o projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.lseek.dir/lseek.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/lseek.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/lseek.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/lseek.h:17:1: error: ‘off_t’ does not name a type
   17 | off_t lseek(int fd, off_t offset, int whence);
      | ^~~~~
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/OSUtil/linux/syscall.h:13,
                 from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/OSUtil/syscall.h:15,
                 from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/File/linux/lseekImpl.h:13,
                 from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/lseek.cpp:13:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/lseek.cpp:22:27: error: ‘lseek’ is not a member of ‘__llvm_libc_20_0_0_git’
   22 | LLVM_LIBC_FUNCTION(off_t, lseek, (int fd, off_t offset, int whence)) {
      |                           ^~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/common.h:44:52: note: in definition of macro ‘LLVM_LIBC_FUNCTION_IMPL’
   44 |   LLVM_LIBC_FUNCTION_ATTR decltype(LIBC_NAMESPACE::name)                       \
      |                                                    ^~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/lseek.cpp:22:1: note: in expansion of macro ‘LLVM_LIBC_FUNCTION’
   22 | LLVM_LIBC_FUNCTION(off_t, lseek, (int fd, off_t offset, int whence)) {
      | ^~~~~~~~~~~~~~~~~~
Step 6 (build libc) failure: build libc (failure)
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/29] Building CXX object projects/libc/src/unistd/CMakeFiles/libc.src.unistd.swab.dir/swab.cpp.o
[2/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.ftruncate.dir/ftruncate.cpp.o
FAILED: projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.ftruncate.dir/ftruncate.cpp.o 
/usr/bin/g++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/projects/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/projects/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -isystem/usr/lib/gcc/x86_64-linux-gnu/12//include -nostdinc -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 -mno-omit-leaf-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -fext-numeric-literals -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -DLIBC_COPT_PUBLIC_PACKAGING -std=c++17 -MD -MT projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.ftruncate.dir/ftruncate.cpp.o -MF projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.ftruncate.dir/ftruncate.cpp.o.d -o projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.ftruncate.dir/ftruncate.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/ftruncate.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/ftruncate.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/ftruncate.h:17:20: error: ‘off_t’ has not been declared
   17 | int ftruncate(int, off_t);
      |                    ^~~~~
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/OSUtil/linux/syscall.h:13,
                 from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/OSUtil/syscall.h:15,
                 from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/ftruncate.cpp:11:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/ftruncate.cpp:22:45: error: ‘off_t’ has not been declared
   22 | LLVM_LIBC_FUNCTION(int, ftruncate, (int fd, off_t len)) {
      |                                             ^~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/common.h:47:26: note: in definition of macro ‘LLVM_LIBC_FUNCTION_IMPL’
   47 |   type __##name##_impl__ arglist
      |                          ^~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/ftruncate.cpp:22:1: note: in expansion of macro ‘LLVM_LIBC_FUNCTION’
   22 | LLVM_LIBC_FUNCTION(int, ftruncate, (int fd, off_t len)) {
      | ^~~~~~~~~~~~~~~~~~
[3/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.sysconf.dir/sysconf.cpp.o
[4/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.lseek.dir/lseek.cpp.o
FAILED: projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.lseek.dir/lseek.cpp.o 
/usr/bin/g++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/projects/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/projects/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -isystem/usr/lib/gcc/x86_64-linux-gnu/12//include -nostdinc -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 -mno-omit-leaf-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -fext-numeric-literals -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -DLIBC_COPT_PUBLIC_PACKAGING -std=c++17 -MD -MT projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.lseek.dir/lseek.cpp.o -MF projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.lseek.dir/lseek.cpp.o.d -o projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.lseek.dir/lseek.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/lseek.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/lseek.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/lseek.h:17:1: error: ‘off_t’ does not name a type
   17 | off_t lseek(int fd, off_t offset, int whence);
      | ^~~~~
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/OSUtil/linux/syscall.h:13,
                 from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/OSUtil/syscall.h:15,
                 from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/File/linux/lseekImpl.h:13,
                 from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/lseek.cpp:13:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/lseek.cpp:22:27: error: ‘lseek’ is not a member of ‘__llvm_libc_20_0_0_git’
   22 | LLVM_LIBC_FUNCTION(off_t, lseek, (int fd, off_t offset, int whence)) {
      |                           ^~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/common.h:44:52: note: in definition of macro ‘LLVM_LIBC_FUNCTION_IMPL’
   44 |   LLVM_LIBC_FUNCTION_ATTR decltype(LIBC_NAMESPACE::name)                       \
      |                                                    ^~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/lseek.cpp:22:1: note: in expansion of macro ‘LLVM_LIBC_FUNCTION’
   22 | LLVM_LIBC_FUNCTION(off_t, lseek, (int fd, off_t offset, int whence)) {
      | ^~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/lseek.cpp:22:27: error: ‘lseek’ is not a member of ‘__llvm_libc_20_0_0_git’
   22 | LLVM_LIBC_FUNCTION(off_t, lseek, (int fd, off_t offset, int whence)) {
      |                           ^~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/common.h:44:52: note: in definition of macro ‘LLVM_LIBC_FUNCTION_IMPL’
   44 |   LLVM_LIBC_FUNCTION_ATTR decltype(LIBC_NAMESPACE::name)                       \
      |                                                    ^~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/unistd/linux/lseek.cpp:22:1: note: in expansion of macro ‘LLVM_LIBC_FUNCTION’

@RossComputerGuy
Copy link
Member Author

Fun, I'll get to fixing these later tonight after work.

michaelrj-google added a commit that referenced this pull request Dec 10, 2024
michaelrj-google added a commit that referenced this pull request Dec 10, 2024
Reverts #118882

Several functions are now missing necessary types in fullbuild, e.g.
`off_t`, `ssize_t`. Reverting for now.
@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 10, 2024

LLVM Buildbot has detected a new failure on builder libc-riscv32-qemu-yocto-fullbuild-dbg running on rv32gc-qemu-system while building libc at step 4 "annotate".

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Performing Test HAVE_PTHREAD_AFFINITY -- success
-- Configuring done (5.8s)
-- Generating done (10.3s)
-- Build files have been written to: /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/29] Building CXX object projects/libc/src/unistd/CMakeFiles/libc.src.unistd.swab.dir/swab.cpp.o
[2/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.sysconf.dir/sysconf.cpp.o
[3/29] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.write.dir/write.cpp.o
FAILED: projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.write.dir/write.cpp.o 
/usr/local/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/projects/libc/src/unistd/linux -I/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/unistd/linux -I/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc -isystem /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/projects/libc/include -mabi=ilp32d -march=rv32imafdc --target=riscv32-unknown-linux-gnu --sysroot=/opt/riscv/sysroot --gcc-toolchain=/opt/riscv -fPIC -fno-semantic-interposition -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 -std=c++17 --target=riscv32-unknown-linux-gnu -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -idirafter=/usr/include -ffixed-point -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 -MD -MT projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.write.dir/write.cpp.o -MF projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.write.dir/write.cpp.o.d -o projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.write.dir/write.cpp.o -c /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/unistd/linux/write.cpp
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/unistd/linux/write.cpp:9:
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/unistd/write.h:17:1: error: unknown type name 'ssize_t'
   17 | ssize_t write(int fd, const void *buf, size_t count);
      | ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/unistd/write.h:17:40: error: unknown type name 'size_t'
   17 | ssize_t write(int fd, const void *buf, size_t count);
      |                                        ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/unistd/linux/write.cpp:20:1: error: definition 'write' cannot also be an alias
   20 | LLVM_LIBC_FUNCTION(ssize_t, write, (int fd, const void *buf, size_t count)) {
      | ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/common.h:54:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
   54 |   LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
      |   ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/common.h:46:41: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
   46 |   decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]];                   \
      |                                         ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/unistd/linux/write.cpp:20:20: error: unknown type name 'ssize_t'; did you mean 'size_t'?
   20 | LLVM_LIBC_FUNCTION(ssize_t, write, (int fd, const void *buf, size_t count)) {
      |                    ^~~~~~~
      |                    size_t
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/common.h:54:27: note: expanded from macro 'LLVM_LIBC_FUNCTION'
   54 |   LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
      |                           ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/common.h:47:3: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
   47 |   type __##name##_impl__ arglist
      |   ^
/usr/local/lib/clang/20/include/__stddef_size_t.h:18:23: note: 'size_t' declared here
   18 | typedef __SIZE_TYPE__ size_t;
      |                       ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/unistd/linux/write.cpp:20:1: error: redefinition of '__write_impl__' as different kind of symbol
   20 | LLVM_LIBC_FUNCTION(ssize_t, write, (int fd, const void *buf, size_t count)) {
      | ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/common.h:54:3: note: expanded from macro 'LLVM_LIBC_FUNCTION'
   54 |   LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)
      |   ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/common.h:47:8: note: expanded from macro 'LLVM_LIBC_FUNCTION_IMPL'
   47 |   type __##name##_impl__ arglist

michaelrj-google pushed a commit that referenced this pull request Dec 17, 2024
Reverts the revert #119295 of #118882 by expanding #118882 with
additional fixes which made CI unhappy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants