-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CXX_RS_EXPORT
, CXX_CPP_EXPORT
macros to cxx.cc
#1025
Open
adetaylor
wants to merge
3
commits into
dtolnay:master
Choose a base branch
from
adetaylor:cxx-export-macro
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In some non-Cargo build configurations, the Rust and C++ side of cxx bindings may end up in different binaries. In some environments, this requires symbols to be explicitly exported using __declspec(dllexport) or similar directives. A previous change added the --cxx-impl-annotations switch on the cxx-gen command line tool, providing the opportunity to specify such directives for dynamically generated parts of the cxx bindings. It turns out to be similarly useful to export symbols from cxx.cc. This change adds a pair of preprocessor symbols which folks can define if they wish to export these symbols too.
No functional changes.
aarongable
pushed a commit
to chromium/chromium
that referenced
this pull request
Mar 17, 2022
This is a version of dtolnay/cxx#1025 backported to the version of cxx which we currently use, plus associated GN changes to trigger that behavior. Purpose of this change: The Rust cxx interop tool produces both Rust and C++ side code for its bindings. It also has fixed C++ code for some of its interop types (e.g. the C++ representation of a Rust string). In most cases, all of this ends up in the same binary, but in debug component builds a test executable may have Rust code which needs to use thse symbols from (for instance) libbase.so. We already previously exported the symbols for dynamically generated bindings code; we now export the symbols for the fixed C++ code too. The patch within this change should be removed if/when dtolnay/cxx#1025 is accepted upstream and we have rolled cxx to include it. Bug: 1287545 Change-Id: I6a0f76fcf6afb36718d5e939c797e7988826bad1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3531194 Reviewed-by: danakj <[email protected]> Commit-Queue: Adrian Taylor <[email protected]> Cr-Commit-Position: refs/heads/main@{#982195}
zeng450026937
pushed a commit
to zeng450026937/build
that referenced
this pull request
Mar 18, 2022
This is a version of dtolnay/cxx#1025 backported to the version of cxx which we currently use, plus associated GN changes to trigger that behavior. Purpose of this change: The Rust cxx interop tool produces both Rust and C++ side code for its bindings. It also has fixed C++ code for some of its interop types (e.g. the C++ representation of a Rust string). In most cases, all of this ends up in the same binary, but in debug component builds a test executable may have Rust code which needs to use thse symbols from (for instance) libbase.so. We already previously exported the symbols for dynamically generated bindings code; we now export the symbols for the fixed C++ code too. The patch within this change should be removed if/when dtolnay/cxx#1025 is accepted upstream and we have rolled cxx to include it. Bug: 1287545 Change-Id: I6a0f76fcf6afb36718d5e939c797e7988826bad1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3531194 Reviewed-by: danakj <[email protected]> Commit-Queue: Adrian Taylor <[email protected]> Cr-Commit-Position: refs/heads/main@{#982195} NOKEYCHECK=True GitOrigin-RevId: 3b659d0f18bf8f08354a8c35a25b51e542eed659
mjfroman
pushed a commit
to mjfroman/moz-libwebrtc-third-party
that referenced
this pull request
Oct 14, 2022
This is a version of dtolnay/cxx#1025 backported to the version of cxx which we currently use, plus associated GN changes to trigger that behavior. Purpose of this change: The Rust cxx interop tool produces both Rust and C++ side code for its bindings. It also has fixed C++ code for some of its interop types (e.g. the C++ representation of a Rust string). In most cases, all of this ends up in the same binary, but in debug component builds a test executable may have Rust code which needs to use thse symbols from (for instance) libbase.so. We already previously exported the symbols for dynamically generated bindings code; we now export the symbols for the fixed C++ code too. The patch within this change should be removed if/when dtolnay/cxx#1025 is accepted upstream and we have rolled cxx to include it. Bug: 1287545 Change-Id: I6a0f76fcf6afb36718d5e939c797e7988826bad1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3531194 Reviewed-by: danakj <[email protected]> Commit-Queue: Adrian Taylor <[email protected]> Cr-Commit-Position: refs/heads/main@{#982195} NOKEYCHECK=True GitOrigin-RevId: 3b659d0f18bf8f08354a8c35a25b51e542eed659
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In some non-Cargo build configurations, the Rust and C++ side of cxx
bindings may end up in different binaries. In some environments,
this requires symbols to be explicitly exported using
__declspec(dllexport)
or similar directives. A previous change addedthe
--cxx-impl-annotations
switch on thecxx-gen
command line tool,providing the opportunity to specify such directives for dynamically
generated parts of the cxx bindings.
It turns out to be similarly useful to export symbols from
cxx.cc
.This change adds a pair of preprocessor symbols which folks can define
if they need to export these symbols too.