[libcxx-commits] [PATCH] D116498: [libcxx] Use Fuchsia-native CPRNG for std::random_device

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 4 09:21:18 PST 2022


ldionne added inline comments.


================
Comment at: libcxx/src/random.cpp:188
+  // statically linking libc++.
+#  pragma comment(lib, "zircon")
+
----------------
mcgrathr wrote:
> ldionne wrote:
> > This pragma is magic. It leaves a breadcrumb in the `.o` and the linker will pick it up automatically?
> > 
> > On what platforms does this work?
> Correct.  The pragma syntax comes from MSVC and works there and in Clang on PE-COFF and ELF formats.  The ELF linker magic it uses is only supported by lld last I checked (it emits an extra non-allocated section that other linkers would just ignore).  For Fuchsia, we are fine assuming that current Clang and LLD are the only tools used.
> 
This is pretty awesome, we could use that for mach-o as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116498



More information about the libcxx-commits mailing list