Skip to content

[libc][search] implement posix lfind function #114692

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
merged 12 commits into from
Nov 11, 2024
Merged

[libc][search] implement posix lfind function #114692

merged 12 commits into from
Nov 11, 2024

Conversation

duncpro
Copy link
Contributor

@duncpro duncpro commented Nov 3, 2024

Changes

Also, I'm not sure how to specify a function pointer type in the oldhdrgen spec files. If someone could help with that I'd appreciate it.

Copy link

github-actions bot commented Nov 3, 2024

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot llvmbot added the libc label Nov 3, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 3, 2024

@llvm/pr-subscribers-libc

Author: Duncan (duncpro)

Changes

Changes

Also, I'm not sure how to specify a function pointer type in the oldhdrgen spec files. If someone could help with that I'd appreciate it.


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

17 Files Affected:

  • (modified) libc/config/baremetal/arm/entrypoints.txt (+3)
  • (modified) libc/config/baremetal/riscv/entrypoints.txt (+3)
  • (modified) libc/config/darwin/arm/entrypoints.txt (+3)
  • (modified) libc/config/darwin/x86_64/entrypoints.txt (+3)
  • (modified) libc/config/linux/aarch64/entrypoints.txt (+1)
  • (modified) libc/config/linux/arm/entrypoints.txt (+3)
  • (modified) libc/config/linux/riscv/entrypoints.txt (+1)
  • (modified) libc/config/linux/x86_64/entrypoints.txt (+1)
  • (modified) libc/config/windows/entrypoints.txt (+3)
  • (modified) libc/docs/libc_search.rst (+1-1)
  • (modified) libc/newhdrgen/yaml/search.yaml (+10)
  • (modified) libc/spec/posix.td (+11)
  • (modified) libc/src/search/CMakeLists.txt (+11)
  • (added) libc/src/search/lfind.cpp (+29)
  • (added) libc/src/search/lfind.h (+20)
  • (modified) libc/test/src/search/CMakeLists.txt (+10)
  • (added) libc/test/src/search/lfind_test.cpp (+46)
