-
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 start-group/end-group flags when linking a program with rustc #14026
base: master
Are you sure you want to change the base?
Conversation
from .. import options | ||
from ..linkers.linkers import GnuLikeDynamicLinkerMixin, SolarisDynamicLinker, CompCertDynamicLinker |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
'GnuLikeDynamicLinkerMixin' may not be defined if module
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
'GnuLikeDynamicLinkerMixin' may not be defined if module
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
'GnuLikeDynamicLinkerMixin' may not be defined if module
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
'GnuLikeDynamicLinkerMixin' may not be defined if module
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
'GnuLikeDynamicLinkerMixin' may not be defined if module
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
from .. import options | ||
from ..linkers.linkers import GnuLikeDynamicLinkerMixin, SolarisDynamicLinker, CompCertDynamicLinker |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
'SolarisDynamicLinker' may not be defined if module
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
'SolarisDynamicLinker' may not be defined if module
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
'SolarisDynamicLinker' may not be defined if module
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
'SolarisDynamicLinker' may not be defined if module
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
'SolarisDynamicLinker' may not be defined if module
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
from .. import options | ||
from ..linkers.linkers import GnuLikeDynamicLinkerMixin, SolarisDynamicLinker, CompCertDynamicLinker |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
'CompCertDynamicLinker' may not be defined if module
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
'CompCertDynamicLinker' may not be defined if module
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
'CompCertDynamicLinker' may not be defined if module
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
'CompCertDynamicLinker' may not be defined if module
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
'CompCertDynamicLinker' may not be defined if module
mesonbuild.linkers.linkers
mesonbuild.compilers.rust
definition
import
1167d7c
to
37d1945
Compare
from ..mesonlib import EnvironmentException, MesonException, Popen_safe_logged | ||
from ..options import OptionKey | ||
from .compilers import Compiler, clike_debug_args | ||
from .mixins.clike import GROUP_FLAGS |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
mesonbuild.compilers.mixins.clike
mesonbuild.compilers.rust
definition
import
'GROUP_FLAGS' may not be defined if module
mesonbuild.compilers.mixins.clike
mesonbuild.compilers.rust
definition
import
'GROUP_FLAGS' may not be defined if module
mesonbuild.compilers.mixins.clike
mesonbuild.compilers.rust
definition
import
'GROUP_FLAGS' may not be defined if module
mesonbuild.compilers.mixins.clike
mesonbuild.compilers.rust
definition
import
'GROUP_FLAGS' may not be defined if module
mesonbuild.compilers.mixins.clike
mesonbuild.compilers.rust
definition
import
'GROUP_FLAGS' may not be defined if module
mesonbuild.compilers.mixins.clike
mesonbuild.compilers.rust
definition
import
'GROUP_FLAGS' may not be defined if module
mesonbuild.compilers.mixins.clike
mesonbuild.compilers.rust
definition
import
'GROUP_FLAGS' may not be defined if module
mesonbuild.compilers.mixins.clike
mesonbuild.compilers.rust
definition
import
'GROUP_FLAGS' may not be defined if module
mesonbuild.compilers.mixins.clike
mesonbuild.compilers.rust
definition
import
'GROUP_FLAGS' may not be defined if module
mesonbuild.compilers.mixins.clike
mesonbuild.compilers.rust
definition
import
4d524dd
to
502317e
Compare
Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
502317e
to
ad18530
Compare
@@ -62,6 +65,37 @@ | |||
except StopIteration: | |||
return None | |||
|
|||
|
|||
class RustcCompilerArgs(arglist.CompilerArgs): |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
This is needed for QEMU, but it may be useful anyway. 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 aslink_with
.Unfortunately, these 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).To improve compatibility, add --start-group and --end-group options like Meson already does with C programs.
This is an alternative to #14031. It is a bit inferior for QEMU, but the changes are a bit simpler. Both can be included if desired.