[libc-commits] [PATCH] D119164: [libc][NFC] Remove all Linux specific code to respective linux/ directories

Alex Brachet via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Feb 8 10:32:51 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG70ae480c8218: [libc][NFC] Remove all Linux specific code to respective linux/ directories (authored by abrachet).
Herald added a project: libc-project.
Herald added a subscriber: libc-commits.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119164/new/

https://reviews.llvm.org/D119164

Files:
  libc/src/assert/CMakeLists.txt
  libc/src/assert/__assert_fail.cpp
  libc/src/stdlib/CMakeLists.txt
  libc/src/stdlib/abort.cpp
  libc/src/stdlib/linux/CMakeLists.txt
  libc/src/stdlib/linux/abort.cpp


Index: libc/src/stdlib/linux/CMakeLists.txt
===================================================================
--- libc/src/stdlib/linux/CMakeLists.txt
+++ libc/src/stdlib/linux/CMakeLists.txt
@@ -9,3 +9,15 @@
     libc.include.stdlib
     libc.src.__support.OSUtil.osutil
 )
+
+# add_entrypoint_object(
+#   abort
+#   SRCS
+#     abort.cpp
+#   HDRS
+#     ../abort.h
+#   DEPENDS
+#     libc.include.stdlib
+#     libc.src.signal.raise
+#     ._Exit
+# )
Index: libc/src/stdlib/CMakeLists.txt
===================================================================
--- libc/src/stdlib/CMakeLists.txt
+++ libc/src/stdlib/CMakeLists.txt
@@ -250,12 +250,7 @@
 
 # add_entrypoint_object(
 #   abort
-#   SRCS
-#     abort.cpp
-#   HDRS
-#     abort.h
+#   ALIAS
 #   DEPENDS
-#     libc.include.stdlib
-#     libc.src.signal.raise
-#     ._Exit
+#     .${LIBC_TARGET_OS}.abort
 # )
Index: libc/src/assert/__assert_fail.cpp
===================================================================
--- libc/src/assert/__assert_fail.cpp
+++ libc/src/assert/__assert_fail.cpp
@@ -6,24 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "src/__support/OSUtil/io.h"
 #include "src/assert/__assert_fail.h"
 #include "src/stdlib/abort.h"
 
-// These includes are temporary.
-#include "include/sys/syscall.h"  // For syscall numbers.
-#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
-
 namespace __llvm_libc {
 
-// This is just a temporary solution to make assert available to internal
-// llvm libc code. In the future writeToStderr will not exist and __assert_fail
-// will call fprintf(stderr, ...).
-static void write_to_stderr(const char *s) {
-  size_t length = 0;
-  for (const char *curr = s; *curr; ++curr, ++length);
-  __llvm_libc::syscall(SYS_write, 2, s, length);
-}
-
 LLVM_LIBC_FUNCTION(void, __assert_fail,
                    (const char *assertion, const char *file, unsigned line,
                     const char *function)) {
Index: libc/src/assert/CMakeLists.txt
===================================================================
--- libc/src/assert/CMakeLists.txt
+++ libc/src/assert/CMakeLists.txt
@@ -6,9 +6,6 @@
     __assert_fail.h
     assert.h
   DEPENDS
-    # These two dependencies are temporary and should be replaced by fprintf
-    # later.
     libc.src.__support.OSUtil.osutil
-    libc.include.sys_syscall
     libc.src.stdlib.abort
 )


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119164.406890.patch
Type: text/x-patch
Size: 2441 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220208/5245f315/attachment.bin>


More information about the libc-commits mailing list