-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 "objects" support to Rust targets #14031
base: master
Are you sure you want to change the base?
Conversation
@@ -27,7 +27,7 @@ | |||
|
|||
if T.TYPE_CHECKING: | |||
from .. import coredata | |||
from ..build import BuildTarget, DFeatures | |||
from ..build import BuildTarget, BuildTargetTypes, DFeatures |
Check failure
Code scanning / CodeQL
Module-level cyclic import
@@ -27,7 +27,7 @@ | |||
|
|||
if T.TYPE_CHECKING: | |||
from .. import coredata | |||
from ..build import BuildTarget, DFeatures | |||
from ..build import BuildTarget, BuildTargetTypes, DFeatures |
Check failure
Code scanning / CodeQL
Module-level cyclic import
@@ -27,7 +27,7 @@ | |||
|
|||
if T.TYPE_CHECKING: | |||
from .. import coredata | |||
from ..build import BuildTarget, DFeatures | |||
from ..build import BuildTarget, BuildTargetTypes, DFeatures |
Check failure
Code scanning / CodeQL
Module-level cyclic import
@@ -27,6 +28,7 @@ | |||
) | |||
|
|||
if T.TYPE_CHECKING: | |||
from ..build import BuildTarget, BuildTargetTypes |
Check failure
Code scanning / CodeQL
Module-level cyclic import
@@ -27,6 +28,7 @@ | |||
) | |||
|
|||
if T.TYPE_CHECKING: | |||
from ..build import BuildTarget, BuildTargetTypes |
Check failure
Code scanning / CodeQL
Module-level cyclic import
8f3f485
to
20dcac3
Compare
f7a3ed7
to
8ad3774
Compare
8ad3774
to
b29f0c9
Compare
b29f0c9
to
2607998
Compare
2607998
to
7f48312
Compare
Allow reusing the code for doctests. In particular, the sources are shared between the two cases. Signed-off-by: Paolo Bonzini <[email protected]>
All Fortran-specific handling of "objects:" is for now in generate_target(); parts of it can be reused for Rust. Even though Rust is only supported by the ninja backend, move the Fortran handling entirely outside ninjabackend.py: it's not specific to Ninja, it can be implemented easily using inheritance, and it also gets better typing this way. Signed-off-by: Paolo Bonzini <[email protected]>
Because rustc does not support extract_objects, QEMU creates a static library with all the C objects. It then passes this static library as link_whole, together with another static library containing general purpose utility functions which is passed as link_with. However, this is brittle because the two have a circular dependency and they cannot be merged because of the link_whole/link_with difference. While lld seems to have the --start-group/--end-group semantics automatically, ld.bfd can fail if these options are needed. This can cause difference between distros depending on how Rust is packaged (e.g. Ubuntu 22.04 and Debian bookworm seem to use ld.bfd). The simplest solution is for Meson to implement "objects:" properly for Rust. Then QEMU can use the same internal dependency objects that it already has in place for C programs. Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
7f48312
to
cd9e8af
Compare
Because rustc does not support extract_objects, QEMU creates a static library
with all the C objects. It then passes this static library as link_whole,
together with another static library containing general purpose utility
functions which is passed as link_with.
However, this is brittle because the two have a circular dependency and
they cannot be merged because of the link_whole/link_with difference.
While lld seems to have the --start-group/--end-group semantics
automatically, ld.bfd can fail if these options are needed. This can
cause difference between distros depending on how Rust is packaged
(e.g. Ubuntu 22.04 and Debian bookworm seem to use ld.bfd).
The simplest solution is for Meson to implement "objects:" properly
for Rust. Then QEMU can use the same internal dependency objects that it
already has in place for C programs.
To limit conflicts, this PR includes part of #13933.