[libc-commits] [libc] [libc] Add baremetal printf (PR #94078)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Fri May 31 16:16:41 PDT 2024


================
@@ -0,0 +1,51 @@
+//===-- Implementation of printf for baremetal ------------------*- 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/stdio/printf.h"
+#include "src/__support/arg_list.h"
+#include "src/stdio/printf_core/core_structs.h"
+#include "src/stdio/printf_core/printf_main.h"
+#include "src/stdio/printf_core/writer.h"
+
+#include <stdarg.h>
+
+// This is intended to be provided by the vendor. Name TBD
+extern "C" size_t __llvm_libc_raw_write(const char *s, size_t size);
----------------
jhuber6 wrote:

How is this different from the `write_to_stderr` hook we already use? I guess the size is different. For the GPU I use `FILE` as a simple opaque handle basically, don't know if that's relevant here.

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


More information about the libc-commits mailing list