filter_compiler_wrappers: a fix for NAG (#17133)

This commit is contained in:
Sergey Kosukhin 2020-10-19 06:18:18 +02:00 committed by GitHub
parent 4750d479a0
commit fd7bfb1a50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -187,7 +187,13 @@ def _filter_compiler_wrappers_impl(self):
x.filter(os.environ[env_var], compiler_path, **filter_kwargs)
# Remove this linking flag if present (it turns RPATH into RUNPATH)
x.filter('-Wl,--enable-new-dtags', '', **filter_kwargs)
x.filter('{0}--enable-new-dtags'.format(self.compiler.linker_arg), '',
**filter_kwargs)
# NAG compiler is usually mixed with GCC, which has a different
# prefix for linker arguments.
if self.compiler.name == 'nag':
x.filter('-Wl,--enable-new-dtags', '', **filter_kwargs)
PackageMixinsMeta.register_method_after(
_filter_compiler_wrappers_impl, after