diff options
author | Eli Schwartz <eschwartz93@gmail.com> | 2024-02-26 19:55:54 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-03-03 13:42:58 -0500 |
commit | 4d1bfd0939105d244f974974d52e73c46de0ab53 (patch) | |
tree | e80a7a6feca0ede221f003c8a2ec63285e958eb8 /mesonbuild/linkers/linkers.py | |
parent | 46f3cff5b26230900473efcd743763daa7c90453 (diff) | |
download | meson-4d1bfd0939105d244f974974d52e73c46de0ab53.zip meson-4d1bfd0939105d244f974974d52e73c46de0ab53.tar.gz meson-4d1bfd0939105d244f974974d52e73c46de0ab53.tar.bz2 |
compilers: only wrap multiple input libraries with start/end group
When only a single input file shows up in an arglist, it makes no sense
to inject `-W,--start-group -lone -Wl,--end-group`, since there is
nothing being grouped together. It's just longer command lines for
nothing.
Diffstat (limited to 'mesonbuild/linkers/linkers.py')
-rw-r--r-- | mesonbuild/linkers/linkers.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py index e4db015..2048268 100644 --- a/mesonbuild/linkers/linkers.py +++ b/mesonbuild/linkers/linkers.py @@ -978,7 +978,7 @@ class Xc16DynamicLinker(DynamicLinker): version=version) def get_link_whole_for(self, args: T.List[str]) -> T.List[str]: - if not args: + if len(args) < 2: return args return self._apply_prefix('--start-group') + args + self._apply_prefix('--end-group') @@ -1064,7 +1064,7 @@ class TIDynamicLinker(DynamicLinker): version=version) def get_link_whole_for(self, args: T.List[str]) -> T.List[str]: - if not args: + if len(args) < 2: return args return self._apply_prefix('--start-group') + args + self._apply_prefix('--end-group') |