Skip to content

Conversation

@love1angel
Copy link
Contributor

  1. remove unused __default_buffer_alignment
  2. two __try_allocate_from_chunk are same, put it together

This patch refactor some code in monotonic_buffer_resource.

@love1angel love1angel requested a review from a team as a code owner November 22, 2024 01:29
@github-actions
Copy link

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++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Nov 22, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 22, 2024

@llvm/pr-subscribers-libcxx

Author: Peng Xie (love1angel)

Changes
  1. remove unused __default_buffer_alignment
  2. two __try_allocate_from_chunk are same, put it together

This patch refactor some code in monotonic_buffer_resource.


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

2 Files Affected:

  • (modified) libcxx/include/__memory_resource/monotonic_buffer_resource.h (+5-4)
  • (modified) libcxx/src/memory_resource.cpp (+14-19)
diff --git a/libcxx/include/__memory_resource/monotonic_buffer_resource.h b/libcxx/include/__memory_resource/monotonic_buffer_resource.h
index c5a2b556707f6a..d972f4e4d24efd 100644
--- a/libcxx/include/__memory_resource/monotonic_buffer_resource.h
+++ b/libcxx/include/__memory_resource/monotonic_buffer_resource.h
@@ -27,8 +27,8 @@ namespace pmr {
 // [mem.res.monotonic.buffer]
 
 class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI monotonic_buffer_resource : public memory_resource {
-  static const size_t __default_buffer_capacity  = 1024;
-  static const size_t __default_buffer_alignment = 16;
+  static constexpr size_t __default_buffer_capacity = 1024;
+  static constexpr size_t __default_growth_factor   = 2;
 
   struct __chunk_footer {
     __chunk_footer* __next_;
@@ -38,7 +38,6 @@ class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI monotonic_buffer_resour
     _LIBCPP_HIDE_FROM_ABI size_t __allocation_size() {
       return (reinterpret_cast<char*>(this) - __start_) + sizeof(*this);
     }
-    void* __try_allocate_from_chunk(size_t, size_t);
   };
 
   struct __initial_descriptor {
@@ -48,9 +47,11 @@ class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI monotonic_buffer_resour
       char* __end_;
       size_t __size_;
     };
-    void* __try_allocate_from_chunk(size_t, size_t);
   };
 
+  template <typename Chunk>
+  _LIBCPP_HIDE_FROM_ABI void* __try_allocate_from_chunk(Chunk& self, size_t bytes, size_t align);
+
 public:
   _LIBCPP_HIDE_FROM_ABI monotonic_buffer_resource()
       : monotonic_buffer_resource(nullptr, __default_buffer_capacity, get_default_resource()) {}
diff --git a/libcxx/src/memory_resource.cpp b/libcxx/src/memory_resource.cpp
index 0cd575e995c0ff..5500c5c8ebbbd1 100644
--- a/libcxx/src/memory_resource.cpp
+++ b/libcxx/src/memory_resource.cpp
@@ -9,6 +9,7 @@
 #include <cstddef>
 #include <memory>
 #include <memory_resource>
+#include <type_traits>
 
 #if _LIBCPP_HAS_ATOMIC_HEADER
 #  include <atomic>
@@ -429,23 +430,17 @@ static void* align_down(size_t align, size_t size, void*& ptr, size_t& space) {
   return ptr;
 }
 
-void* monotonic_buffer_resource::__initial_descriptor::__try_allocate_from_chunk(size_t bytes, size_t align) {
-  if (!__cur_)
-    return nullptr;
-  void* new_ptr       = static_cast<void*>(__cur_);
-  size_t new_capacity = (__cur_ - __start_);
-  void* aligned_ptr   = align_down(align, bytes, new_ptr, new_capacity);
-  if (aligned_ptr != nullptr)
-    __cur_ = static_cast<char*>(new_ptr);
-  return aligned_ptr;
-}
-
-void* monotonic_buffer_resource::__chunk_footer::__try_allocate_from_chunk(size_t bytes, size_t align) {
-  void* new_ptr       = static_cast<void*>(__cur_);
-  size_t new_capacity = (__cur_ - __start_);
+template <typename Chunk>
+void* monotonic_buffer_resource::__try_allocate_from_chunk(Chunk& self, size_t bytes, size_t align) {
+  if constexpr (std::is_same_v<Chunk, monotonic_buffer_resource::__initial_descriptor>) {
+    if (self.__cur_)
+      return nullptr;
+  }
+  void* new_ptr       = static_cast<void*>(self.__cur_);
+  size_t new_capacity = (self.__cur_ - self.__start_);
   void* aligned_ptr   = align_down(align, bytes, new_ptr, new_capacity);
   if (aligned_ptr != nullptr)
-    __cur_ = static_cast<char*>(new_ptr);
+    self.__cur_ = static_cast<char*>(new_ptr);
   return aligned_ptr;
 }
 
@@ -462,10 +457,10 @@ void* monotonic_buffer_resource::do_allocate(size_t bytes, size_t align) {
     return roundup(newsize, footer_align) + footer_size;
   };
 
-  if (void* result = __initial_.__try_allocate_from_chunk(bytes, align))
+  if (void* result = this->__try_allocate_from_chunk(__initial_, bytes, align))
     return result;
   if (__chunks_ != nullptr) {
-    if (void* result = __chunks_->__try_allocate_from_chunk(bytes, align))
+    if (void* result = this->__try_allocate_from_chunk(*__chunks_, bytes, align))
       return result;
   }
 
@@ -478,7 +473,7 @@ void* monotonic_buffer_resource::do_allocate(size_t bytes, size_t align) {
   size_t previous_capacity = previous_allocation_size();
 
   if (aligned_capacity <= previous_capacity) {
-    size_t newsize   = 2 * (previous_capacity - footer_size);
+    size_t newsize   = __default_growth_factor * (previous_capacity - footer_size);
     aligned_capacity = roundup(newsize, footer_align) + footer_size;
   }
 
@@ -491,7 +486,7 @@ void* monotonic_buffer_resource::do_allocate(size_t bytes, size_t align) {
   footer->__align_       = align;
   __chunks_              = footer;
 
-  return __chunks_->__try_allocate_from_chunk(bytes, align);
+  return __try_allocate_from_chunk(*__chunks_, bytes, align);
 }
 
 } // namespace pmr

@love1angel love1angel force-pushed the peng/refactor_mono branch 3 times, most recently from 1f0adad to 389a848 Compare November 22, 2024 02:23
static const size_t __default_buffer_capacity = 1024;
static const size_t __default_buffer_alignment = 16;
static constexpr size_t __default_buffer_capacity = 1024;
static constexpr size_t __default_growth_factor = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

__default_growth_factor is not used in headers. I guess it would be better to move it to memory_resource.cpp, but I'd ask maintainers first.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, if it's not used from the headers we might as well move it to the .cpp file instead.

@love1angel love1angel force-pushed the peng/refactor_mono branch 2 times, most recently from c19eb95 to b97adc8 Compare November 25, 2024 01:48
Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the patch! I think this makes sense and we'll be able to move this forward, but I left some questions and comments.

static const size_t __default_buffer_capacity = 1024;
static const size_t __default_buffer_alignment = 16;
static constexpr size_t __default_buffer_capacity = 1024;
static constexpr size_t __default_growth_factor = 2;
Copy link
Member

Choose a reason for hiding this comment

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

Yes, if it's not used from the headers we might as well move it to the .cpp file instead.

1. remove unused __default_buffer_alignment
2. two __try_allocate_from_chunk are identical, move to implementation
   file. previous sybmol can be remove from ABI without ABI breaking.

This patch refactor some code in monotonic_buffer_resource.
Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

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

LGTM pending green CI!

Thanks for the refactoring!

@love1angel
Copy link
Contributor Author

@ldionne Hi, morning how can i merge this pr?

Copy link
Contributor

@frederick-vs-ja frederick-vs-ja left a comment

Choose a reason for hiding this comment

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

CI should be fixed now. I'm updating the branch to make CI green.

@frederick-vs-ja frederick-vs-ja merged commit 6285c46 into llvm:main Dec 23, 2024
62 checks passed
@github-actions
Copy link

@love1angel 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 Dec 23, 2024

LLVM Buildbot has detected a new failure on builder fuchsia-x86_64-linux running on fuchsia-debian-64-us-central1-a-1 while building libcxx at step 4 "annotate".

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/fuchsia-linux.py ...' (failure)
...
[222/2768] Copying CXX header __algorithm/inplace_merge.h
[223/2768] Copying CXX header __algorithm/is_heap.h
[224/2768] Copying CXX header __algorithm/is_heap_until.h
[225/2768] Copying CXX header __algorithm/is_partitioned.h
[226/2768] Copying CXX header __algorithm/is_sorted.h
[227/2768] Copying CXX header __algorithm/is_sorted_until.h
[228/2768] Copying CXX header __algorithm/iter_swap.h
[229/2768] Generating header assert.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/hdrgen/yaml/assert.yaml and /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/include/assert.h.def
[230/2768] Building CXX object libc/src/stdlib/baremetal/CMakeFiles/libc.src.stdlib.baremetal.abort.dir/abort.cpp.obj
[231/2768] Building CXX object libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.fini.dir/fini.cpp.obj
FAILED: libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.fini.dir/fini.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ks9vgj4m/bin/clang++ --target=aarch64-none-elf -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ks9vgj4m/include/aarch64-unknown-none-elf --target=aarch64-none-elf -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -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 -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ks9vgj4m/runtimes/runtimes-aarch64-none-elf-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG -std=gnu++17 --target=aarch64-none-elf -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -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 libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.fini.dir/fini.cpp.obj -MF libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.fini.dir/fini.cpp.obj.d -o libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.fini.dir/fini.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/fini.cpp
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/fini.cpp:16:8: error: unknown type name 'uintptr_t'
   16 | extern uintptr_t __fini_array_start[];
      |        ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/fini.cpp:17:8: error: unknown type name 'uintptr_t'
   17 | extern uintptr_t __fini_array_end[];
      |        ^
2 errors generated.
[232/2768] Copying CXX module std.compat/ctime.inc
[233/2768] Copying CXX header __algorithm/is_permutation.h
[234/2768] Copying CXX header __algorithm/lexicographical_compare.h
[235/2768] Generating header errno.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/hdrgen/yaml/errno.yaml and /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/include/errno.h.def
[236/2768] Building CXX object libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.init.dir/init.cpp.obj
FAILED: libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.init.dir/init.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ks9vgj4m/bin/clang++ --target=aarch64-none-elf -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ks9vgj4m/include/aarch64-unknown-none-elf --target=aarch64-none-elf -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -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 -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ks9vgj4m/runtimes/runtimes-aarch64-none-elf-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG -std=gnu++17 --target=aarch64-none-elf -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -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 libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.init.dir/init.cpp.obj -MF libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.init.dir/init.cpp.obj.d -o libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.init.dir/init.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/init.cpp
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/init.cpp:16:8: error: unknown type name 'uintptr_t'
   16 | extern uintptr_t __preinit_array_start[];
      |        ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/init.cpp:17:8: error: unknown type name 'uintptr_t'
   17 | extern uintptr_t __preinit_array_end[];
      |        ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/init.cpp:18:8: error: unknown type name 'uintptr_t'
   18 | extern uintptr_t __init_array_start[];
      |        ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/init.cpp:19:8: error: unknown type name 'uintptr_t'
   19 | extern uintptr_t __init_array_end[];
      |        ^
4 errors generated.
[237/2768] Copying CXX header __algorithm/iterator_operations.h
[238/2768] Copying CXX header __algorithm/min_max_result.h
[239/2768] Copying CXX header __algorithm/ranges_find_end.h
[240/2768] Copying CXX header __algorithm/ranges_find.h
[241/2768] Copying CXX header __algorithm/ranges_find_first_of.h
[242/2768] Copying CXX header __algorithm/ranges_find_if.h
[243/2768] Copying CXX header __algorithm/ranges_find_if_not.h
[244/2768] Copying CXX header __algorithm/ranges_find_last.h
[245/2768] Copying CXX header __algorithm/ranges_fold.h
[246/2768] Building CXX object libc/src/string/CMakeFiles/libc.src.string.strcmp.dir/strcmp.cpp.obj
Step 6 (build) failure: build (failure)
...
[222/2768] Copying CXX header __algorithm/inplace_merge.h
[223/2768] Copying CXX header __algorithm/is_heap.h
[224/2768] Copying CXX header __algorithm/is_heap_until.h
[225/2768] Copying CXX header __algorithm/is_partitioned.h
[226/2768] Copying CXX header __algorithm/is_sorted.h
[227/2768] Copying CXX header __algorithm/is_sorted_until.h
[228/2768] Copying CXX header __algorithm/iter_swap.h
[229/2768] Generating header assert.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/hdrgen/yaml/assert.yaml and /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/include/assert.h.def
[230/2768] Building CXX object libc/src/stdlib/baremetal/CMakeFiles/libc.src.stdlib.baremetal.abort.dir/abort.cpp.obj
[231/2768] Building CXX object libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.fini.dir/fini.cpp.obj
FAILED: libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.fini.dir/fini.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ks9vgj4m/bin/clang++ --target=aarch64-none-elf -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ks9vgj4m/include/aarch64-unknown-none-elf --target=aarch64-none-elf -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -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 -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ks9vgj4m/runtimes/runtimes-aarch64-none-elf-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG -std=gnu++17 --target=aarch64-none-elf -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -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 libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.fini.dir/fini.cpp.obj -MF libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.fini.dir/fini.cpp.obj.d -o libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.fini.dir/fini.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/fini.cpp
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/fini.cpp:16:8: error: unknown type name 'uintptr_t'
   16 | extern uintptr_t __fini_array_start[];
      |        ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/fini.cpp:17:8: error: unknown type name 'uintptr_t'
   17 | extern uintptr_t __fini_array_end[];
      |        ^
2 errors generated.
[232/2768] Copying CXX module std.compat/ctime.inc
[233/2768] Copying CXX header __algorithm/is_permutation.h
[234/2768] Copying CXX header __algorithm/lexicographical_compare.h
[235/2768] Generating header errno.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/hdrgen/yaml/errno.yaml and /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/include/errno.h.def
[236/2768] Building CXX object libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.init.dir/init.cpp.obj
FAILED: libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.init.dir/init.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ks9vgj4m/bin/clang++ --target=aarch64-none-elf -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ks9vgj4m/include/aarch64-unknown-none-elf --target=aarch64-none-elf -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -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 -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ks9vgj4m/runtimes/runtimes-aarch64-none-elf-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG -std=gnu++17 --target=aarch64-none-elf -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_ADD_NULL_CHECKS -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -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 libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.init.dir/init.cpp.obj -MF libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.init.dir/init.cpp.obj.d -o libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.init.dir/init.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/init.cpp
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/init.cpp:16:8: error: unknown type name 'uintptr_t'
   16 | extern uintptr_t __preinit_array_start[];
      |        ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/init.cpp:17:8: error: unknown type name 'uintptr_t'
   17 | extern uintptr_t __preinit_array_end[];
      |        ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/init.cpp:18:8: error: unknown type name 'uintptr_t'
   18 | extern uintptr_t __init_array_start[];
      |        ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/startup/baremetal/init.cpp:19:8: error: unknown type name 'uintptr_t'
   19 | extern uintptr_t __init_array_end[];
      |        ^
4 errors generated.
[237/2768] Copying CXX header __algorithm/iterator_operations.h
[238/2768] Copying CXX header __algorithm/min_max_result.h
[239/2768] Copying CXX header __algorithm/ranges_find_end.h
[240/2768] Copying CXX header __algorithm/ranges_find.h
[241/2768] Copying CXX header __algorithm/ranges_find_first_of.h
[242/2768] Copying CXX header __algorithm/ranges_find_if.h
[243/2768] Copying CXX header __algorithm/ranges_find_if_not.h
[244/2768] Copying CXX header __algorithm/ranges_find_last.h
[245/2768] Copying CXX header __algorithm/ranges_fold.h
[246/2768] Building CXX object libc/src/string/CMakeFiles/libc.src.string.strcmp.dir/strcmp.cpp.obj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants