diff --git a/src/blade/backend.py b/src/blade/backend.py index 699ff6ae..f1f9dc3b 100644 --- a/src/blade/backend.py +++ b/src/blade/backend.py @@ -333,17 +333,17 @@ def _generate_cc_link_rules(self, ld, linkflags): # Linking might have a lot of object files exceeding maximal length of a bash command line. # Using response file can resolve this problem. # Refer to: https://ninja-build.org/manual.html - link_args = '-o ${out} ${intrinsic_linkflags} ${linkflags} ${target_linkflags} @${out}.rsp ${extra_linkflags}' + link_args = '-o ${out} ${intrinsic_linkflags} ${linkflags} @${out}.rsp ${extra_linkflags}' self.generate_rule(name='link', command=ld + ' ' + link_args, rspfile='${out}.rsp', - rspfile_content='${in}', + rspfile_content='${target_linkflags} ${in}', description='LINK BINARY ${out}', pool=pool) self.generate_rule(name='solink', command=ld + ' -shared ' + link_args, rspfile='${out}.rsp', - rspfile_content='${in}', + rspfile_content='${target_linkflags} ${in}', description='LINK SHARED ${out}', pool=pool) diff --git a/src/test/blade_test.py b/src/test/blade_test.py index b316879a..0f358e60 100644 --- a/src/test/blade_test.py +++ b/src/test/blade_test.py @@ -130,7 +130,7 @@ def assertNoWarningCxxFlags(self, cmdline): self._assertCxxNoWarningFlags(cmdline) def assertLinkFlags(self, cmdline): - self.assertIn('-static-libgcc -static-libstdc++', cmdline) + self.assertNotIn('-static-libgcc -static-libstdc++', cmdline) def assertStaticLinkFlags(self, cmdline): self.assertNotIn('-shared', cmdline) diff --git a/src/test/cc_binary_test.py b/src/test/cc_binary_test.py index 03080b32..a82b789e 100644 --- a/src/test/cc_binary_test.py +++ b/src/test/cc_binary_test.py @@ -33,8 +33,8 @@ def testGenerateRules(self): self.assertCxxFlags(com_string_line) self.assertLinkFlags(string_main_depends_libs) - self.assertIn('liblowercase.a', string_main_depends_libs) - self.assertIn('libuppercase.a', string_main_depends_libs) + self.assertNotIn('liblowercase.a', string_main_depends_libs) + self.assertNotIn('libuppercase.a', string_main_depends_libs) self.assertTrue(self.findCommand(['Hello, world'])) diff --git a/src/test/cc_plugin_test.py b/src/test/cc_plugin_test.py index bd74d2db..7dcd834e 100644 --- a/src/test/cc_plugin_test.py +++ b/src/test/cc_plugin_test.py @@ -35,8 +35,8 @@ def testGenerateRules(self): self.assertDynamicLinkFlags(string_plugin_depends_libs) self.assertIn('-Wl,-Bsymbolic', string_plugin_depends_libs) - self.assertIn('liblowercase.a', string_plugin_depends_libs) - self.assertIn('libuppercase.a', string_plugin_depends_libs) + self.assertNotIn('liblowercase.a', string_plugin_depends_libs) + self.assertNotIn('libuppercase.a', string_plugin_depends_libs) if __name__ == '__main__': diff --git a/src/test/cc_test_test.py b/src/test/cc_test_test.py index 7a20601e..3fa6a2d6 100644 --- a/src/test/cc_test_test.py +++ b/src/test/cc_test_test.py @@ -35,8 +35,8 @@ def testGenerateRules(self): self.assertCxxFlags(com_string_line) self.assertLinkFlags(string_main_depends_libs) - self.assertIn('liblowercase.a', string_main_depends_libs) - self.assertIn('libuppercase.a', string_main_depends_libs) + self.assertNotIn('liblowercase.a', string_main_depends_libs) + self.assertNotIn('libuppercase.a', string_main_depends_libs) if __name__ == '__main__': diff --git a/src/test/test_target_test.py b/src/test/test_target_test.py index 0ec20a29..ecab27e5 100644 --- a/src/test/test_target_test.py +++ b/src/test/test_target_test.py @@ -34,7 +34,7 @@ def testTestRunnerCorrectly(self): self.assertCxxFlags(com_string_line) self.assertLinkFlags(string_main_depends_libs) - self.assertIn('liblowercase.a', string_main_depends_libs) + self.assertNotIn('liblowercase.a', string_main_depends_libs) if __name__ == '__main__':