commit | 1ae04ac33278ec74d464b47512174969dcbe9121 | [log] [tgz] |
---|---|---|
author | Christian Blichmann <cblichmann@google.com> | Mon Nov 07 00:37:13 2022 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Mon Nov 07 00:37:53 2022 -0800 |
tree | eccf3bb2a9babfbcd9f696f5a80180618ae28e10 | |
parent | ce26b55e261307a1526b8074d071bbe63ce5accb [diff] |
clang_generator: Use fully-qualified names, emit in source order When generating headers from libraries that export functions as `extern "C"` but still use namespaces (C-compatible C++ libraries), we want to generate a Sandboxed API that includes fully-qualified namespace names as well. In addition, we want the generated API to have the same source order as the original library. Not only is this less surprising when reading the generated code, it's also more accurate. Previously, we'd bundle all definitions in a namespace and sort those alphabetically, but for code that relies on symbols from another namespace to be available, generation will fail: ```c++ namespace zzz { using entity_count_t = uint64_t; } // namespace zzz namespace sheep_counter { using sheep_count_t = ::zzz::entity_count_t; extern "C" void IncreaseSheepCounter(sheep_count_t increment); } // namespace sheep_counter ``` PiperOrigin-RevId: 486586024 Change-Id: I419c9db8e9cb5b904364b353e2dc3d7f1030fab3
Copyright 2019-2022 Google LLC
The Sandboxed API project (SAPI) makes sandboxing of C/C++ libraries less burdensome: after initial setup of security policies and generation of library interfaces, a stub API is generated, transparently forwarding calls using a custom RPC layer to the real library running inside a sandboxed environment.
Additionally, each SAPI library utilizes a tightly defined security policy, in contrast to the typical sandboxed project, where security policies must cover the total syscall/resource footprint of all its libraries.
Developer documentation is available on the Google Developers site for Sandboxed API.
There is also a Getting Started guide.
If you want to contribute, please read CONTRIBUTING.md and send us pull requests. You can also report bugs or file feature requests.
If you'd like to talk to the developers or get notified about major product updates, you may want to subscribe to our mailing list or sign up with this link.