diff --git a/libc/config/baremetal/arm/entrypoints.txt b/libc/config/baremetal/arm/entrypoints.txt
index 68030f7f1775b5..ae71ea9c327b63 100644
--- a/libc/config/baremetal/arm/entrypoints.txt
+++ b/libc/config/baremetal/arm/entrypoints.txt
@@ -26,6 +26,9 @@ set(TARGET_LIBC_ENTRYPOINTS
     # errno.h entrypoints
     libc.src.errno.errno
 
+	# search.h entrypoints
+	libc.src.search.lfind
+
     # setjmp.h entrypoints
     libc.src.setjmp.longjmp
     libc.src.setjmp.setjmp
diff --git a/libc/config/baremetal/riscv/entrypoints.txt b/libc/config/baremetal/riscv/entrypoints.txt
index 5894b591072ef0..6106ae1b8b234e 100644
--- a/libc/config/baremetal/riscv/entrypoints.txt
+++ b/libc/config/baremetal/riscv/entrypoints.txt
@@ -26,6 +26,9 @@ set(TARGET_LIBC_ENTRYPOINTS
     # errno.h entrypoints
     libc.src.errno.errno
 
+	# search.h entrypoints
+	libc.src.search.lfind
+	
     # string.h entrypoints
     libc.src.string.bcmp
     libc.src.string.bcopy
diff --git a/libc/config/darwin/arm/entrypoints.txt b/libc/config/darwin/arm/entrypoints.txt
index 2d5dbeff485747..cc730a7849c714 100644
--- a/libc/config/darwin/arm/entrypoints.txt
+++ b/libc/config/darwin/arm/entrypoints.txt
@@ -20,6 +20,9 @@ set(TARGET_LIBC_ENTRYPOINTS
     # errno.h entrypoints
     libc.src.errno.errno
 
+	# search.h entrypoints
+	libc.src.search.lfind    
+
     # string.h entrypoints
     libc.src.string.bcmp
     libc.src.string.bcopy
diff --git a/libc/config/darwin/x86_64/entrypoints.txt b/libc/config/darwin/x86_64/entrypoints.txt
index 49c19571ac4192..15b099f7890d2f 100644
--- a/libc/config/darwin/x86_64/entrypoints.txt
+++ b/libc/config/darwin/x86_64/entrypoints.txt
@@ -17,6 +17,9 @@ set(TARGET_LIBC_ENTRYPOINTS
     libc.src.ctype.tolower
     libc.src.ctype.toupper
 
+	# search.h entrypoints
+	libc.src.search.lfind    
+
     # string.h entrypoints
     libc.src.string.bcmp
     libc.src.string.bzero
diff --git a/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt
index b3f94a581c8ad9..7ed1386c05b09d 100644
--- a/libc/config/linux/aarch64/entrypoints.txt
+++ b/libc/config/linux/aarch64/entrypoints.txt
@@ -942,6 +942,7 @@ if(LLVM_LIBC_FULL_BUILD)
     libc.src.search.hsearch
     libc.src.search.hsearch_r
     libc.src.search.insque
+    libc.src.search.lfind
     libc.src.search.remque
 
     # threads.h entrypoints
diff --git a/libc/config/linux/arm/entrypoints.txt b/libc/config/linux/arm/entrypoints.txt
index 2ddb7aeefe48ec..f5ae0bbcb12f69 100644
--- a/libc/config/linux/arm/entrypoints.txt
+++ b/libc/config/linux/arm/entrypoints.txt
@@ -20,6 +20,9 @@ set(TARGET_LIBC_ENTRYPOINTS
     # errno.h entrypoints
     libc.src.errno.errno
 
+	# search.h entrypoints
+	libc.src.search.lfind    
+
     # string.h entrypoints
     libc.src.string.bcmp
     libc.src.string.bcopy
diff --git a/libc/config/linux/riscv/entrypoints.txt b/libc/config/linux/riscv/entrypoints.txt
index 5c09edf7cfb266..eef4592e27a85f 100644
--- a/libc/config/linux/riscv/entrypoints.txt
+++ b/libc/config/linux/riscv/entrypoints.txt
@@ -872,6 +872,7 @@ if(LLVM_LIBC_FULL_BUILD)
     libc.src.search.hsearch
     libc.src.search.hsearch_r
     libc.src.search.insque
+    libc.src.search.lfind
     libc.src.search.remque
 
     # threads.h entrypoints
diff --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt
index a2fb97d04584d5..ea9e5770fe75c7 100644
--- a/libc/config/linux/x86_64/entrypoints.txt
+++ b/libc/config/linux/x86_64/entrypoints.txt
@@ -1005,6 +1005,7 @@ if(LLVM_LIBC_FULL_BUILD)
     libc.src.search.hsearch
     libc.src.search.hsearch_r
     libc.src.search.insque
+    libc.src.search.lfind
     libc.src.search.remque
 
     # threads.h entrypoints
diff --git a/libc/config/windows/entrypoints.txt b/libc/config/windows/entrypoints.txt
index 8f0b50bcc83ea2..679ef981c90afa 100644
--- a/libc/config/windows/entrypoints.txt
+++ b/libc/config/windows/entrypoints.txt
@@ -17,6 +17,9 @@ set(TARGET_LIBC_ENTRYPOINTS
     libc.src.ctype.tolower
     libc.src.ctype.toupper
 
+	# search.h entrypoints
+	libc.src.search.lfind
+
     # string.h entrypoints
     libc.src.string.bcmp
     libc.src.string.bcopy
diff --git a/libc/docs/libc_search.rst b/libc/docs/libc_search.rst
index 4a7ee288dd43e8..774622d1e66c3f 100644
--- a/libc/docs/libc_search.rst
+++ b/libc/docs/libc_search.rst
@@ -42,7 +42,7 @@ hcreate                      |check|
 hdestroy                     |check|
 hsearch                      |check|
 insque                       |check|
-lfind
+lfind                        |check|
 lsearch
 remque                       |check|
 tdelete
diff --git a/libc/newhdrgen/yaml/search.yaml b/libc/newhdrgen/yaml/search.yaml
index 37d2650bcf0514..af99719c4df958 100644
--- a/libc/newhdrgen/yaml/search.yaml
+++ b/libc/newhdrgen/yaml/search.yaml
@@ -57,3 +57,13 @@ functions:
     return_type: void
     arguments:
       - type: void *
+  - name: lfind
+    standards:
+      - POSIX
+    return_type: void *
+    arguments:
+      - type: void *
+      - type: void *
+      - type: size_t *
+      - type: size_t
+      - type: int(*compar)(const void *, const void *)
diff --git a/libc/spec/posix.td b/libc/spec/posix.td
index beede79a38ec24..ea30b5c42b0e74 100644
--- a/libc/spec/posix.td
+++ b/libc/spec/posix.td
@@ -1618,6 +1618,17 @@ def POSIX : StandardSpec<"POSIX"> {
                 ArgSpec<VoidPtr>
             ]
         >,
+        FunctionSpec<
+            "lfind",
+            RetValSpec<VoidPtr>,
+            [
+                ArgSpec<VoidPtr>,
+                ArgSpec<VoidPtr>,
+                ArgSpec<SizeTPtr>,
+                ArgSpec<SizeTType>,
+                // TODO: Unsure how to specify int(*compar)(void *, void *)
+            ]
+        >
     ]
   >;
 
diff --git a/libc/src/search/CMakeLists.txt b/libc/src/search/CMakeLists.txt
index 46ad3e33c02fa9..0490b5939ab0f8 100644
--- a/libc/src/search/CMakeLists.txt
+++ b/libc/src/search/CMakeLists.txt
@@ -98,3 +98,14 @@ add_entrypoint_object(
     libc.include.search
     libc.src.__support.intrusive_list
 )
+
+add_entrypoint_object(
+  lfind
+  SRCS
+    lfind.cpp
+  HDRS
+    lfind.h
+  DEPENDS
+    libc.include.search
+    libc.src.__support.CPP.cstddef
+)
diff --git a/libc/src/search/lfind.cpp b/libc/src/search/lfind.cpp
new file mode 100644
index 00000000000000..debf38de9f1000
--- /dev/null
+++ b/libc/src/search/lfind.cpp
@@ -0,0 +1,29 @@
+//===-- Implementation of lfind   -------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/search/lfind.h"
+#include "src/__support/CPP/cstddef.h" // cpp::byte
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+LLVM_LIBC_FUNCTION(void *, lfind,
+                   (void *key, void *base, size_t *nmemb, size_t size,
+                    int (*compar)(void *, void *))) {
+  cpp::byte *next = reinterpret_cast<cpp::byte *>(base);
+  cpp::byte *end = next + (*nmemb * size);
+  while (next < end) {
+    if (compar(key, next) == 0) {
+      return next;
+    }
+    next += size;
+  }
+  return nullptr;
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/search/lfind.h b/libc/src/search/lfind.h
new file mode 100644
index 00000000000000..3e0063f8e19f10
--- /dev/null
+++ b/libc/src/search/lfind.h
@@ -0,0 +1,20 @@
+//===-- Implementation header for lfind -------------------------*- C++ -*-===//
+//
+// 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_SRC_SEARCH_LFIND_H
+#define LLVM_LIBC_SRC_SEARCH_LFIND_H
+
+#include "src/__support/macros/config.h"
+#include <search.h> // size_t
+
+namespace LIBC_NAMESPACE_DECL {
+void *lfind(void *key, void *base, size_t *nmemb, size_t size,
+            int (*compar)(void *, void *));
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC_SEARCH_LFIND_H
diff --git a/libc/test/src/search/CMakeLists.txt b/libc/test/src/search/CMakeLists.txt
index 8a33edc4293ab2..a1f9aac2094c9b 100644
--- a/libc/test/src/search/CMakeLists.txt
+++ b/libc/test/src/search/CMakeLists.txt
@@ -25,3 +25,13 @@ add_libc_unittest(
     libc.src.search.insque
     libc.src.search.remque
 )
+
+add_libc_unittest(
+  lfind_test
+  SUITE
+    libc_search_unittests
+  SRCS
+    lfind_test.cpp
+  DEPENDS
+    libc.src.search.lfind
+)
diff --git a/libc/test/src/search/lfind_test.cpp b/libc/test/src/search/lfind_test.cpp
new file mode 100644
index 00000000000000..d434194444c330
--- /dev/null
+++ b/libc/test/src/search/lfind_test.cpp
@@ -0,0 +1,46 @@
+//===-- Unittests for lfind -----------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/search/lfind.h"
+#include "test/UnitTest/Test.h"
+
+int compar(void *a, void *b) {
+  return *reinterpret_cast<int *>(a) - *reinterpret_cast<int *>(b);
+}
+
+TEST(LlvmLibcLfindTest, SearchHead) {
+  int list[3] = {1, 2, 3};
+  size_t len = 3;
+  int key = 1;
+  void *ret = LIBC_NAMESPACE::lfind(&key, list, &len, sizeof(int), compar);
+  ASSERT_TRUE(ret == &list[0]);
+}
+
+TEST(LlvmLibcLfindTest, SearchMiddle) {
+  int list[3] = {1, 2, 3};
+  size_t len = 3;
+  int key = 2;
+  void *ret = LIBC_NAMESPACE::lfind(&key, list, &len, sizeof(int), compar);
+  ASSERT_TRUE(ret == &list[1]);
+}
+
+TEST(LlvmLibcLfindTest, SearchTail) {
+  int list[3] = {1, 2, 3};
+  size_t len = 3;
+  int key = 3;
+  void *ret = LIBC_NAMESPACE::lfind(&key, list, &len, sizeof(int), compar);
+  ASSERT_TRUE(ret == &list[2]);
+}
+
+TEST(LlvmLibcLfindTest, SearchNonExistent) {
+  int list[3] = {1, 2, 3};
+  size_t len = 3;
+  int key = 5;
+  void *ret = LIBC_NAMESPACE::lfind(&key, list, &len, sizeof(int), compar);
+  ASSERT_TRUE(ret == nullptr);
+}

@nickdesaulniers
Copy link
Member

Thanks for the patch!

Co-authored-by: Nick Desaulniers <[email protected]>
@duncpro
Copy link
Contributor Author

duncpro commented Nov 8, 2024

@nickdesaulniers Can you merge this for me?

@nickdesaulniers nickdesaulniers merged commit 396ed9c into llvm:main Nov 11, 2024
8 checks passed
Copy link

@duncpro Congratulations on having your first Pull Request (PR) merged into the LLVM Project!

Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail here.

If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are working as expected, well done!

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 11, 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/10144

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)
...
[448/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.pathconf_utils.dir/pathconf_utils.cpp.o
[449/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.pread.dir/pread.cpp.o
[450/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.pwrite.dir/pwrite.cpp.o
[451/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.lseek.dir/lseek.cpp.o
[452/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.readlinkat.dir/readlinkat.cpp.o
[453/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.read.dir/read.cpp.o
[454/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.__llvm_libc_syscall.dir/syscall.cpp.o
[455/542] Building CXX object projects/libc/src/unistd/CMakeFiles/libc.src.unistd.getopt.dir/getopt.cpp.o
[456/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.symlink.dir/symlink.cpp.o
[457/542] Building CXX object projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o
FAILED: projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o 
/usr/bin/g++ -DLIBC_NAMESPACE=__llvm_libc_19_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/search -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/search -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/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o -MF projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o.d -o projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.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/search/insque.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/search/insque.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/search/insque.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/projects/libc/include/search.h:36:60: error: ‘__lsearchcompare_t’ has not been declared
   36 | void * lfind(const void *, const void *, size_t *, size_t, __lsearchcompare_t) __NOEXCEPT;
      |                                                            ^~~~~~~~~~~~~~~~~~
[458/542] Building CXX object projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o
FAILED: projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o 
/usr/bin/g++ -DLIBC_NAMESPACE=__llvm_libc_19_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/search -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/search -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/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o -MF projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o.d -o projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.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/search/remque.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/search/remque.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/search/remque.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/projects/libc/include/search.h:36:60: error: ‘__lsearchcompare_t’ has not been declared
   36 | void * lfind(const void *, const void *, size_t *, size_t, __lsearchcompare_t) __NOEXCEPT;
      |                                                            ^~~~~~~~~~~~~~~~~~
[459/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.pathconf.dir/pathconf.cpp.o
[460/542] Building CXX object projects/libc/src/network/CMakeFiles/libc.src.network.htons.dir/htons.cpp.o
[461/542] Building CXX object projects/libc/src/network/CMakeFiles/libc.src.network.ntohl.dir/ntohl.cpp.o
[462/542] Building CXX object projects/libc/src/network/CMakeFiles/libc.src.network.ntohs.dir/ntohs.cpp.o
[463/542] Building CXX object projects/libc/src/network/CMakeFiles/libc.src.network.htonl.dir/htonl.cpp.o
[464/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.symlinkat.dir/symlinkat.cpp.o
[465/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.unlink.dir/unlink.cpp.o
[466/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.truncate.dir/truncate.cpp.o
[467/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.unlinkat.dir/unlinkat.cpp.o
[468/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.write.dir/write.cpp.o
[469/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.kill.dir/kill.cpp.o
[470/542] Building CXX object projects/libc/src/compiler/generic/CMakeFiles/libc.src.compiler.generic.__stack_chk_fail.dir/__stack_chk_fail.cpp.o
[471/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigaction.dir/sigaction.cpp.o
[472/542] Building CXX object projects/libc/src/string/CMakeFiles/libc.src.string.bcmp.dir/bcmp.cpp.o
[473/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.__restore.dir/__restore.cpp.o
[474/542] Building CXX object projects/libc/src/search/CMakeFiles/libc.src.search.lfind.dir/lfind.cpp.o
[475/542] Building CXX object projects/libc/src/assert/generic/CMakeFiles/libc.src.assert.generic.__assert_fail.dir/__assert_fail.cpp.o
[476/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.raise.dir/raise.cpp.o
[477/542] Building CXX object projects/libc/src/string/CMakeFiles/libc.src.string.memcpy.dir/memcpy.cpp.o
[478/542] Building CXX object projects/libc/src/string/CMakeFiles/libc.src.string.bzero.dir/bzero.cpp.o
[479/542] Building CXX object projects/libc/src/string/CMakeFiles/libc.src.string.memcmp.dir/memcmp.cpp.o
[480/542] Building CXX object projects/libc/src/string/CMakeFiles/libc.src.string.memset.dir/memset.cpp.o
[481/542] Building CXX object projects/libc/src/sys/mman/linux/CMakeFiles/libc.src.sys.mman.linux.shm_open.dir/shm_open.cpp.o
[482/542] Building CXX object projects/libc/src/sys/mman/linux/CMakeFiles/libc.src.sys.mman.linux.shm_unlink.dir/shm_unlink.cpp.o
Step 6 (build libc) failure: build libc (failure)
...
[448/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.pathconf_utils.dir/pathconf_utils.cpp.o
[449/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.pread.dir/pread.cpp.o
[450/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.pwrite.dir/pwrite.cpp.o
[451/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.lseek.dir/lseek.cpp.o
[452/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.readlinkat.dir/readlinkat.cpp.o
[453/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.read.dir/read.cpp.o
[454/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.__llvm_libc_syscall.dir/syscall.cpp.o
[455/542] Building CXX object projects/libc/src/unistd/CMakeFiles/libc.src.unistd.getopt.dir/getopt.cpp.o
[456/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.symlink.dir/symlink.cpp.o
[457/542] Building CXX object projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o
FAILED: projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o 
/usr/bin/g++ -DLIBC_NAMESPACE=__llvm_libc_19_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/search -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/search -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/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o -MF projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o.d -o projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.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/search/insque.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/search/insque.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/search/insque.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/projects/libc/include/search.h:36:60: error: ‘__lsearchcompare_t’ has not been declared
   36 | void * lfind(const void *, const void *, size_t *, size_t, __lsearchcompare_t) __NOEXCEPT;
      |                                                            ^~~~~~~~~~~~~~~~~~
[458/542] Building CXX object projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o
FAILED: projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o 
/usr/bin/g++ -DLIBC_NAMESPACE=__llvm_libc_19_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/search -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/search -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/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o -MF projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o.d -o projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.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/search/remque.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/search/remque.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/search/remque.cpp:9:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/projects/libc/include/search.h:36:60: error: ‘__lsearchcompare_t’ has not been declared
   36 | void * lfind(const void *, const void *, size_t *, size_t, __lsearchcompare_t) __NOEXCEPT;
      |                                                            ^~~~~~~~~~~~~~~~~~
[459/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.pathconf.dir/pathconf.cpp.o
[460/542] Building CXX object projects/libc/src/network/CMakeFiles/libc.src.network.htons.dir/htons.cpp.o
[461/542] Building CXX object projects/libc/src/network/CMakeFiles/libc.src.network.ntohl.dir/ntohl.cpp.o
[462/542] Building CXX object projects/libc/src/network/CMakeFiles/libc.src.network.ntohs.dir/ntohs.cpp.o
[463/542] Building CXX object projects/libc/src/network/CMakeFiles/libc.src.network.htonl.dir/htonl.cpp.o
[464/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.symlinkat.dir/symlinkat.cpp.o
[465/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.unlink.dir/unlink.cpp.o
[466/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.truncate.dir/truncate.cpp.o
[467/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.unlinkat.dir/unlinkat.cpp.o
[468/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.write.dir/write.cpp.o
[469/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.kill.dir/kill.cpp.o
[470/542] Building CXX object projects/libc/src/compiler/generic/CMakeFiles/libc.src.compiler.generic.__stack_chk_fail.dir/__stack_chk_fail.cpp.o
[471/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigaction.dir/sigaction.cpp.o
[472/542] Building CXX object projects/libc/src/string/CMakeFiles/libc.src.string.bcmp.dir/bcmp.cpp.o
[473/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.__restore.dir/__restore.cpp.o
[474/542] Building CXX object projects/libc/src/search/CMakeFiles/libc.src.search.lfind.dir/lfind.cpp.o
[475/542] Building CXX object projects/libc/src/assert/generic/CMakeFiles/libc.src.assert.generic.__assert_fail.dir/__assert_fail.cpp.o
[476/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.raise.dir/raise.cpp.o
[477/542] Building CXX object projects/libc/src/string/CMakeFiles/libc.src.string.memcpy.dir/memcpy.cpp.o
[478/542] Building CXX object projects/libc/src/string/CMakeFiles/libc.src.string.bzero.dir/bzero.cpp.o
[479/542] Building CXX object projects/libc/src/string/CMakeFiles/libc.src.string.memcmp.dir/memcmp.cpp.o
[480/542] Building CXX object projects/libc/src/string/CMakeFiles/libc.src.string.memset.dir/memset.cpp.o
[481/542] Building CXX object projects/libc/src/sys/mman/linux/CMakeFiles/libc.src.sys.mman.linux.shm_open.dir/shm_open.cpp.o
[482/542] Building CXX object projects/libc/src/sys/mman/linux/CMakeFiles/libc.src.sys.mman.linux.shm_unlink.dir/shm_unlink.cpp.o

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 11, 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/10028

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)
...
[465/542] Building CXX object projects/libc/src/network/CMakeFiles/libc.src.network.htons.dir/htons.cpp.o
[466/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.pwrite.dir/pwrite.cpp.o
[467/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.truncate.dir/truncate.cpp.o
[468/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.unlink.dir/unlink.cpp.o
[469/542] Building CXX object projects/libc/src/network/CMakeFiles/libc.src.network.ntohl.dir/ntohl.cpp.o
[470/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.write.dir/write.cpp.o
[471/542] Building CXX object projects/libc/src/network/CMakeFiles/libc.src.network.ntohs.dir/ntohs.cpp.o
[472/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.unlinkat.dir/unlinkat.cpp.o
[473/542] Building CXX object projects/libc/src/compiler/generic/CMakeFiles/libc.src.compiler.generic.__stack_chk_fail.dir/__stack_chk_fail.cpp.o
[474/542] Building CXX object projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o
FAILED: projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_19_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/search -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/search -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/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o -MF projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o.d -o projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/search/remque.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/search/remque.cpp:9:
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/search/remque.h:13:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build/projects/libc/include/search.h:36:60: error: unknown type name '__lsearchcompare_t'
void * lfind(const void *, const void *, size_t *, size_t, __lsearchcompare_t) __NOEXCEPT;
                                                           ^
1 error generated.
[475/542] Building CXX object projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o
FAILED: projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_19_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/search -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/search -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/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o -MF projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o.d -o projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/search/insque.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/search/insque.cpp:9:
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/search/insque.h:13:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build/projects/libc/include/search.h:36:60: error: unknown type name '__lsearchcompare_t'
void * lfind(const void *, const void *, size_t *, size_t, __lsearchcompare_t) __NOEXCEPT;
                                                           ^
1 error generated.
[476/542] Building CXX object projects/libc/src/spawn/CMakeFiles/libc.src.spawn.posix_spawn_file_actions_init.dir/posix_spawn_file_actions_init.cpp.o
[477/542] Building CXX object projects/libc/src/spawn/CMakeFiles/libc.src.spawn.posix_spawn_file_actions_adddup2.dir/posix_spawn_file_actions_adddup2.cpp.o
[478/542] Building CXX object projects/libc/src/spawn/CMakeFiles/libc.src.spawn.posix_spawn_file_actions_destroy.dir/posix_spawn_file_actions_destroy.cpp.o
[479/542] Building CXX object projects/libc/src/spawn/CMakeFiles/libc.src.spawn.posix_spawn_file_actions_addclose.dir/posix_spawn_file_actions_addclose.cpp.o
[480/542] Building CXX object projects/libc/src/spawn/CMakeFiles/libc.src.spawn.posix_spawn_file_actions_addopen.dir/posix_spawn_file_actions_addopen.cpp.o
[481/542] Building CXX object projects/libc/src/assert/generic/CMakeFiles/libc.src.assert.generic.__assert_fail.dir/__assert_fail.cpp.o
[482/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.kill.dir/kill.cpp.o
[483/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigdelset.dir/sigdelset.cpp.o
[484/542] Building CXX object projects/libc/src/search/CMakeFiles/libc.src.search.lfind.dir/lfind.cpp.o
[485/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.__restore.dir/__restore.cpp.o
[486/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigprocmask.dir/sigprocmask.cpp.o
[487/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.raise.dir/raise.cpp.o
[488/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigemptyset.dir/sigemptyset.cpp.o
[489/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigaddset.dir/sigaddset.cpp.o
[490/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigfillset.dir/sigfillset.cpp.o
[491/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigaction.dir/sigaction.cpp.o
[492/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigaltstack.dir/sigaltstack.cpp.o
[493/542] Building CXX object projects/libc/src/threads/CMakeFiles/libc.src.threads.call_once.dir/call_once.cpp.o
[494/542] Building CXX object projects/libc/src/threads/CMakeFiles/libc.src.threads.thrd_detach.dir/thrd_detach.cpp.o
[495/542] Building CXX object projects/libc/src/spawn/linux/CMakeFiles/libc.src.spawn.linux.posix_spawn.dir/posix_spawn.cpp.o
[496/542] Building CXX object projects/libc/src/threads/CMakeFiles/libc.src.threads.thrd_create.dir/thrd_create.cpp.o
[497/542] Building CXX object projects/libc/src/threads/CMakeFiles/libc.src.threads.thrd_join.dir/thrd_join.cpp.o
Step 6 (build libc) failure: build libc (failure)
...
[465/542] Building CXX object projects/libc/src/network/CMakeFiles/libc.src.network.htons.dir/htons.cpp.o
[466/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.pwrite.dir/pwrite.cpp.o
[467/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.truncate.dir/truncate.cpp.o
[468/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.unlink.dir/unlink.cpp.o
[469/542] Building CXX object projects/libc/src/network/CMakeFiles/libc.src.network.ntohl.dir/ntohl.cpp.o
[470/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.write.dir/write.cpp.o
[471/542] Building CXX object projects/libc/src/network/CMakeFiles/libc.src.network.ntohs.dir/ntohs.cpp.o
[472/542] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.unlinkat.dir/unlinkat.cpp.o
[473/542] Building CXX object projects/libc/src/compiler/generic/CMakeFiles/libc.src.compiler.generic.__stack_chk_fail.dir/__stack_chk_fail.cpp.o
[474/542] Building CXX object projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o
FAILED: projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_19_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/search -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/search -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/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o -MF projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o.d -o projects/libc/src/search/CMakeFiles/libc.src.search.remque.dir/remque.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/search/remque.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/search/remque.cpp:9:
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/search/remque.h:13:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build/projects/libc/include/search.h:36:60: error: unknown type name '__lsearchcompare_t'
void * lfind(const void *, const void *, size_t *, size_t, __lsearchcompare_t) __NOEXCEPT;
                                                           ^
1 error generated.
[475/542] Building CXX object projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o
FAILED: projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_19_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/search -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/search -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/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o -MF projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o.d -o projects/libc/src/search/CMakeFiles/libc.src.search.insque.dir/insque.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/src/search/insque.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/search/insque.cpp:9:
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/search/insque.h:13:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build/projects/libc/include/search.h:36:60: error: unknown type name '__lsearchcompare_t'
void * lfind(const void *, const void *, size_t *, size_t, __lsearchcompare_t) __NOEXCEPT;
                                                           ^
1 error generated.
[476/542] Building CXX object projects/libc/src/spawn/CMakeFiles/libc.src.spawn.posix_spawn_file_actions_init.dir/posix_spawn_file_actions_init.cpp.o
[477/542] Building CXX object projects/libc/src/spawn/CMakeFiles/libc.src.spawn.posix_spawn_file_actions_adddup2.dir/posix_spawn_file_actions_adddup2.cpp.o
[478/542] Building CXX object projects/libc/src/spawn/CMakeFiles/libc.src.spawn.posix_spawn_file_actions_destroy.dir/posix_spawn_file_actions_destroy.cpp.o
[479/542] Building CXX object projects/libc/src/spawn/CMakeFiles/libc.src.spawn.posix_spawn_file_actions_addclose.dir/posix_spawn_file_actions_addclose.cpp.o
[480/542] Building CXX object projects/libc/src/spawn/CMakeFiles/libc.src.spawn.posix_spawn_file_actions_addopen.dir/posix_spawn_file_actions_addopen.cpp.o
[481/542] Building CXX object projects/libc/src/assert/generic/CMakeFiles/libc.src.assert.generic.__assert_fail.dir/__assert_fail.cpp.o
[482/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.kill.dir/kill.cpp.o
[483/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigdelset.dir/sigdelset.cpp.o
[484/542] Building CXX object projects/libc/src/search/CMakeFiles/libc.src.search.lfind.dir/lfind.cpp.o
[485/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.__restore.dir/__restore.cpp.o
[486/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigprocmask.dir/sigprocmask.cpp.o
[487/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.raise.dir/raise.cpp.o
[488/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigemptyset.dir/sigemptyset.cpp.o
[489/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigaddset.dir/sigaddset.cpp.o
[490/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigfillset.dir/sigfillset.cpp.o
[491/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigaction.dir/sigaction.cpp.o
[492/542] Building CXX object projects/libc/src/signal/linux/CMakeFiles/libc.src.signal.linux.sigaltstack.dir/sigaltstack.cpp.o
[493/542] Building CXX object projects/libc/src/threads/CMakeFiles/libc.src.threads.call_once.dir/call_once.cpp.o
[494/542] Building CXX object projects/libc/src/threads/CMakeFiles/libc.src.threads.thrd_detach.dir/thrd_detach.cpp.o
[495/542] Building CXX object projects/libc/src/spawn/linux/CMakeFiles/libc.src.spawn.linux.posix_spawn.dir/posix_spawn.cpp.o
[496/542] Building CXX object projects/libc/src/threads/CMakeFiles/libc.src.threads.thrd_create.dir/thrd_create.cpp.o
[497/542] Building CXX object projects/libc/src/threads/CMakeFiles/libc.src.threads.thrd_join.dir/thrd_join.cpp.o

nickdesaulniers added a commit to nickdesaulniers/llvm-project that referenced this pull request Nov 11, 2024
nickdesaulniers added a commit that referenced this pull request Nov 11, 2024
nickdesaulniers added a commit to nickdesaulniers/llvm-project that referenced this pull request Nov 11, 2024
- move arm entrypoint to fullbuild only
- remove baremetal entrypoints; we avoid POSIX on baremetal
- remove darwin/arm and windows entrypoints since these are untested

Fixes: llvm#114692
nickdesaulniers added a commit that referenced this pull request Nov 11, 2024
- move arm entrypoint to fullbuild only
- remove baremetal entrypoints; we avoid POSIX on baremetal
- remove darwin/arm and windows entrypoints since these are untested

Fixes: #114692
Groverkss pushed a commit to iree-org/llvm-project that referenced this pull request Nov 15, 2024
# Changes
- Implement the POSIX
[`lfind`](https://man7.org/linux/man-pages/man3/lsearch.3.html)
function.

- Put a checkmark in the [posix support table
docs](https://libc.llvm.org/libc_search.html) next to `lfind`.
Groverkss pushed a commit to iree-org/llvm-project that referenced this pull request Nov 15, 2024
Groverkss pushed a commit to iree-org/llvm-project that referenced this pull request Nov 15, 2024
- move arm entrypoint to fullbuild only
- remove baremetal entrypoints; we avoid POSIX on baremetal
- remove darwin/arm and windows entrypoints since these are untested

Fixes: llvm#114692
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.

4 participants