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

Roland McGrath via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 4 09:06:41 PST 2022


mcgrathr added inline comments.


================
Comment at: libcxx/src/random.cpp:188
+  // statically linking libc++.
+#  pragma comment(lib, "zircon")
+
----------------
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.



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