Use lld-link with clang-cl

Use lld-link dynamic linker with clang-cl
Don't hardcode dynamic linker name in tests
This commit is contained in:
Jon Turney 2018-10-08 19:39:41 +01:00
parent 2993fc4e8a
commit c789efb8c8
No known key found for this signature in database
GPG Key ID: C7C86F0370285C81
2 changed files with 9 additions and 3 deletions

View File

@ -1345,7 +1345,12 @@ class VisualStudioCCompiler(CCompiler):
return [] return []
def get_linker_exelist(self): def get_linker_exelist(self):
return ['link'] # FIXME, should have same path as compiler. # FIXME, should have same path as compiler.
# FIXME, should be controllable via cross-file.
if self.id == 'clang-cl':
return ['lld-link']
else:
return ['link']
def get_linker_always_args(self): def get_linker_always_args(self):
return ['/nologo'] return ['/nologo']

View File

@ -2050,8 +2050,9 @@ int main(int argc, char **argv) {
if extra_args is None: if extra_args is None:
extra_args = [] extra_args = []
if compiler.get_argument_syntax() == 'msvc': if compiler.get_argument_syntax() == 'msvc':
link_cmd = ['link', '/NOLOGO', '/DLL', '/DEBUG', link_cmd = compiler.get_linker_exelist() + [
'/IMPLIB:' + impfile, '/OUT:' + outfile, objectfile] '/NOLOGO', '/DLL', '/DEBUG', '/IMPLIB:' + impfile,
'/OUT:' + outfile, objectfile]
else: else:
extra_args += ['-fPIC'] extra_args += ['-fPIC']
link_cmd = compiler.get_exelist() + ['-shared', '-o', outfile, objectfile] link_cmd = compiler.get_exelist() + ['-shared', '-o', outfile, objectfile]